Skip to main content



      Home
Home » Modeling » TMF (Xtext) » oaw to tmf grammar problem
- oaw to tmf grammar problem [message #53418] Sat, 27 June 2009 08:03 Go to next message
Eclipse UserFriend
I am migrating an oaw-xtext grammar to tmf, and I am experiencing a
problem :

I have some very simple rules like :

MyRule :
"SomeKeyword"; //rule without any attribute

With oaw-xtext, MyRule nodes were successfully instantiated. But with tmf,
they are not anymore...

Then I tried to do the following :

MyRule :
"SomeKeyword" (foo=STRING)?;

In the generated editor :

SomeKeyword // -> NO MyRule node is instantiated
SomeKeyword "bar" // -> a MyRule node is instantiated (but I really don't
need the extra information!)

It seems that MyRule is treated like a terminal rule...
What can I do to have my grammar working ?
- Re: oaw to tmf grammar problem [message #53557 is a reply to message #53418] Sat, 27 June 2009 14:38 Go to previous messageGo to next message
Eclipse UserFriend
Hi Romain,

please have a look at the documentation of unassigned actions. They'll
do what you want:

MyRule:
"SomeKeyword" {MyRule}.

See here: http://www.eclipse.org/Xtext/documentation/0_7_0/xtext.html# syntax

Hope that helps,
Sebastian

Am 27.06.2009 14:03 Uhr, schrieb Romain Bernard:
> I am migrating an oaw-xtext grammar to tmf, and I am experiencing a
> problem :
>
> I have some very simple rules like :
>
> MyRule :
> "SomeKeyword"; //rule without any attribute
>
> With oaw-xtext, MyRule nodes were successfully instantiated. But with
> tmf, they are not anymore...
>
> Then I tried to do the following :
>
> MyRule :
> "SomeKeyword" (foo=STRING)?;
> In the generated editor :
>
> SomeKeyword // -> NO MyRule node is instantiated
> SomeKeyword "bar" // -> a MyRule node is instantiated (but I really
> don't need the extra information!)
>
> It seems that MyRule is treated like a terminal rule...
> What can I do to have my grammar working ?
>
>
>
- Re: oaw to tmf grammar problem [message #53887 is a reply to message #53557] Sun, 28 June 2009 16:15 Go to previous message
Eclipse UserFriend
It solved my pb !
Thank you.
Previous Topic:debugging DSL serialisation
Next Topic:Suggestion - custom post processing
Goto Forum:
  


Current Time: Thu May 08 09:52:43 EDT 2025

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

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

Back to the top