Skip to content

Labeled elements in lexer #4714

Answered by kaby76
MihaMarkic asked this question in Q&A
Oct 12, 2024 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

.. even antlr4 grammar seemingly support that notation ...

The syntax between lexer and parser rules were identical for Antlr2 and Antlr3 (i.e., a rule_ referenced an altList in Antlr2 and Antlr3), but that changed for Antlr4 with ruleBlock for parser rules and lexerRuleBlock for lexer rules. element has a labeled element reference, lexerElement doesn't.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@MihaMarkic
Comment options

@kaby76
Comment options

Answer selected by MihaMarkic
@MihaMarkic
Comment options

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