Exemplo n.º 1
0
 /// <summary>
 /// Initialzes new instance for a state
 /// </summary>
 /// <param name="letterSet">Set of letters belongs to the DFA</param>
 /// <param name="isFinal">Set as true for the final state</param>
 /// <param name="isStart">Set as true for the initial/start state</param>
 public State(LettersSet letterSet, bool isFinal = false, bool isStart = false)
 {
     this.isStart     = isStart;
     this.isFinal     = isFinal;
     this.letterSet   = letterSet;
     transitionStates = new State[letterSet.Letters.Length];
 }
Exemplo n.º 2
0
 protected Parser()
 {
     letterSet = new LettersSet();
     letterSet.AddLetters(0, 127); //add all ascii characters to the letter set
     dfa = new DFA(letterSet);     //add the letter set to the DFA
 }