Ambiguous grammar definition

21 Views Asked by At

i'm trying to make a parser for a progrming language that have already his grammar fully specified on an standard, but the almost first rule of the spec is this one:

WS : ( ' ' | '\t' | '\r' | '\n' ) {$channel=HIDDEN;}; // espace blanc
EOL : '\n';

The '\n' character is used on both rules, and the EOL token is used later in some production rules in parser. So my question is when emit a EOL or WS token when i found '\n'.

0

There are 0 best solutions below