Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMT (Generative Modeling Technologies) » [xText]left-recursive
[xText]left-recursive [message #379040] Sat, 18 August 2007 08:07 Go to next message
Irina is currently offline Irina
Messages: 27
Registered: July 2009
Junior Member
Hi all,
can anybody help me please?
how can i define left-recursive rule in xText?

Stm ->
Stm "::" Stm
| Stm "||" Stm
| Stm ";" Stm
| "if" "(" Expr ")" Stm ["else" Stm]
| "{" Stm "}"
| "assert" "(" Expr ")" ";"
| Id["[" Expr "]"] "=" Expr ";"
| [^] ["this" "."] Id "(" [Expr {"," Expr}] ")" ";"
| [^] Id["[" Expr "]"] "." Id "(" [Expr {"," Expr}] ")" ";"
| ";"

Thanks in advance,
Irina
Re: [xText]left-recursive [message #379046 is a reply to message #379040] Wed, 22 August 2007 09:08 Go to previous message
Marc Habiger is currently offline Marc Habiger
Messages: 6
Registered: July 2009
Junior Member
Hi Irina!

> how can i define left-recursive rule in xText?
> [...]

You can't. You have to rewrite your rules to right-recursive ones.
Have a look (for example) at http://sui66iy.livejournal.com/173598.html

Regards,

Marc
Re: [xText]left-recursive [message #607040 is a reply to message #379040] Wed, 22 August 2007 09:08 Go to previous message
Marc Habiger is currently offline Marc Habiger
Messages: 6
Registered: July 2009
Junior Member
Hi Irina!

> how can i define left-recursive rule in xText?
> [...]

You can't. You have to rewrite your rules to right-recursive ones.
Have a look (for example) at http://sui66iy.livejournal.com/173598.html

Regards,

Marc
Previous Topic:[Epsilon] Error in Running Examples
Next Topic:[MOFScript] Problems with creating and editing a MOFSCript File
Goto Forum:
  


Current Time: Wed Jul 30 11:29:15 EDT 2014

Powered by FUDForum. Page generated in 0.01826 seconds