Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » [EMFTVM] Problem with Back Slash character
[EMFTVM] Problem with Back Slash character [message #1321295] Tue, 29 April 2014 07:43 Go to next message
Victor Pavon is currently offline Victor PavonFriend
Messages: 50
Registered: April 2012
Location: Spain
Member
Hello,

I have a file path string where I'd like change all occurrences of Slash character by Back Slash character. I use the method replaceAll, but the problem is that I get the error:

org.eclipse.m2m.atl.emftvm.util.VMException: java.util.regex.PatternSyntaxException: Unexpected internal error near index 1
\
 ^
at public java.lang.String java.lang.String.replaceAll(java.lang.String,java.lang.String)
	Local variables: []



Best regards,
Víctor Pavón.


Víctor Pavón,
Research at Quercus Software Engineering Group
University of Extremadura, Spain.
Re: [EMFTVM] Problem with Back Slash character [message #1321367 is a reply to message #1321295] Tue, 29 April 2014 08:39 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 589
Registered: September 2012
Location: Belgium
Senior Member

You need to escape the backslash by adding another backslash (i.e. '\\'). Can you show the ATL code?

Cheers,
Dennis
Re: [EMFTVM] Problem with Back Slash character [message #1321426 is a reply to message #1321367] Tue, 29 April 2014 09:24 Go to previous messageGo to next message
Victor Pavon is currently offline Victor PavonFriend
Messages: 50
Registered: April 2012
Location: Spain
Member
I escaped it. This is the ATL code:

helper context mmStrutsConfig!ForwardType def : getPages : Sequence(mmMIGRARIAMVC!Page) =
    thisModule.allPageInstances->select(page |    let pagePath : String = page.path.replaceAll('\\', '/') in página
                                                             				 pagePath.endsWith(self.path));


Víctor Pavón,
Research at Quercus Software Engineering Group
University of Extremadura, Spain.

[Updated on: Tue, 29 April 2014 09:25]

Report message to a moderator

Re: [EMFTVM] Problem with Back Slash character [message #1321885 is a reply to message #1321426] Tue, 29 April 2014 15:07 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 589
Registered: September 2012
Location: Belgium
Senior Member

try page.path.replaceAll('\\\\', '/')

Cheers,
Dennis
Re: [EMFTVM] Problem with Back Slash character [message #1323402 is a reply to message #1321885] Wed, 30 April 2014 08:32 Go to previous message
Victor Pavon is currently offline Victor PavonFriend
Messages: 50
Registered: April 2012
Location: Spain
Member
Thank you. Know works properly

Víctor Pavón,
Research at Quercus Software Engineering Group
University of Extremadura, Spain.
Previous Topic:sequence as return of a helper
Next Topic:[ATL] Translate BPMN models into UML
Goto Forum:
  


Current Time: Fri Apr 26 12:05:45 GMT 2024

Powered by FUDForum. Page generated in 0.05490 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top