just some fancy shit added
This commit is contained in:
parent
b6ab5bdf72
commit
c81659c1f9
3 changed files with 22 additions and 16 deletions
21
.idea/workspace.xml
generated
21
.idea/workspace.xml
generated
|
|
@ -4,10 +4,10 @@
|
|||
<option name="autoReloadType" value="SELECTIVE" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="f5e08808-a5af-4c89-a1ee-21b3bcb9ae3e" name="Changes" comment="isFinite methode recursiv...">
|
||||
<list default="true" id="f5e08808-a5af-4c89-a1ee-21b3bcb9ae3e" name="Changes" comment="guess what works now, fker:)">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/ab1/impl/GRUPPE/NFAFactoryImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/ab1/impl/GRUPPE/NFAFactoryImpl.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/ab1/impl/GRUPPE/NFAImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/ab1/impl/GRUPPE/NFAImpl.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/ab1/impl/GRUPPE/Tuple.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/ab1/impl/GRUPPE/Tuple.java" afterDir="false" />
|
||||
</list>
|
||||
<list id="39d4ccb3-eae9-4ed4-996a-5a13f44678fa" name="Changes by carol" comment="" />
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
|
|
@ -276,7 +276,15 @@
|
|||
<option name="project" value="LOCAL" />
|
||||
<updated>1704888180655</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="10" />
|
||||
<task id="LOCAL-00010" summary="guess what works now, fker:)">
|
||||
<option name="closed" value="true" />
|
||||
<created>1704896842030</created>
|
||||
<option name="number" value="00010" />
|
||||
<option name="presentableId" value="LOCAL-00010" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1704896842030</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="11" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TypeScriptGeneratedFilesManager">
|
||||
|
|
@ -301,19 +309,20 @@
|
|||
<MESSAGE value="concat GEHT" />
|
||||
<MESSAGE value="changed nfaAddTrap, bei dem Fall, dass Transition.readSymbol() einen nullwert zurückgibt. (Thx ChatGBT) -> intersectionTests funktionieren" />
|
||||
<MESSAGE value="isFinite methode recursiv..." />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="isFinite methode recursiv..." />
|
||||
<MESSAGE value="guess what works now, fker:)" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="guess what works now, fker:)" />
|
||||
</component>
|
||||
<component name="XDebuggerManager">
|
||||
<breakpoint-manager>
|
||||
<breakpoints>
|
||||
<line-breakpoint enabled="true" type="java-line">
|
||||
<url>file://$PROJECT_DIR$/src/main/java/ab1/impl/GRUPPE/NFAImpl.java</url>
|
||||
<line>344</line>
|
||||
<line>343</line>
|
||||
<option name="timeStamp" value="44" />
|
||||
</line-breakpoint>
|
||||
<line-breakpoint enabled="true" type="java-line">
|
||||
<url>file://$PROJECT_DIR$/src/main/java/ab1/impl/GRUPPE/NFAImpl.java</url>
|
||||
<line>356</line>
|
||||
<line>355</line>
|
||||
<option name="timeStamp" value="53" />
|
||||
</line-breakpoint>
|
||||
<line-breakpoint enabled="true" type="java-line">
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@ import ab1.NFAFactory;
|
|||
public class NFAFactoryImpl implements NFAFactory {
|
||||
@Override
|
||||
public NFA buildNFA(String startState) {
|
||||
NFA nfa = new NFAImpl(startState);
|
||||
|
||||
return nfa;
|
||||
return new NFAImpl(startState);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ public class NFAImpl implements NFA {
|
|||
|
||||
private Set<Character> alphabet;
|
||||
|
||||
private Set<Character> completeAlphabet;
|
||||
private final Set<Character> completeAlphabet;
|
||||
private boolean isFinalized;
|
||||
|
||||
public NFAImpl(String startState) {
|
||||
|
|
@ -210,8 +210,7 @@ public class NFAImpl implements NFA {
|
|||
NFA newNFA_A = this.complement();
|
||||
NFA newNFA_B = other.complement();
|
||||
NFA unionNFA = newNFA_A.union(newNFA_B);
|
||||
NFA result = unionNFA.complement();
|
||||
return result;
|
||||
return unionNFA.complement();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -447,7 +446,7 @@ public class NFAImpl implements NFA {
|
|||
// need newLetter
|
||||
for(int i=letters.indexOf(readSymbol)+1;i<letters.size();i++){
|
||||
Character newLetter = letters.get(i);
|
||||
String newState = checkForNewLetter(path, transitions, letters, newLetter);
|
||||
String newState = checkForNewLetter(path, transitions, newLetter);
|
||||
//more than 1 transition for new letter?
|
||||
if(newState!=null){
|
||||
//check given state
|
||||
|
|
@ -483,10 +482,10 @@ public class NFAImpl implements NFA {
|
|||
|
||||
/**
|
||||
* !Does not check the new state added
|
||||
* @return state if a tostate for the newletter is found and deletes the old Tuple
|
||||
* @return null if with the newletter there is no transition further
|
||||
* @return -state if a tostate for the newletter is found and deletes the old Tuple
|
||||
* -null if with the newletter there is no transition further
|
||||
*/
|
||||
private String checkForNewLetter(List<Tuple> path, List<Transition> transitions, List<Character> letters, Character letter){
|
||||
private String checkForNewLetter(List<Tuple> path, List<Transition> transitions, Character letter){
|
||||
String fromState = path.get(path.size()-2).getElement_2();
|
||||
for(Transition transition : transitions){
|
||||
if (transition.fromState().equals(fromState) && transition.readSymbol().equals(letter)) {
|
||||
|
|
|
|||
Reference in a new issue