Beispiel #1
0
 public Lexer(string textToParse, NumberLexer numLexer)
 {
     if (string.IsNullOrEmpty(textToParse))
     {
         throw new ArgumentException("I cant parse nothing", "textToParse");
     }
     lastchar = ' ';
     this.numLexer = numLexer;
     number = 0;
     token = Token.NO_TOK;
     this.textToParse = textToParse;
 }
Beispiel #2
0
 ////////////////////////////////////////////////////////////////////////////////////
 //
 // Method
 //      Lexer (constructor)
 //
 // Implements
 //      Initialises a lexer object, clearing number and setting the first character
 //      to a space (will be consumed later).
 //
 public Lexer(string textToParse)
     : this(textToParse, null)
 {
     this.numLexer = new NumberLexer(this);
 }