/// <summary> /// Assume the specified token /// </summary> /// <param name="eType"> Token type</param> /// <returns> /// Token /// </returns> public Token AssumeToken(TokenTypeE eType) { Token tokRetVal; tokRetVal = GetNextToken(); AssumeToken(eType, tokRetVal); return(tokRetVal); }
/// <summary> /// Assume the specified token /// </summary> /// <param name="eType"> Token type</param> /// <param name="tok"> Assumed token</param> /// <returns> /// Token /// </returns> public void AssumeToken(TokenTypeE eType, Token tok) { if (tok.eType != eType) { throw new PgnParserException("Expecing a token of type - " + eType.ToString(), GetStringAtPos(tok.lStartPos, tok.iSize)); } }