Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
fja
eval
Commits
bbf32586
Commit
bbf32586
authored
Mar 29, 2020
by
Kateřina Sloupová
Browse files
renaming, reg.py middle module added
parent
757ac88b
Pipeline
#57126
failed with stage
in 21 seconds
Changes
36
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
DFA
_grammar
.g4
→
DFA.g4
View file @
bbf32586
grammar DFA
_grammar
;
grammar DFA;
/* Parser Rules */
...
...
DFA
_grammar
Lexer.py
→
DFALexer.py
View file @
bbf32586
# Generated from DFA
_grammar
.g4 by ANTLR 4.8
# Generated from DFA.g4 by ANTLR 4.8
from
antlr4
import
*
from
io
import
StringIO
from
typing.io
import
TextIO
...
...
@@ -32,7 +32,7 @@ def serializedATN():
return
buf
.
getvalue
()
class
DFA
_grammar
Lexer
(
Lexer
):
class
DFALexer
(
Lexer
):
atn
=
ATNDeserializer
().
deserialize
(
serializedATN
())
...
...
@@ -64,7 +64,7 @@ class DFA_grammarLexer(Lexer):
"LEFT_BRACKET"
,
"RIGHT_BRACKET"
,
"COMMA"
,
"FINAL"
,
"STATE"
,
"WS"
]
grammarFileName
=
"DFA
_grammar
.g4"
grammarFileName
=
"DFA.g4"
def
__init__
(
self
,
input
=
None
,
output
:
TextIO
=
sys
.
stdout
):
super
().
__init__
(
input
,
output
)
...
...
DFAListener.py
0 → 100644
View file @
bbf32586
# Generated from DFA.g4 by ANTLR 4.8
from
antlr4
import
*
if
__name__
is
not
None
and
"."
in
__name__
:
from
.DFAParser
import
DFAParser
else
:
from
DFAParser
import
DFAParser
# This class defines a complete listener for a parse tree produced by DFAParser.
class
DFAListener
(
ParseTreeListener
):
# Enter a parse tree produced by DFAParser#start.
def
enterStart
(
self
,
ctx
:
DFAParser
.
StartContext
):
pass
# Exit a parse tree produced by DFAParser#start.
def
exitStart
(
self
,
ctx
:
DFAParser
.
StartContext
):
pass
# Enter a parse tree produced by DFAParser#init.
def
enterInit
(
self
,
ctx
:
DFAParser
.
InitContext
):
pass
# Exit a parse tree produced by DFAParser#init.
def
exitInit
(
self
,
ctx
:
DFAParser
.
InitContext
):
pass
# Enter a parse tree produced by DFAParser#production.
def
enterProduction
(
self
,
ctx
:
DFAParser
.
ProductionContext
):
pass
# Exit a parse tree produced by DFAParser#production.
def
exitProduction
(
self
,
ctx
:
DFAParser
.
ProductionContext
):
pass
# Enter a parse tree produced by DFAParser#final.
def
enterFinal
(
self
,
ctx
:
DFAParser
.
FinalContext
):
pass
# Exit a parse tree produced by DFAParser#final.
def
exitFinal
(
self
,
ctx
:
DFAParser
.
FinalContext
):
pass
# Enter a parse tree produced by DFAParser#statename.
def
enterStatename
(
self
,
ctx
:
DFAParser
.
StatenameContext
):
pass
# Exit a parse tree produced by DFAParser#statename.
def
exitStatename
(
self
,
ctx
:
DFAParser
.
StatenameContext
):
pass
del
DFAParser
\ No newline at end of file
DFA
_grammar
Parser.py
→
DFAParser.py
View file @
bbf32586
# Generated from DFA
_grammar
.g4 by ANTLR 4.8
# Generated from DFA.g4 by ANTLR 4.8
# encoding: utf-8
from
antlr4
import
*
from
io
import
StringIO
...
...
@@ -32,9 +32,9 @@ def serializedATN():
return
buf
.
getvalue
()
class
DFA
_grammar
Parser
(
Parser
):
class
DFAParser
(
Parser
):
grammarFileName
=
"DFA
_grammar
.g4"
grammarFileName
=
"DFA.g4"
atn
=
ATNDeserializer
().
deserialize
(
serializedATN
())
...
...
@@ -85,22 +85,22 @@ class DFA_grammarParser ( Parser ):
self
.
parser
=
parser
def
init
(
self
):
return
self
.
getTypedRuleContext
(
DFA
_grammar
Parser
.
InitContext
,
0
)
return
self
.
getTypedRuleContext
(
DFAParser
.
InitContext
,
0
)
def
final
(
self
):
return
self
.
getTypedRuleContext
(
DFA
_grammar
Parser
.
FinalContext
,
0
)
return
self
.
getTypedRuleContext
(
DFAParser
.
FinalContext
,
0
)
def
production
(
self
,
i
:
int
=
None
):
if
i
is
None
:
return
self
.
getTypedRuleContexts
(
DFA
_grammar
Parser
.
ProductionContext
)
return
self
.
getTypedRuleContexts
(
DFAParser
.
ProductionContext
)
else
:
return
self
.
getTypedRuleContext
(
DFA
_grammar
Parser
.
ProductionContext
,
i
)
return
self
.
getTypedRuleContext
(
DFAParser
.
ProductionContext
,
i
)
def
getRuleIndex
(
self
):
return
DFA
_grammar
Parser
.
RULE_start
return
DFAParser
.
RULE_start
def
enterRule
(
self
,
listener
:
ParseTreeListener
):
if
hasattr
(
listener
,
"enterStart"
):
...
...
@@ -115,7 +115,7 @@ class DFA_grammarParser ( Parser ):
def
start
(
self
):
localctx
=
DFA
_grammar
Parser
.
StartContext
(
self
,
self
.
_ctx
,
self
.
state
)
localctx
=
DFAParser
.
StartContext
(
self
,
self
.
_ctx
,
self
.
state
)
self
.
enterRule
(
localctx
,
0
,
self
.
RULE_start
)
self
.
_la
=
0
# Token type
try
:
...
...
@@ -125,7 +125,7 @@ class DFA_grammarParser ( Parser ):
self
.
state
=
14
self
.
_errHandler
.
sync
(
self
)
_la
=
self
.
_input
.
LA
(
1
)
while
_la
==
DFA
_grammar
Parser
.
LEFT_PARENTHESIS
:
while
_la
==
DFAParser
.
LEFT_PARENTHESIS
:
self
.
state
=
11
self
.
production
()
self
.
state
=
16
...
...
@@ -150,17 +150,17 @@ class DFA_grammarParser ( Parser ):
self
.
parser
=
parser
def
INIT
(
self
):
return
self
.
getToken
(
DFA
_grammar
Parser
.
INIT
,
0
)
return
self
.
getToken
(
DFAParser
.
INIT
,
0
)
def
EQUALS
(
self
):
return
self
.
getToken
(
DFA
_grammar
Parser
.
EQUALS
,
0
)
return
self
.
getToken
(
DFAParser
.
EQUALS
,
0
)
def
statename
(
self
):
return
self
.
getTypedRuleContext
(
DFA
_grammar
Parser
.
StatenameContext
,
0
)
return
self
.
getTypedRuleContext
(
DFAParser
.
StatenameContext
,
0
)
def
getRuleIndex
(
self
):
return
DFA
_grammar
Parser
.
RULE_init
return
DFAParser
.
RULE_init
def
enterRule
(
self
,
listener
:
ParseTreeListener
):
if
hasattr
(
listener
,
"enterInit"
):
...
...
@@ -175,22 +175,22 @@ class DFA_grammarParser ( Parser ):
def
init
(
self
):
localctx
=
DFA
_grammar
Parser
.
InitContext
(
self
,
self
.
_ctx
,
self
.
state
)
localctx
=
DFAParser
.
InitContext
(
self
,
self
.
_ctx
,
self
.
state
)
self
.
enterRule
(
localctx
,
2
,
self
.
RULE_init
)
try
:
self
.
enterOuterAlt
(
localctx
,
1
)
self
.
state
=
23
self
.
_errHandler
.
sync
(
self
)
token
=
self
.
_input
.
LA
(
1
)
if
token
in
[
DFA
_grammar
Parser
.
INIT
]:
if
token
in
[
DFAParser
.
INIT
]:
self
.
state
=
19
self
.
match
(
DFA
_grammar
Parser
.
INIT
)
self
.
match
(
DFAParser
.
INIT
)
self
.
state
=
20
self
.
match
(
DFA
_grammar
Parser
.
EQUALS
)
self
.
match
(
DFAParser
.
EQUALS
)
self
.
state
=
21
self
.
statename
()
pass
elif
token
in
[
DFA
_grammar
Parser
.
LEFT_PARENTHESIS
,
DFA
_grammar
Parser
.
FINAL
]:
elif
token
in
[
DFAParser
.
LEFT_PARENTHESIS
,
DFAParser
.
FINAL
]:
pass
else
:
raise
NoViableAltException
(
self
)
...
...
@@ -211,26 +211,26 @@ class DFA_grammarParser ( Parser ):
self
.
parser
=
parser
def
LEFT_PARENTHESIS
(
self
):
return
self
.
getToken
(
DFA
_grammar
Parser
.
LEFT_PARENTHESIS
,
0
)
return
self
.
getToken
(
DFAParser
.
LEFT_PARENTHESIS
,
0
)
def
statename
(
self
,
i
:
int
=
None
):
if
i
is
None
:
return
self
.
getTypedRuleContexts
(
DFA
_grammar
Parser
.
StatenameContext
)
return
self
.
getTypedRuleContexts
(
DFAParser
.
StatenameContext
)
else
:
return
self
.
getTypedRuleContext
(
DFA
_grammar
Parser
.
StatenameContext
,
i
)
return
self
.
getTypedRuleContext
(
DFAParser
.
StatenameContext
,
i
)
def
COMMA
(
self
):
return
self
.
getToken
(
DFA
_grammar
Parser
.
COMMA
,
0
)
return
self
.
getToken
(
DFAParser
.
COMMA
,
0
)
def
RIGHT_PARENTHESIS
(
self
):
return
self
.
getToken
(
DFA
_grammar
Parser
.
RIGHT_PARENTHESIS
,
0
)
return
self
.
getToken
(
DFAParser
.
RIGHT_PARENTHESIS
,
0
)
def
EQUALS
(
self
):
return
self
.
getToken
(
DFA
_grammar
Parser
.
EQUALS
,
0
)
return
self
.
getToken
(
DFAParser
.
EQUALS
,
0
)
def
getRuleIndex
(
self
):
return
DFA
_grammar
Parser
.
RULE_production
return
DFAParser
.
RULE_production
def
enterRule
(
self
,
listener
:
ParseTreeListener
):
if
hasattr
(
listener
,
"enterProduction"
):
...
...
@@ -245,22 +245,22 @@ class DFA_grammarParser ( Parser ):
def
production
(
self
):
localctx
=
DFA
_grammar
Parser
.
ProductionContext
(
self
,
self
.
_ctx
,
self
.
state
)
localctx
=
DFAParser
.
ProductionContext
(
self
,
self
.
_ctx
,
self
.
state
)
self
.
enterRule
(
localctx
,
4
,
self
.
RULE_production
)
try
:
self
.
enterOuterAlt
(
localctx
,
1
)
self
.
state
=
25
self
.
match
(
DFA
_grammar
Parser
.
LEFT_PARENTHESIS
)
self
.
match
(
DFAParser
.
LEFT_PARENTHESIS
)
self
.
state
=
26
self
.
statename
()
self
.
state
=
27
self
.
match
(
DFA
_grammar
Parser
.
COMMA
)
self
.
match
(
DFAParser
.
COMMA
)
self
.
state
=
28
self
.
statename
()
self
.
state
=
29
self
.
match
(
DFA
_grammar
Parser
.
RIGHT_PARENTHESIS
)
self
.
match
(
DFAParser
.
RIGHT_PARENTHESIS
)
self
.
state
=
30
self
.
match
(
DFA
_grammar
Parser
.
EQUALS
)
self
.
match
(
DFAParser
.
EQUALS
)
self
.
state
=
31
self
.
statename
()
except
RecognitionException
as
re
:
...
...
@@ -279,32 +279,32 @@ class DFA_grammarParser ( Parser ):
self
.
parser
=
parser
def
FINAL
(
self
):
return
self
.
getToken
(
DFA
_grammar
Parser
.
FINAL
,
0
)
return
self
.
getToken
(
DFAParser
.
FINAL
,
0
)
def
EQUALS
(
self
):
return
self
.
getToken
(
DFA
_grammar
Parser
.
EQUALS
,
0
)
return
self
.
getToken
(
DFAParser
.
EQUALS
,
0
)
def
LEFT_BRACKET
(
self
):
return
self
.
getToken
(
DFA
_grammar
Parser
.
LEFT_BRACKET
,
0
)
return
self
.
getToken
(
DFAParser
.
LEFT_BRACKET
,
0
)
def
RIGHT_BRACKET
(
self
):
return
self
.
getToken
(
DFA
_grammar
Parser
.
RIGHT_BRACKET
,
0
)
return
self
.
getToken
(
DFAParser
.
RIGHT_BRACKET
,
0
)
def
statename
(
self
,
i
:
int
=
None
):
if
i
is
None
:
return
self
.
getTypedRuleContexts
(
DFA
_grammar
Parser
.
StatenameContext
)
return
self
.
getTypedRuleContexts
(
DFAParser
.
StatenameContext
)
else
:
return
self
.
getTypedRuleContext
(
DFA
_grammar
Parser
.
StatenameContext
,
i
)
return
self
.
getTypedRuleContext
(
DFAParser
.
StatenameContext
,
i
)
def
COMMA
(
self
,
i
:
int
=
None
):
if
i
is
None
:
return
self
.
getTokens
(
DFA
_grammar
Parser
.
COMMA
)
return
self
.
getTokens
(
DFAParser
.
COMMA
)
else
:
return
self
.
getToken
(
DFA
_grammar
Parser
.
COMMA
,
i
)
return
self
.
getToken
(
DFAParser
.
COMMA
,
i
)
def
getRuleIndex
(
self
):
return
DFA
_grammar
Parser
.
RULE_final
return
DFAParser
.
RULE_final
def
enterRule
(
self
,
listener
:
ParseTreeListener
):
if
hasattr
(
listener
,
"enterFinal"
):
...
...
@@ -319,29 +319,29 @@ class DFA_grammarParser ( Parser ):
def
final
(
self
):
localctx
=
DFA
_grammar
Parser
.
FinalContext
(
self
,
self
.
_ctx
,
self
.
state
)
localctx
=
DFAParser
.
FinalContext
(
self
,
self
.
_ctx
,
self
.
state
)
self
.
enterRule
(
localctx
,
6
,
self
.
RULE_final
)
self
.
_la
=
0
# Token type
try
:
self
.
enterOuterAlt
(
localctx
,
1
)
self
.
state
=
33
self
.
match
(
DFA
_grammar
Parser
.
FINAL
)
self
.
match
(
DFAParser
.
FINAL
)
self
.
state
=
34
self
.
match
(
DFA
_grammar
Parser
.
EQUALS
)
self
.
match
(
DFAParser
.
EQUALS
)
self
.
state
=
35
self
.
match
(
DFA
_grammar
Parser
.
LEFT_BRACKET
)
self
.
match
(
DFAParser
.
LEFT_BRACKET
)
self
.
state
=
45
self
.
_errHandler
.
sync
(
self
)
token
=
self
.
_input
.
LA
(
1
)
if
token
in
[
DFA
_grammar
Parser
.
STATE
]:
if
token
in
[
DFAParser
.
STATE
]:
self
.
state
=
36
self
.
statename
()
self
.
state
=
41
self
.
_errHandler
.
sync
(
self
)
_la
=
self
.
_input
.
LA
(
1
)
while
_la
==
DFA
_grammar
Parser
.
COMMA
:
while
_la
==
DFAParser
.
COMMA
:
self
.
state
=
37
self
.
match
(
DFA
_grammar
Parser
.
COMMA
)
self
.
match
(
DFAParser
.
COMMA
)
self
.
state
=
38
self
.
statename
()
self
.
state
=
43
...
...
@@ -349,13 +349,13 @@ class DFA_grammarParser ( Parser ):
_la
=
self
.
_input
.
LA
(
1
)
pass
elif
token
in
[
DFA
_grammar
Parser
.
RIGHT_BRACKET
]:
elif
token
in
[
DFAParser
.
RIGHT_BRACKET
]:
pass
else
:
raise
NoViableAltException
(
self
)
self
.
state
=
47
self
.
match
(
DFA
_grammar
Parser
.
RIGHT_BRACKET
)
self
.
match
(
DFAParser
.
RIGHT_BRACKET
)
except
RecognitionException
as
re
:
localctx
.
exception
=
re
self
.
_errHandler
.
reportError
(
self
,
re
)
...
...
@@ -372,10 +372,10 @@ class DFA_grammarParser ( Parser ):
self
.
parser
=
parser
def
STATE
(
self
):
return
self
.
getToken
(
DFA
_grammar
Parser
.
STATE
,
0
)
return
self
.
getToken
(
DFAParser
.
STATE
,
0
)
def
getRuleIndex
(
self
):
return
DFA
_grammar
Parser
.
RULE_statename
return
DFAParser
.
RULE_statename
def
enterRule
(
self
,
listener
:
ParseTreeListener
):
if
hasattr
(
listener
,
"enterStatename"
):
...
...
@@ -390,12 +390,12 @@ class DFA_grammarParser ( Parser ):
def
statename
(
self
):
localctx
=
DFA
_grammar
Parser
.
StatenameContext
(
self
,
self
.
_ctx
,
self
.
state
)
localctx
=
DFAParser
.
StatenameContext
(
self
,
self
.
_ctx
,
self
.
state
)
self
.
enterRule
(
localctx
,
8
,
self
.
RULE_statename
)
try
:
self
.
enterOuterAlt
(
localctx
,
1
)
self
.
state
=
49
self
.
match
(
DFA
_grammar
Parser
.
STATE
)
self
.
match
(
DFAParser
.
STATE
)
except
RecognitionException
as
re
:
localctx
.
exception
=
re
self
.
_errHandler
.
reportError
(
self
,
re
)
...
...
DFA_grammar.interp
deleted
100644 → 0
View file @
757ac88b
token literal names:
null
'init'
'='
'('
')'
'{'
'}'
','
null
null
null
token symbolic names:
null
INIT
EQUALS
LEFT_PARENTHESIS
RIGHT_PARENTHESIS
LEFT_BRACKET
RIGHT_BRACKET
COMMA
FINAL
STATE
WS
rule names:
start
init
production
final
statename
atn:
[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 12, 54, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 3, 2, 3, 2, 7, 2, 15, 10, 2, 12, 2, 14, 2, 18, 11, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 26, 10, 3, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 7, 5, 42, 10, 5, 12, 5, 14, 5, 45, 11, 5, 3, 5, 5, 5, 48, 10, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 2, 2, 7, 2, 4, 6, 8, 10, 2, 2, 2, 52, 2, 12, 3, 2, 2, 2, 4, 25, 3, 2, 2, 2, 6, 27, 3, 2, 2, 2, 8, 35, 3, 2, 2, 2, 10, 51, 3, 2, 2, 2, 12, 16, 5, 4, 3, 2, 13, 15, 5, 6, 4, 2, 14, 13, 3, 2, 2, 2, 15, 18, 3, 2, 2, 2, 16, 14, 3, 2, 2, 2, 16, 17, 3, 2, 2, 2, 17, 19, 3, 2, 2, 2, 18, 16, 3, 2, 2, 2, 19, 20, 5, 8, 5, 2, 20, 3, 3, 2, 2, 2, 21, 22, 7, 3, 2, 2, 22, 23, 7, 4, 2, 2, 23, 26, 5, 10, 6, 2, 24, 26, 3, 2, 2, 2, 25, 21, 3, 2, 2, 2, 25, 24, 3, 2, 2, 2, 26, 5, 3, 2, 2, 2, 27, 28, 7, 5, 2, 2, 28, 29, 5, 10, 6, 2, 29, 30, 7, 9, 2, 2, 30, 31, 5, 10, 6, 2, 31, 32, 7, 6, 2, 2, 32, 33, 7, 4, 2, 2, 33, 34, 5, 10, 6, 2, 34, 7, 3, 2, 2, 2, 35, 36, 7, 10, 2, 2, 36, 37, 7, 4, 2, 2, 37, 47, 7, 7, 2, 2, 38, 43, 5, 10, 6, 2, 39, 40, 7, 9, 2, 2, 40, 42, 5, 10, 6, 2, 41, 39, 3, 2, 2, 2, 42, 45, 3, 2, 2, 2, 43, 41, 3, 2, 2, 2, 43, 44, 3, 2, 2, 2, 44, 48, 3, 2, 2, 2, 45, 43, 3, 2, 2, 2, 46, 48, 3, 2, 2, 2, 47, 38, 3, 2, 2, 2, 47, 46, 3, 2, 2, 2, 48, 49, 3, 2, 2, 2, 49, 50, 7, 8, 2, 2, 50, 9, 3, 2, 2, 2, 51, 52, 7, 11, 2, 2, 52, 11, 3, 2, 2, 2, 6, 16, 25, 43, 47]
\ No newline at end of file
DFA_grammar.tokens
deleted
100644 → 0
View file @
757ac88b
INIT=1
EQUALS=2
LEFT_PARENTHESIS=3
RIGHT_PARENTHESIS=4
LEFT_BRACKET=5
RIGHT_BRACKET=6
COMMA=7
FINAL=8
STATE=9
WS=10
'init'=1
'='=2
'('=3
')'=4
'{'=5
'}'=6
','=7
DFA_grammarLexer.interp
deleted
100644 → 0
View file @
757ac88b
token literal names:
null
'init'
'='
'('
')'
'{'
'}'
','
null
null
null
token symbolic names:
null
INIT
EQUALS
LEFT_PARENTHESIS
RIGHT_PARENTHESIS
LEFT_BRACKET
RIGHT_BRACKET
COMMA
FINAL
STATE
WS
rule names:
INIT
EQUALS
LEFT_PARENTHESIS
RIGHT_PARENTHESIS
LEFT_BRACKET
RIGHT_BRACKET
COMMA
FINAL
STATE
WS
channel names:
DEFAULT_TOKEN_CHANNEL
HIDDEN
mode names:
DEFAULT_MODE
atn:
[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 12, 58, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 6, 3, 6, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 6, 10, 48, 10, 10, 13, 10, 14, 10, 49, 3, 11, 6, 11, 53, 10, 11, 13, 11, 14, 11, 54, 3, 11, 3, 11, 2, 2, 12, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 3, 2, 4, 5, 2, 50, 59, 67, 92, 99, 124, 5, 2, 11, 12, 15, 15, 34, 34, 2, 59, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 3, 23, 3, 2, 2, 2, 5, 28, 3, 2, 2, 2, 7, 30, 3, 2, 2, 2, 9, 32, 3, 2, 2, 2, 11, 34, 3, 2, 2, 2, 13, 36, 3, 2, 2, 2, 15, 38, 3, 2, 2, 2, 17, 40, 3, 2, 2, 2, 19, 47, 3, 2, 2, 2, 21, 52, 3, 2, 2, 2, 23, 24, 7, 107, 2, 2, 24, 25, 7, 112, 2, 2, 25, 26, 7, 107, 2, 2, 26, 27, 7, 118, 2, 2, 27, 4, 3, 2, 2, 2, 28, 29, 7, 63, 2, 2, 29, 6, 3, 2, 2, 2, 30, 31, 7, 42, 2, 2, 31, 8, 3, 2, 2, 2, 32, 33, 7, 43, 2, 2, 33, 10, 3, 2, 2, 2, 34, 35, 7, 125, 2, 2, 35, 12, 3, 2, 2, 2, 36, 37, 7, 127, 2, 2, 37, 14, 3, 2, 2, 2, 38, 39, 7, 46, 2, 2, 39, 16, 3, 2, 2, 2, 40, 41, 7, 104, 2, 2, 41, 42, 7, 107, 2, 2, 42, 43, 7, 112, 2, 2, 43, 44, 7, 99, 2, 2, 44, 45, 7, 110, 2, 2, 45, 18, 3, 2, 2, 2, 46, 48, 9, 2, 2, 2, 47, 46, 3, 2, 2, 2, 48, 49, 3, 2, 2, 2, 49, 47, 3, 2, 2, 2, 49, 50, 3, 2, 2, 2, 50, 20, 3, 2, 2, 2, 51, 53, 9, 3, 2, 2, 52, 51, 3, 2, 2, 2, 53, 54, 3, 2, 2, 2, 54, 52, 3, 2, 2, 2, 54, 55, 3, 2, 2, 2, 55, 56, 3, 2, 2, 2, 56, 57, 8, 11, 2, 2, 57, 22, 3, 2, 2, 2, 5, 2, 49, 54, 3, 8, 2, 2]
\ No newline at end of file
DFA_grammarLexer.tokens
deleted
100644 → 0
View file @
757ac88b
INIT=1
EQUALS=2
LEFT_PARENTHESIS=3
RIGHT_PARENTHESIS=4
LEFT_BRACKET=5
RIGHT_BRACKET=6
COMMA=7
FINAL=8
STATE=9
WS=10
'init'=1
'='=2
'('=3
')'=4
'{'=5
'}'=6
','=7
DFA_grammarListener.py
deleted
100644 → 0
View file @
757ac88b
# Generated from DFA_grammar.g4 by ANTLR 4.8
from
antlr4
import
*
if
__name__
is
not
None
and
"."
in
__name__
:
from
.DFA_grammarParser
import
DFA_grammarParser
else
:
from
DFA_grammarParser
import
DFA_grammarParser
# This class defines a complete listener for a parse tree produced by DFA_grammarParser.
class
DFA_grammarListener
(
ParseTreeListener
):
# Enter a parse tree produced by DFA_grammarParser#start.
def
enterStart
(
self
,
ctx
:
DFA_grammarParser
.
StartContext
):
pass
# Exit a parse tree produced by DFA_grammarParser#start.
def
exitStart
(
self
,
ctx
:
DFA_grammarParser
.
StartContext
):
pass
# Enter a parse tree produced by DFA_grammarParser#init.
def
enterInit
(
self
,
ctx
:
DFA_grammarParser
.
InitContext
):
pass
# Exit a parse tree produced by DFA_grammarParser#init.
def
exitInit
(
self
,
ctx
:
DFA_grammarParser
.
InitContext
):
pass
# Enter a parse tree produced by DFA_grammarParser#production.
def
enterProduction
(
self
,
ctx
:
DFA_grammarParser
.
ProductionContext
):
pass
# Exit a parse tree produced by DFA_grammarParser#production.
def
exitProduction
(
self
,
ctx
:
DFA_grammarParser
.
ProductionContext
):
pass
# Enter a parse tree produced by DFA_grammarParser#final.
def
enterFinal
(
self
,
ctx
:
DFA_grammarParser
.
FinalContext
):
pass
# Exit a parse tree produced by DFA_grammarParser#final.
def
exitFinal
(
self
,
ctx
:
DFA_grammarParser
.
FinalContext
):
pass
# Enter a parse tree produced by DFA_grammarParser#statename.
def
enterStatename
(
self
,
ctx
:
DFA_grammarParser
.
StatenameContext
):
pass
# Exit a parse tree produced by DFA_grammarParser#statename.
def
exitStatename
(
self
,
ctx
:
DFA_grammarParser
.
StatenameContext
):
pass
del
DFA_grammarParser
\ No newline at end of file
NFA
_grammar
.g4
→
NFA.g4
View file @
bbf32586
grammar NFA
_grammar
;
grammar NFA;
/* Parser Rules */
...
...
NFA
_grammar
Lexer.py
→
NFALexer.py
View file @
bbf32586
# Generated from NFA
_grammar
.g4 by ANTLR 4.8
# Generated from NFA.g4 by ANTLR 4.8
from
antlr4
import
*
from
io
import
StringIO
from
typing.io
import
TextIO
...
...
@@ -32,7 +32,7 @@ def serializedATN():
return
buf
.
getvalue
()
class
NFA
_grammar
Lexer
(
Lexer
):
class
NFALexer
(
Lexer
):
atn
=
ATNDeserializer
().
deserialize
(
serializedATN
())
...
...
@@ -64,7 +64,7 @@ class NFA_grammarLexer(Lexer):
"LEFT_BRACKET"
,
"RIGHT_BRACKET"
,
"COMMA"
,
"FINAL"
,
"STATE"
,
"WS"
]
grammarFileName
=
"NFA
_grammar
.g4"
grammarFileName
=
"NFA.g4"
def
__init__
(
self
,
input
=
None
,
output
:
TextIO
=
sys
.
stdout
):
super
().
__init__
(
input
,
output
)
...
...
NFAListener.py
0 → 100644
View file @
bbf32586
# Generated from NFA.g4 by ANTLR 4.8
from
antlr4
import
*
if
__name__
is
not
None
and
"."
in
__name__
:
from
.NFAParser
import
NFAParser
else
:
from
NFAParser
import
NFAParser
# This class defines a complete listener for a parse tree produced by NFAParser.
class
NFAListener
(
ParseTreeListener
):
# Enter a parse tree produced by NFAParser#start.
def
enterStart
(
self
,
ctx
:
NFAParser
.
StartContext
):
pass
# Exit a parse tree produced by NFAParser#start.
def
exitStart
(
self
,
ctx
:
NFAParser
.
StartContext
):
pass
# Enter a parse tree produced by NFAParser#init.
def
enterInit
(
self
,
ctx
:
NFAParser
.
InitContext
):
pass
# Exit a parse tree produced by NFAParser#init.
def
exitInit
(
self
,
ctx
:
NFAParser
.
InitContext
):
pass