Community
Participate
Working Groups
Build Identifier: I20110512-2000 I am currently trying Xtext 2 (nightly builds: 2.0.0.v201105310915). I have the following grammar element (not complete): Module_Impl returns Module: 'package' package=EString 'Module' name=ID '{' (commands+=Command)* '}' ((exposedInterfaces+=EventInterface)* & (errors+=Error)* & (dataTypes+=DataType)*); When I run the workflow to generate the code for this grammar, the following error occurs in the console (see attachment 1 [details]) If I remove the parentheses in my grammar: Module_Impl returns Module: 'package' package=EString 'Module' name=ID '{' (commands+=Command)* '}' (exposedInterfaces+=EventInterface)* & (errors+=Error)* & (dataTypes+=DataType)*; Then no exception occurs but I still have those errors: warning(200): ../be.picanol.moduleDSL.xtext.pm.ui/src-gen/be/picanol/moduleDSL/xtext/pm/ui/contentassist/antlr/internal/InternalModule.g:2893:45: Decision can match input such as "'error' RULE_ID" using multiple alternatives: 1, 2 As a result, alternative(s) 2 were disabled for that input Semantic predicates were present but were hidden by actions. warning(200): ../be.picanol.moduleDSL.xtext.pm.ui/src-gen/be/picanol/moduleDSL/xtext/pm/ui/contentassist/antlr/internal/InternalModule.g:2915:48: Decision can match input such as "'dataType' RULE_ID" using multiple alternatives: 1, 2 As a result, alternative(s) 2 were disabled for that input Semantic predicates were present but were hidden by actions. Removing the '&' characters solves all errors. This grammar was producing no errors with Xtext 1.0.1 Reproducible: Always
Created attachment 197073 [details] Errors and exception call stack
sounds like your grammar is ambiguous. Could you attach the complete grammar?
Created attachment 197078 [details] Complete grammar
(In reply to comment #2) > sounds like your grammar is ambiguous. Could you attach the complete grammar? This grammar was working fine with Xtext 1.0 (it's still work in progress but no errors were generated and I had an editor for it).
I cannot reproduce the problem with your grammar (modified it to use a generated metamodel instead of an imported metamodel).
I did not recognize that the attached grammar does not use unordered groups. Will try again ...
I can reproduce the issue with a simplified version of the grammar: grammar org.xtext.example.mydsl.MyDsl with org.eclipse.xtext.common.Terminals generate myDsl "http://www.xtext.org/example/mydsl/MyDsl" Model: ( (a+=A)* & (b+=B)* & (c+=C)* ); A: 'a' name=ID; B: 'b' name=ID; C: 'c' name=ID;
Note that the simplified example leads to warnings instead of errors thus the FileNotFoundException does not occur. However, it should not lead to warnings in the generated parsers.
not 2.1
can no be reproduced with xtext 2.8.4 (old workflow) and xtext 2.10 (new workflow)