-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add Util/Lexer.pas #337
Add Util/Lexer.pas #337
Conversation
Util/Lexer.pas
Outdated
LexerRules: array[0..2] of TTokenRuleDef = ( | ||
(R: '[A-Z]+'; T: Ord(ttAlpha)), | ||
(R: '\d+'; T: Ord(ttNumeric)), | ||
(R: '[A-Z][A-Z\d]*'; T: Ord(ttAlphaNumeric)) |
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.
Unless I miss something it must start with a letter, so it's not "AlphaNumeric" per se. "1A" won't match for example. I understand it's only examples, but it's a bit confusing.
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.
Good point. I initially started thinking the ttAlphaNumeric and ttNumericAlpha tokens would be useful, but they weren't. In the end for ARRL SS Contest, I converged on three token types: ttAlpha, ttDigits (numeric), and ttCallsign. I will update the above example to remove the ttAlphaNumeric. I will update this example later today or tonight.
In the few days, I'll post the ARRL SS Contest for review. It will show the tables used for SS and will hopefully be more clear. Parsing has never been my strength, so my examples may not be the best to provide.
Thank you for the feedback.
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 updated the comments and pushed an updated version.
Adding a general-purpose Lexer to MRCE. This will be extended for parsing the ARRL Sweepstakes exchange. See #336 for additional details.