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; }
//////////////////////////////////////////////////////////////////////////////////// // // 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); }