left recursion problem [message #754645] |
Thu, 03 November 2011 14:01  |
Eclipse User |
|
|
|
Hi,
I have a problem with the left recursion. I looked it up in the xtext documentation, but I didn't understand it. I hope you can help me out.
The error message is:
error(211): ../org.xtext.gui/src-gen/org/xtext/gui/parser/antlr/internal/InternalGuiDsl.g:257:1: [fatal] rule ruleWindow has non-LL(*) decision due to recursive rule invocations reachable from alts 1,2. Resolve by left-factoring or using syntactic predicates or using backtrack=true option.
warning(200): ../org.xtext.gui/src-gen/org/xtext/gui/parser/antlr/internal/InternalGuiDsl.g:257:1: Decision can match input such as "'tabContainer' RULE_ID '{' '}'" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
Here is my dsl:
Window:
'window' name=ID '{'
(tabContainer+=TabContainer)? /* HERE IS THE PROBLEM */
(components+=Component)*
'}'
;
TabContainer:
'tabContainer' name=ID '{'
(tabItems+=TabItem)*
'}'
;
TabItem:
'tabItem' name=ID '{'
panel+=Panel
'}'
;
Component:
Panel | TabContainer | Label | Button | ComboBox | ListBox | CheckBox | DropDown
;
Panel:
'panel' name=ID '{'
(layoutManager+=LayoutManager)?
(components+= Component)+
'}'
;
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06928 seconds