Created
February 17, 2017 16:36
-
-
Save imjching/ca2db329305dedf2cb8e2a5a3f97c648 to your computer and use it in GitHub Desktop.
ScriptLexer.g4
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
// Name our lexer (the name must match the filename) | |
lexer grammar ScriptLexer; | |
// Define string values - either unquoted or quoted | |
STRING : ('a'..'z'|'A'..'Z'|'0'..'9'|'_'|'@')+ | | |
('"' (~('"' | '\\' | '\r' | '\n') | '\\' ('"' | '\\'))* '"') ; | |
// Skip all spaces, tabs, newlines | |
WS : [ \t\r\n]+ -> skip ; | |
// Skip comments | |
LINE_COMMENT : '//' ~[\r\n]* '\r'? '\n' -> skip ; | |
// Define punctuations | |
LPAREN : '<' ; | |
RPAREN : '>' ; | |
EQUALS : '=' ; | |
SEMICO : ';' ; | |
ASSIGN : ':=' ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment