Community
Participate
Working Groups
With the following grammar: -------- Model: greetings+=Greeting*; Greeting: "Hello" name=NAME single=NAME? (double+=NAME double+=NAME)*; NAME hidden(): ID ('.' ID)*; -------- The document "Hello foo bar" raises the error "mismatched input ' ' expecting RULE_ID". The the whitespace it complains about it the one between foo and bar. Same for "Hello foo bar zzz" and the whitespace between bar and zzz. Same for "Hello foo bar zzz yyy" and the whitespaces between (foo and bar) + (zzz and yyy). The grammar works as intended if "hidden()" is omitted. The cause for this error could be that the range of suppressed hidden tokens is larger than just within NAME. However, this explanation seems to be contradictory to "Greeting: 'Hello' name=NAME single=NAME?;" being perfectly able to parse "Hello foo bar".
Hidden tokens are implemented by means of Antlr actions. If the parser is in the lookahead mode, it will not invoke these actions and thereby use the tokens from the wrong channel and refuse to choose one or another alternative. I don't think that there is a general workaround.
Scheduled for SR1 to ensure that we have a look at this problem.
Fixed the described issue in HEAD. However, other things remain annoying with the handling of hidden tokens which will be filed as a new ticket.
Closing bug which were set to RESOLVED before Eclipse Neon.0.