Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Xtext and left recursive
Xtext and left recursive [message #981724] Mon, 12 November 2012 16:46 Go to next message
Tommaso De Sica is currently offline Tommaso De SicaFriend
Messages: 128
Registered: March 2012
Location: Italy
Senior Member

Goodevening all,
today is my first day working with Xtext. I'm trying to write a small grammar and I've got a problem with Left Recursive in one of my Rule.

I have to define ArithmeticExpression, and I use this statement:
ArithmeticExpression:
	term1=ArithmeticExpression ArithmeticOperator term2=ArithmeticExpression | Term | '(' ArithmeticExpression ')'
;


Where
Term
is final (Varible or Constant).

How can I resolve it?

Very thank you for help. Smile
Re: Xtext and left recursive [message #981726 is a reply to message #981724] Mon, 12 November 2012 16:49 Go to previous messageGo to next message
Christian Dietrich is currently online Christian DietrichFriend
Messages: 6482
Registered: July 2009
Senior Member
Hi,

did you read http://blog.efftinge.de/2010/08/parsing-expressions-with-xtext.html

Regards
Christian
Re: Xtext and left recursive [message #985455 is a reply to message #981726] Thu, 15 November 2012 12:07 Go to previous message
Tommaso De Sica is currently offline Tommaso De SicaFriend
Messages: 128
Registered: March 2012
Location: Italy
Senior Member

That's what I need!

Very thank you!
Previous Topic:XText builder run takes many minutes on eclipse start
Next Topic:Allow keywords in any order
Goto Forum:
  


Current Time: Fri Nov 21 20:38:53 GMT 2014

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

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