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