Skip to content

problem with grammar in ANTLR Lab #4468

Answered by kaby76
rwblues asked this question in Q&A
Nov 17, 2023 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

Make sure you click on the lexer source code tab and erase everything in that textbox. You have a 'combined grammar' so you only put the combined grammar in 'Parser' textbox. The lab.antlr.org website uses an interpreter of the grammar, so actions {getText().length() > 1} don't work. By the way that action won't work for a generated parser because the code won't compile...missing semicolon.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@kaby76
Comment options

@rwblues
Comment options

Answer selected by rwblues
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants