Search code examples
antlrdslxtextxtend

More than 3 options are not working while declaring Xtext grammar


Particularly when I use more than 3 OR symbols.

datatype:
    Integer | Float | Char | Blah | Blah
entity:
    Class | Struct | Enumeration | Union 

the complete grammar can be found here: https://gist.github.com/Mrprofessor/7b8df3f00c75ef2ac67bffd0a20e983c


Solution

  • The problem is that your grammar is ambigous

    consider this model

    Bla;
    Blubb;
    Pling;
    

    are these Bits | Pointers | Labels | Entrys | Logicals | HwordLogicals | Bytes