287mdsahil / lexical_analyzer

JU BCSEIII Compiler Design Project
GNU General Public License v3.0
3 stars 0 forks source link

NFA and DFA for Thompson and Subset constructions #6

Closed pmcarpan closed 4 years ago

pmcarpan commented 4 years ago

To Implement:

I'd suggest to put them in a separate package named automata or something, as they are not related with the algorithms.

287mdsahil commented 4 years ago

@pmcarpan why is the number of states an argument to the NFA constructor? Generally thinking won't it be better if someone could initialize an NFA without knowing the number of states predefined by simply calling: NFA nfa = new NFA(); nfa.addTransition( ... ); nfa.setStartState(...); nfa.setFinalStates(...);

pmcarpan commented 4 years ago

@pmcarpan why is the number of states an argument to the NFA constructor? Generally thinking won't it be better if someone could initialize an NFA without knowing the number of states predefined by simply calling: ...

increaseNumberOfStates will be used in both cases, either internally or externally. I though it was better to give explicit control.