Created
March 28, 2022 17:45
-
-
Save melchisedech333/7e9668a1dce0d5b1eee4b31ac9965752 to your computer and use it in GitHub Desktop.
Lexer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lexer grammar TLexer; | |
@lexer::postinclude { | |
#ifndef _WIN32 | |
#pragma GCC diagnostic ignored "-Wunused-parameter" | |
#endif | |
} | |
/* Tokens. */ | |
STRING : '"' .*? '"' ; | |
INTEGER : [0-9]+ ; | |
VAR : 'var' ; | |
TYPE : [:][a-zA-Z]+ ; | |
VARIABLE : [a-zA-Z]+ ; | |
ATTR : '=' ; | |
SEPARATOR : ',' ; | |
END : ';' ; | |
ARRAY_OPEN : '[' ; | |
ARRAY_CLOSE : ']' ; | |
/* Ignora-os... */ | |
SPACETABS : (' ' | '\t' | '\r' | '\n' ) -> skip; | |
/* Tokens desconhecidos. */ | |
UNKNOWN : . ; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment