public UnexpectedTokenException( string msg, Token t, params TokenKind[] expectedTokenKinds) : base(msg) { Token = t; ExpectedTokenKinds = expectedTokenKinds; }
/// <summary> /// Constructor that initializes the scanner with the given Text. /// The first token can be accessed through the CurrentToken property, /// the following token through the LookAheadToken property. /// Throws ScannerException. /// </summary> /// <param name="text"> /// A <see cref="System.String"/> /// </param> public Scanner(string text) { if (text == null) throw new ArgumentNullException("text"); wordBuf = new StringBuilder(); currentToken = new Token(); lookAheadToken = new Token(); Reset(text); }
public void ReadNextToken() { Token tmpToken = currentToken; currentToken = lookAheadToken; lookAheadToken = tmpToken; lookAheadToken.Reset(); Scan(); SkipWhiteSpace(); }