-
Notifications
You must be signed in to change notification settings - Fork 90
Resolve ANTLR warnings by defining named lexer tokens #225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
standard/lexical-structure.md
Outdated
SLASH : '/' ; | ||
``` | ||
|
||
Although these are lexer rules, these names are spelled in all-uppercase letters to distinguish them from ordinary lexer rule names. These rules are also written on a single line. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think "These rules are also written on a single line." is redundant and better omitted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm somewhat ambivalent on the calling out of a few tokens as lexical rules and the use of uppercase for them, I'm not sure it enhances the grammar or that it harms it either; however the changes seem correct and I'm therefore happy to approve. I've suggested one line is redundant and can therefore be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with Nigel's comment about the extraneous line.
I believe there was a good reason for the all-caps lexer tokens, although I can't now remember what it was :)
Note for meeting: I don't think there have been changes since the last meeting, so we may wish to skip this. |
This PR addresses Issue #37, Proposal 4 (#37 (comment)). Specifically, it
For now this is a Draft PR, as I want to explore the idea of replacing the use of certain terminals in the syntactic grammar with the 6 new named lexer tokens (for example,
'default'
in a switch statement becomesDEFAULT
).I explored that and decided to not go down that path, as explained in #37 (comment).