예제 #1
0
 /// <summary>
 /// Initializes new instance of Token Parser.
 /// </summary>
 /// <param name="dfa">DFA according to which this parser will parse the string</param>
 public TokenParser(DFA dfa)
 {
     letterSet = dfa.LetterSet;
     this.dfa  = dfa;
 }
예제 #2
0
 /// <summary>
 /// Initializes new instance of the DFA class
 /// </summary>
 /// <param name="letterSet">It is the list of letters which are included in the regular language</param>
 public DFA(LettersSet letterSet)
 {
     this.letterSet = letterSet;
 }
예제 #3
0
 /// <summary>
 /// Initializes new instance of Token Parser. Mainly used when this class is inherited to some other and the new class uses all letters into their regular language
 /// </summary>
 protected TokenParser()
 {
     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
 }