Closed JohnAlexCO closed 1 year ago
Different grammars also produce various unexplained errors. For example, with the rules
IDENTIFIER : [A-Za-z_$] ;
ASSIGNMENT : ':' ;
and the text
print:
the lab gives the following error:
1:5 token recognition error at: ':'
You need to define IDENTIFIER after all other tokens, otherwise 'func' is considered an IDENTIFIER
hi. yep, lexer rules Match the longest match and then, if there's an ambiguity between rules, matches the first one specified.
This issue is specifically with the online lab. Minimum Repeatable example:
given the input
Gives the errors
I'm not sure what these error messages are even supposed to mean in this context; DECLARE is clearly not missing, and
assignment
expects four terms, so I'm not sure how the input is "extraneous". I think there's something wrong with the lab.