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
620bcbaa
Verified
Commit
620bcbaa
authored
Apr 06, 2020
by
Vladimír Štill
Browse files
Wrap the library in a package
parent
740d5989
Changes
25
Hide whitespace changes
Inline
Side-by-side
demo.py
View file @
620bcbaa
from
parser
import
Parser
from
common
import
State
,
Character
,
Eps
,
Terminal
,
Nonterminal
from
dfa
import
Composition
as
comp
from
fja.reg.
parser
import
Parser
from
fja.
common
import
State
,
Character
,
Eps
,
Terminal
,
Nonterminal
from
fja.reg.
dfa
import
Composition
as
comp
from
typing
import
Set
,
Dict
,
Tuple
,
Union
from
copy
import
deepcopy
from
antlr4
import
RecognitionException
from
reg
import
RegGrammar
,
DFA
,
NFA
,
RegEx
from
fja.
reg
import
RegGrammar
,
DFA
,
NFA
,
RegEx
def
make_dfa
(
states
:
Set
[
str
],
characters
:
Set
[
str
],
...
...
@@ -304,4 +304,4 @@ def main():
regex_test
(
"(∅ + ∅^*).(∅^* + ∅∅^+)"
)
main
()
\ No newline at end of file
main
()
fja/__init__.py
0 → 100644
View file @
620bcbaa
from
.
import
reg
from
.
import
cfl
__all__
=
[
"reg"
,
"cfl"
]
fja/cfl/__init__.py
0 → 100644
View file @
620bcbaa
from
.grammar
import
CFG
cfl
.py
→
fja/cfl/grammar
.py
View file @
620bcbaa
...
...
@@ -5,8 +5,8 @@ import typing
from
typing_extensions
import
Final
from
copy
import
deepcopy
from
collections
import
deque
from
common
import
Terminal
,
Nonterminal
from
reg
_automat
a
import
IsEquivalentResult
# TODO: to common
from
..
common
import
Terminal
,
Nonterminal
from
..
reg
.df
a
import
IsEquivalentResult
# TODO: to common
import
random
import
math
...
...
common.py
→
fja/
common.py
View file @
620bcbaa
File moved
DFA.g4
→
fja/reg/
DFA.g4
View file @
620bcbaa
File moved
DFALexer.py
→
fja/reg/
DFALexer.py
View file @
620bcbaa
File moved
DFAListener.py
→
fja/reg/
DFAListener.py
View file @
620bcbaa
File moved
DFAParser.py
→
fja/reg/
DFAParser.py
View file @
620bcbaa
File moved
NFA.g4
→
fja/reg/
NFA.g4
View file @
620bcbaa
File moved
NFALexer.py
→
fja/reg/
NFALexer.py
View file @
620bcbaa
File moved
NFAListener.py
→
fja/reg/
NFAListener.py
View file @
620bcbaa
File moved
NFAParser.py
→
fja/reg/
NFAParser.py
View file @
620bcbaa
File moved
RegEx.g4
→
fja/reg/
RegEx.g4
View file @
620bcbaa
File moved
RegExLexer.py
→
fja/reg/
RegExLexer.py
View file @
620bcbaa
File moved
RegExListener.py
→
fja/reg/
RegExListener.py
View file @
620bcbaa
File moved
RegExParser.py
→
fja/reg/
RegExParser.py
View file @
620bcbaa
File moved
RegExVisitor.py
→
fja/reg/
RegExVisitor.py
View file @
620bcbaa
File moved
reg
.py
→
fja/reg/__init__
.py
View file @
620bcbaa
from
common
import
Terminal
,
Nonterminal
,
State
,
Character
,
Eps
,
Emptyset
from
grammars
import
RegGrammar
from
dfa
import
DFA
from
nfa
import
NFA
from
regex
import
RegEx
from
parser
import
Parser
,
ParsingError
from
..
common
import
Terminal
,
Nonterminal
,
State
,
Character
,
Eps
,
Emptyset
from
.
grammars
import
RegGrammar
from
.
dfa
import
DFA
from
.
nfa
import
NFA
from
.
regex
import
RegEx
from
.
parser
import
Parser
,
ParsingError
class
RegGrammar
(
RegGrammar
):
...
...
dfa.py
→
fja/reg/
dfa.py
View file @
620bcbaa
...
...
@@ -5,7 +5,7 @@ import enum
from
copy
import
deepcopy
from
collections
import
deque
from
string
import
ascii_uppercase
from
common
import
Character
,
State
,
Terminal
,
Nonterminal
from
..
common
import
Character
,
State
,
Terminal
,
Nonterminal
class
Composition
(
Enum
):
...
...
@@ -420,4 +420,4 @@ class DFA:
def
is_canonical
(
self
)
->
bool
:
canonic
=
self
.
canonize
()
return
DFA
.
is_part_identical
(
self
,
canonic
)
\ No newline at end of file
return
DFA
.
is_part_identical
(
self
,
canonic
)
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment