Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Decision can match input such as "'}'" using multiple alternatives
Decision can match input such as "'}'" using multiple alternatives [message #677518] Wed, 08 June 2011 18:04 Go to next message
Elhamlaoui Mahmoud is currently offline Elhamlaoui MahmoudFriend
Messages: 268
Registered: March 2010
Senior Member
Hi,

I have alittle problem with the factoring in my grammar that i couldnt figure out :

i have the flowwing grammar :
Quote:

P returns P:
{P}
'{{ '
('id' id=String0)?
(attr+=AddAttr)?
'}'
(c=C)?
'}}';

AddAttr returns AddAttr:
{AddAttr}
('rId' rId=Int0)?
('value' value=String0)?
;
Int0 returns type::Int:
STRING
;

String0 returns type::String:
STRING
;


Any ideas where the error
Quote:
Decision can match input such as "'}'" using multiple alternatives

comes from
thanks
Re: Decision can match input such as "'}'" using multiple alternatives [message #677545 is a reply to message #677518] Wed, 08 June 2011 19:17 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14716
Registered: July 2009
Senior Member
Hi,

the problem is

(attr+=AddAttr)?


vs.

AddAttr returns AddAttr:
{AddAttr}
('rId' rId=Int0)?
('value' value=String0)?
;


this is too much optionality for the parser
changing to

attr+=AddAttr


should solve the problem

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Decision can match input such as "'}'" using multiple alternatives [message #677741 is a reply to message #677545] Thu, 09 June 2011 09:14 Go to previous message
Elhamlaoui Mahmoud is currently offline Elhamlaoui MahmoudFriend
Messages: 268
Registered: March 2010
Senior Member
thanks Christian, problem solved
Previous Topic:(no subject)
Next Topic:EClasses and EAttributes from external ecore models
Goto Forum:
  


Current Time: Wed Sep 25 04:07:39 GMT 2024

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

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

Back to the top