Example #1
0
 /// <summary>
 /// Get NextToken and verify type of token (EmbeddedTokenStream)
 /// </summary>
 /// <param name="name">Name of expected token</param>
 /// <param name="syntax">Syntax of expected token</param>
 /// <param name="type">Type of expected token</param>
 /// <returns>True if token found and type matches, otherwise false</returns>
 private new bool NextToken(String name, String syntax, TokenType type)
 {
     if (NextToken(name, syntax))
     {
         if (type.Equals(CurrentToken.GetType()))
         {
             return(true);
         }
         else
         {
             throw new UnexpectedToken("Unexpected token found:", CurrentToken.GetValue().ToString(), CurrentToken.GetLine());
         }
     }
     return(false);
 }