Hash :
99f3ddcd
Author :
Date :
2021-06-13T22:00:43
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
options { superClass = LexerAdaptor; }
@lexer::header {
import { Token } from 'antlr4ts/Token';
import { CommonToken } from 'antlr4ts/CommonToken';
import { Python3Parser } from './Python3Parser';
}
END : 'end' {System.out.println("found an end");} ;
@header {
from LexerAdaptor import LexerAdaptor
}
----------------------------------------------------
[
["keyword", "options"],
["action", [
["punctuation", "{"],
["content", " superClass = LexerAdaptor; "],
["punctuation", "}"]
]],
["annotation", "@lexer::header"],
["action", [
["punctuation", "{"],
["content", "\r\n import { Token } from 'antlr4ts/Token';\r\n import { CommonToken } from 'antlr4ts/CommonToken';\r\n import { Python3Parser } from './Python3Parser';\r\n"],
["punctuation", "}"]
]],
["definition", "END"],
["punctuation", ":"],
["string", "'end'"],
["action", [
["punctuation", "{"],
["content", "System.out.println(\"found an end\");"],
["punctuation", "}"]
]],
["punctuation", ";"],
["annotation", "@header"],
["action", [
["punctuation", "{"],
["content", "\r\nfrom LexerAdaptor import LexerAdaptor\r\n"],
["punctuation", "}"]
]]
]
----------------------------------------------------
Checks for actions.