Beispiel #1
0
 /// <summary>
 /// consume current token (get next token). </summary>
 /// <returns> the consumed token (which was the current token when calling this method) </returns>
 protected internal Scanner.Token ConsumeToken()
 {
     Scanner.Token result = token;
     if (lookahead.Count == 0)
     {
         token    = scanner.Next();
         position = scanner.Position;
     }
     else
     {
         LookaheadToken next = lookahead[0];
         token    = next.token;
         position = next.position;
         lookahead.RemoveAt(0);
     }
     return(result);
 }
Beispiel #2
0
 internal LookaheadToken(Scanner.Token token, int position)
 {
     this.token    = token;
     this.position = position;
 }
Beispiel #3
0
 protected internal virtual ExtensionHandler GetExtensionHandler(Scanner.Token token)
 {
     return(extensions[token]);
 }