79 lines
2.8 KiB
Python
79 lines
2.8 KiB
Python
|
# Generated from HMKNF.g4 by ANTLR 4.10.1
|
||
|
from antlr4 import *
|
||
|
from io import StringIO
|
||
|
import sys
|
||
|
if sys.version_info[1] > 5:
|
||
|
from typing import TextIO
|
||
|
else:
|
||
|
from typing.io import TextIO
|
||
|
|
||
|
|
||
|
def serializedATN():
|
||
|
return [
|
||
|
4,0,12,63,6,-1,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,
|
||
|
6,7,6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,1,0,1,0,1,1,1,
|
||
|
1,1,2,1,2,1,2,1,3,1,3,1,4,1,4,1,5,1,5,1,5,1,6,1,6,1,7,1,7,1,8,1,
|
||
|
8,1,8,1,8,1,9,1,9,1,10,4,10,51,8,10,11,10,12,10,52,1,10,1,10,1,11,
|
||
|
1,11,5,11,59,8,11,10,11,12,11,62,9,11,0,0,12,1,1,3,2,5,3,7,4,9,5,
|
||
|
11,6,13,7,15,8,17,9,19,10,21,11,23,12,1,0,3,3,0,9,10,13,13,32,32,
|
||
|
1,0,97,122,3,0,48,57,65,90,97,122,64,0,1,1,0,0,0,0,3,1,0,0,0,0,5,
|
||
|
1,0,0,0,0,7,1,0,0,0,0,9,1,0,0,0,0,11,1,0,0,0,0,13,1,0,0,0,0,15,1,
|
||
|
0,0,0,0,17,1,0,0,0,0,19,1,0,0,0,0,21,1,0,0,0,0,23,1,0,0,0,1,25,1,
|
||
|
0,0,0,3,27,1,0,0,0,5,29,1,0,0,0,7,32,1,0,0,0,9,34,1,0,0,0,11,36,
|
||
|
1,0,0,0,13,39,1,0,0,0,15,41,1,0,0,0,17,43,1,0,0,0,19,47,1,0,0,0,
|
||
|
21,50,1,0,0,0,23,56,1,0,0,0,25,26,5,46,0,0,26,2,1,0,0,0,27,28,5,
|
||
|
44,0,0,28,4,1,0,0,0,29,30,5,58,0,0,30,31,5,45,0,0,31,6,1,0,0,0,32,
|
||
|
33,5,40,0,0,33,8,1,0,0,0,34,35,5,41,0,0,35,10,1,0,0,0,36,37,5,45,
|
||
|
0,0,37,38,5,62,0,0,38,12,1,0,0,0,39,40,5,124,0,0,40,14,1,0,0,0,41,
|
||
|
42,5,38,0,0,42,16,1,0,0,0,43,44,5,110,0,0,44,45,5,111,0,0,45,46,
|
||
|
5,116,0,0,46,18,1,0,0,0,47,48,5,45,0,0,48,20,1,0,0,0,49,51,7,0,0,
|
||
|
0,50,49,1,0,0,0,51,52,1,0,0,0,52,50,1,0,0,0,52,53,1,0,0,0,53,54,
|
||
|
1,0,0,0,54,55,6,10,0,0,55,22,1,0,0,0,56,60,7,1,0,0,57,59,7,2,0,0,
|
||
|
58,57,1,0,0,0,59,62,1,0,0,0,60,58,1,0,0,0,60,61,1,0,0,0,61,24,1,
|
||
|
0,0,0,62,60,1,0,0,0,3,0,52,60,1,6,0,0
|
||
|
]
|
||
|
|
||
|
class HMKNFLexer(Lexer):
|
||
|
|
||
|
atn = ATNDeserializer().deserialize(serializedATN())
|
||
|
|
||
|
decisionsToDFA = [ DFA(ds, i) for i, ds in enumerate(atn.decisionToState) ]
|
||
|
|
||
|
T__0 = 1
|
||
|
T__1 = 2
|
||
|
T__2 = 3
|
||
|
T__3 = 4
|
||
|
T__4 = 5
|
||
|
T__5 = 6
|
||
|
T__6 = 7
|
||
|
T__7 = 8
|
||
|
T__8 = 9
|
||
|
T__9 = 10
|
||
|
WS = 11
|
||
|
IDENTIFIER = 12
|
||
|
|
||
|
channelNames = [ u"DEFAULT_TOKEN_CHANNEL", u"HIDDEN" ]
|
||
|
|
||
|
modeNames = [ "DEFAULT_MODE" ]
|
||
|
|
||
|
literalNames = [ "<INVALID>",
|
||
|
"'.'", "','", "':-'", "'('", "')'", "'->'", "'|'", "'&'", "'not'",
|
||
|
"'-'" ]
|
||
|
|
||
|
symbolicNames = [ "<INVALID>",
|
||
|
"WS", "IDENTIFIER" ]
|
||
|
|
||
|
ruleNames = [ "T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6",
|
||
|
"T__7", "T__8", "T__9", "WS", "IDENTIFIER" ]
|
||
|
|
||
|
grammarFileName = "HMKNF.g4"
|
||
|
|
||
|
def __init__(self, input=None, output:TextIO = sys.stdout):
|
||
|
super().__init__(input, output)
|
||
|
self.checkVersion("4.10.1")
|
||
|
self._interp = LexerATNSimulator(self, self.atn, self.decisionsToDFA, PredictionContextCache())
|
||
|
self._actions = None
|
||
|
self._predicates = None
|
||
|
|
||
|
|