forked from natural/java2python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJavadocLexer.py
More file actions
124 lines (100 loc) · 5.34 KB
/
JavadocLexer.py
File metadata and controls
124 lines (100 loc) · 5.34 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# Generated from JavadocLexer.g4 by ANTLR 4.7.2
from antlr4 import *
from io import StringIO
from typing.io import TextIO
import sys
def serializedATN():
with StringIO() as buf:
buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2\16")
buf.write("x\b\1\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7")
buf.write("\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r\3\2")
buf.write("\6\2\35\n\2\r\2\16\2\36\3\3\3\3\5\3#\n\3\3\3\3\3\3\3\6")
buf.write("\3(\n\3\r\3\16\3)\5\3,\n\3\3\3\3\3\3\3\3\3\5\3\62\n\3")
buf.write("\3\3\3\3\3\3\6\3\67\n\3\r\3\16\38\5\3;\n\3\3\3\3\3\5\3")
buf.write("?\n\3\3\3\3\3\3\3\6\3D\n\3\r\3\16\3E\5\3H\n\3\5\3J\n\3")
buf.write("\3\4\6\4M\n\4\r\4\16\4N\3\5\6\5R\n\5\r\5\16\5S\3\6\3\6")
buf.write("\3\7\3\7\3\b\3\b\3\t\3\t\3\t\3\t\3\t\7\ta\n\t\f\t\16\t")
buf.write("d\13\t\3\n\5\ng\n\n\3\n\7\nj\n\n\f\n\16\nm\13\n\3\n\3")
buf.write("\n\3\n\3\13\3\13\3\13\3\f\3\f\3\r\3\r\2\2\16\3\3\5\4\7")
buf.write("\5\t\6\13\7\r\b\17\t\21\n\23\13\25\f\27\r\31\16\3\2\5")
buf.write("\4\2C\\c|\4\2\13\13\"\"\n\2\13\f\17\17\"\",,\61\61B\\")
buf.write("c}\177\177\2\u0088\2\3\3\2\2\2\2\5\3\2\2\2\2\7\3\2\2\2")
buf.write("\2\t\3\2\2\2\2\13\3\2\2\2\2\r\3\2\2\2\2\17\3\2\2\2\2\21")
buf.write("\3\2\2\2\2\23\3\2\2\2\2\25\3\2\2\2\2\27\3\2\2\2\2\31\3")
buf.write("\2\2\2\3\34\3\2\2\2\5I\3\2\2\2\7L\3\2\2\2\tQ\3\2\2\2\13")
buf.write("U\3\2\2\2\rW\3\2\2\2\17Y\3\2\2\2\21[\3\2\2\2\23f\3\2\2")
buf.write("\2\25q\3\2\2\2\27t\3\2\2\2\31v\3\2\2\2\33\35\t\2\2\2\34")
buf.write("\33\3\2\2\2\35\36\3\2\2\2\36\34\3\2\2\2\36\37\3\2\2\2")
buf.write("\37\4\3\2\2\2 +\7\f\2\2!#\5\7\4\2\"!\3\2\2\2\"#\3\2\2")
buf.write("\2#\'\3\2\2\2$%\5\r\7\2%&\6\3\2\2&(\3\2\2\2\'$\3\2\2\2")
buf.write("()\3\2\2\2)\'\3\2\2\2)*\3\2\2\2*,\3\2\2\2+\"\3\2\2\2+")
buf.write(",\3\2\2\2,J\3\2\2\2-.\7\17\2\2./\7\f\2\2/:\3\2\2\2\60")
buf.write("\62\5\7\4\2\61\60\3\2\2\2\61\62\3\2\2\2\62\66\3\2\2\2")
buf.write("\63\64\5\r\7\2\64\65\6\3\3\2\65\67\3\2\2\2\66\63\3\2\2")
buf.write("\2\678\3\2\2\28\66\3\2\2\289\3\2\2\29;\3\2\2\2:\61\3\2")
buf.write("\2\2:;\3\2\2\2;J\3\2\2\2<G\7\17\2\2=?\5\7\4\2>=\3\2\2")
buf.write("\2>?\3\2\2\2?C\3\2\2\2@A\5\r\7\2AB\6\3\4\2BD\3\2\2\2C")
buf.write("@\3\2\2\2DE\3\2\2\2EC\3\2\2\2EF\3\2\2\2FH\3\2\2\2G>\3")
buf.write("\2\2\2GH\3\2\2\2HJ\3\2\2\2I \3\2\2\2I-\3\2\2\2I<\3\2\2")
buf.write("\2J\6\3\2\2\2KM\t\3\2\2LK\3\2\2\2MN\3\2\2\2NL\3\2\2\2")
buf.write("NO\3\2\2\2O\b\3\2\2\2PR\n\4\2\2QP\3\2\2\2RS\3\2\2\2SQ")
buf.write("\3\2\2\2ST\3\2\2\2T\n\3\2\2\2UV\7B\2\2V\f\3\2\2\2WX\7")
buf.write(",\2\2X\16\3\2\2\2YZ\7\61\2\2Z\20\3\2\2\2[\\\7\61\2\2\\")
buf.write("]\7,\2\2]^\7,\2\2^b\3\2\2\2_a\5\r\7\2`_\3\2\2\2ad\3\2")
buf.write("\2\2b`\3\2\2\2bc\3\2\2\2c\22\3\2\2\2db\3\2\2\2eg\5\7\4")
buf.write("\2fe\3\2\2\2fg\3\2\2\2gk\3\2\2\2hj\5\r\7\2ih\3\2\2\2j")
buf.write("m\3\2\2\2ki\3\2\2\2kl\3\2\2\2ln\3\2\2\2mk\3\2\2\2no\7")
buf.write(",\2\2op\7\61\2\2p\24\3\2\2\2qr\7}\2\2rs\7B\2\2s\26\3\2")
buf.write("\2\2tu\7}\2\2u\30\3\2\2\2vw\7\177\2\2w\32\3\2\2\2\23\2")
buf.write("\36\")+\618:>EGINSbfk\2")
return buf.getvalue()
class JavadocLexer(Lexer):
atn = ATNDeserializer().deserialize(serializedATN())
decisionsToDFA = [ DFA(ds, i) for i, ds in enumerate(atn.decisionToState) ]
NAME = 1
NEWLINE = 2
SPACE = 3
TEXT_CONTENT = 4
AT = 5
STAR = 6
SLASH = 7
JAVADOC_START = 8
JAVADOC_END = 9
INLINE_TAG_START = 10
BRACE_OPEN = 11
BRACE_CLOSE = 12
channelNames = [ u"DEFAULT_TOKEN_CHANNEL", u"HIDDEN" ]
modeNames = [ "DEFAULT_MODE" ]
literalNames = [ "<INVALID>",
"'@'", "'*'", "'/'", "'{@'", "'{'", "'}'" ]
symbolicNames = [ "<INVALID>",
"NAME", "NEWLINE", "SPACE", "TEXT_CONTENT", "AT", "STAR", "SLASH",
"JAVADOC_START", "JAVADOC_END", "INLINE_TAG_START", "BRACE_OPEN",
"BRACE_CLOSE" ]
ruleNames = [ "NAME", "NEWLINE", "SPACE", "TEXT_CONTENT", "AT", "STAR",
"SLASH", "JAVADOC_START", "JAVADOC_END", "INLINE_TAG_START",
"BRACE_OPEN", "BRACE_CLOSE" ]
grammarFileName = "JavadocLexer.g4"
def __init__(self, input=None, output:TextIO = sys.stdout):
super().__init__(input, output)
self.checkVersion("4.7.2")
self._interp = LexerATNSimulator(self, self.atn, self.decisionsToDFA, PredictionContextCache())
self._actions = None
self._predicates = None
def sempred(self, localctx:RuleContext, ruleIndex:int, predIndex:int):
if self._predicates is None:
preds = dict()
preds[1] = self.NEWLINE_sempred
self._predicates = preds
pred = self._predicates.get(ruleIndex, None)
if pred is not None:
return pred(localctx, predIndex)
else:
raise Exception("No registered predicate for:" + str(ruleIndex))
def NEWLINE_sempred(self, localctx:RuleContext, predIndex:int):
if predIndex == 0:
return _input.LA(1) != '/'
if predIndex == 1:
return _input.LA(1) != '/'
if predIndex == 2:
return _input.LA(1) != '/'