Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Problem with unorder group
Problem with unorder group [message #697977] Mon, 18 July 2011 14:16 Go to next message
Elhamlaoui Mahmoud is currently offline Elhamlaoui MahmoudFriend
Messages: 268
Registered: March 2010
Senior Member
Hi,

I had a working grammar, but when i add the '&' to enable the attribute to be dispalyed wherever it crash. Displaying the folowing error :

Quote:

warning(205):.../xtext/ui/contentassist/antlr/internal/InternalDslx.g:82894:2: ANTLR could not analyze this decision in rule rule__Dic__UnorderedGroup__0; often this is because of recursive rule references visible from the left edge of alternatives. ANTLR will re-analyze the decision with a fixed lookahead of k=1. Consider using "options {k=1;}" for that decision and possibly adding a syntactic predicate.
error(10): internal error: org.antlr.tool.Grammar.createLookaheadDFA(Grammar.java:864): could not even do k=1 for decision 616


this is the things i modified :
Dic returns Dic:
	'dic'
&		' a' '=' a=String0
&		(' b'=' b=String0)?
&		(' c'=' c=String0)?
&		(' d'=' d=String0)?
;

i have set the backtrack to true but always the same problem, any ideas
Thanks in advance
Re: Problem with unorder group [message #698058 is a reply to message #697977] Mon, 18 July 2011 17:34 Go to previous messageGo to next message
Alexander Nittka is currently offline Alexander NittkaFriend
Messages: 1193
Registered: July 2009
Senior Member
Hi,

what is your target syntax. I.e. give a couple of examples that are supposed to be correct. I strongly suspect, you are missing some parentheses. Here is what I would assume a more correct rule to look like:
Dic returns Dic:
  'dic'
  (
    'a' '=' a=String0
      &
    ('b' '=' b=String0)?
      &
    ('c' '=' c=String0)?
      &
    ('d' '=' d=String0)?
  )
;


Alex


Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext@itemis.de
Re: Problem with unorder group [message #698364 is a reply to message #698058] Tue, 19 July 2011 10:49 Go to previous message
Elhamlaoui Mahmoud is currently offline Elhamlaoui MahmoudFriend
Messages: 268
Registered: March 2010
Senior Member
Thanks for the clue Alex,
Previous Topic:Persistence problem with optional assignment rules
Next Topic:XText Preprocess
Goto Forum:
  


Current Time: Thu Mar 28 11:41:57 GMT 2024

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

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

Back to the top