-
Notifications
You must be signed in to change notification settings - Fork 0
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
James.yang/lexer trie impl #13
base: james.yang/lexer_refactor
Are you sure you want to change the base?
James.yang/lexer trie impl #13
Conversation
STAR, | ||
OPEN_BRACE, | ||
CLOSE_BRACE, | ||
// string tokens | ||
BEGIN_LINE_COMMENT, | ||
BEGIN_BLOCK_COMMENT, | ||
BEGIN_SLINE_COMMENT, |
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.
S
means Special
BEGIN_BLOCK_COMMENT, | ||
BEGIN_SLINE_COMMENT, | ||
BEGIN_SBLOCK_COMMENT, | ||
BEGIN_NLINE_COMMENT, |
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.
N
means Normal
END_BLOCK_COMMENT, | ||
// special tags | ||
TAGNAME, | ||
SDESC, |
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.
So far, I only support these tag names, but it's easy to add more.
@@ -31,8 +38,10 @@ static MAPBOX_ETERNAL_CONSTEXPR const auto symbol_map = | |||
{Symbol::STAR, "*"}, | |||
{Symbol::OPEN_BRACE, "{"}, | |||
{Symbol::CLOSE_BRACE, "}"}, | |||
{Symbol::BEGIN_LINE_COMMENT, "///"}, | |||
{Symbol::BEGIN_BLOCK_COMMENT, "/*!"}, | |||
{Symbol::BEGIN_SLINE_COMMENT, "///"}, |
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.
Still not quite sure how you use this, so let me know if you want me to add more entires for this.
An entirely new, automated way of defining lexer. A special Trie-like object has been introduced to represent a compressed version of all strings to tokenize. Lexer manages this Trie object to change states accordingly.