Loading fja_checker.py +4 −2 Original line number Diff line number Diff line from parser import Parser, ParsingError from reg_automata import DFA from reg_automata import DFA, State from antlr4 import RecognitionException # type: ignore import sys import signal Loading @@ -17,7 +17,9 @@ def parse(string: str, automaton_type: str) -> DFA: return automaton except ParsingError as message: print(message) print("Parsing error:", message) except AttributeError as message: print("Parsing error:", message) Loading reg_automata.py +6 −2 Original line number Diff line number Diff line Loading @@ -409,9 +409,13 @@ class DFA: if len(reachable.intersection(self.final)) == 0: return IsEmptyResult() else: word = [] state = reachable.intersection(self.final).pop() if state == self.init: return IsEmptyResult('ε') # TODO some Eps -> str else: while state is not self.init: word.append(predecessor[state][1].name) state = predecessor[state][0] Loading Loading
fja_checker.py +4 −2 Original line number Diff line number Diff line from parser import Parser, ParsingError from reg_automata import DFA from reg_automata import DFA, State from antlr4 import RecognitionException # type: ignore import sys import signal Loading @@ -17,7 +17,9 @@ def parse(string: str, automaton_type: str) -> DFA: return automaton except ParsingError as message: print(message) print("Parsing error:", message) except AttributeError as message: print("Parsing error:", message) Loading
reg_automata.py +6 −2 Original line number Diff line number Diff line Loading @@ -409,9 +409,13 @@ class DFA: if len(reachable.intersection(self.final)) == 0: return IsEmptyResult() else: word = [] state = reachable.intersection(self.final).pop() if state == self.init: return IsEmptyResult('ε') # TODO some Eps -> str else: while state is not self.init: word.append(predecessor[state][1].name) state = predecessor[state][0] Loading