Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » how to specify to use a name between single quotes in xtext
how to specify to use a name between single quotes in xtext [message #1049434] Thu, 25 April 2013 17:28 Go to next message
Herbert Quartel is currently offline Herbert Quartel
Messages: 2
Registered: April 2013
Junior Member
I am working on specifying a DSL using XTEXT.

Part of the syntax is that a number of names are between single quotes or double quotes.

Until now I am unsuccessful in achieving this.

What will be the rule in XTEXT for : Process 'my process'

and

"This is my definition" =

What I have tried for the single quote example is:

 Process:
    'Process' '\'' name=ID '\'' ;


but this will give the following error when I compile the .mwe2 file and run as Eclipseapplication: mismatched input ''hello'' expecting '''

Please point me to the right direction to solve this. It must be something trivial, but I cannot seem to solve this...
Re: how to specify to use a name between single quotes in xtext [message #1049994 is a reply to message #1049434] Fri, 26 April 2013 10:57 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6230
Registered: July 2009
Senior Member
Hi,

your rule collides with the string rule so you may have to override the string rule not to use single quotes.
btw why dont you simply use name=STRING instead?
Re: how to specify to use a name between single quotes in xtext [message #1050164 is a reply to message #1049994] Fri, 26 April 2013 16:09 Go to previous message
Herbert Quartel is currently offline Herbert Quartel
Messages: 2
Registered: April 2013
Junior Member
OK, thanks for the quick reply.

I am learning XTEXT , so the syntax and constructs and grammar are not yet clear to me. Need to dig into it.

Pointers to information are welcome
Previous Topic:Enumeration error (Importing from existing ecore)
Next Topic:Multiple model instances
Goto Forum:
  


Current Time: Thu Aug 28 11:30:50 EDT 2014

Powered by FUDForum. Page generated in 0.07694 seconds