diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 13566b8..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml deleted file mode 100644 index 8dbefe7..0000000 --- a/.idea/checkstyle-idea.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - 10.12.5 - JavaOnly - - - \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 7efc65a..273d387 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -2,7 +2,6 @@ - diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml index 2161097..712ab9d 100644 --- a/.idea/jarRepositories.xml +++ b/.idea/jarRepositories.xml @@ -3,13 +3,8 @@ - - - - - - - + \ No newline at end of file diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml deleted file mode 100644 index 2b63946..0000000 --- a/.idea/uiDesigner.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/java/ab1/impl/GRUPPE/NFAImpl.java b/src/main/java/ab1/impl/GRUPPE/NFAImpl.java index 04997b6..698c513 100644 --- a/src/main/java/ab1/impl/GRUPPE/NFAImpl.java +++ b/src/main/java/ab1/impl/GRUPPE/NFAImpl.java @@ -2,6 +2,7 @@ package ab1.impl.GRUPPE; import ab1.FinalizedStateException; import ab1.NFA; +import ab1.NFAFactory; import ab1.Transition; import lombok.Getter; @@ -240,7 +241,7 @@ public class NFAImpl implements NFA { */ // all states of the DFA - Set> dfaStates = new HashSet<>(); + List> dfaStates = new ArrayList<>(); // all transitions of the DFA Set dfaTransitions = new HashSet<>(); @@ -284,11 +285,16 @@ public class NFAImpl implements NFA { if (!dfaStates.contains(newState)) { queue.add(newState); dfaStates.add(newState); + // build new Transition } + // build new Transition + dfaTransitions.add(new Transition(Integer.toString(dfaStates.indexOf(currentState)), letter, Integer.toString(dfaStates.indexOf(newState)))); + // we gotta change this to only a string is given //dfaTransitions.add(new Transition(currentState, letter, newState)); } } + /* for(Character letter : possibleLetters){ Set newState = new HashSet<>(); @@ -381,4 +387,19 @@ public class NFAImpl implements NFA { } return acceptingStates; } + + public void test(){ + final NFAFactory factory = new NFAFactoryImpl(); + var instance = factory.buildNFA("START"); + instance.addTransition( + Transition.builder() + .fromState("START") + .readSymbol('a') + .toState("ACCEPT") + .build() + ); + instance.addAcceptingState("ACCEPT"); + instance.finalizeAutomaton(); + + } }