Skip to main content



      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
Eclipse UserFriend
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
Eclipse UserFriend
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
Eclipse UserFriend
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: Tue Jul 22 21:15:57 EDT 2025

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

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

Back to the top