void Parse_SyntaxExpressionSingle(Context& ctx) { if (ctx.Token() == TKLiteralChar || ctx.Token() == TKIdentifier || ctx.Token() == TKLeftCurlyBracketCharacter || ctx.Token() == TKStringLiteral) { //SyntaxExpressionSingle => SyntaxExpressionItem SyntaxExpressionSingleFollow Parse_SyntaxExpressionItem(ctx); Parse_SyntaxExpressionSingleFollow(ctx); } else if (ctx.Token() == TKKeywordEmpty) { //SyntaxExpressionSingle => KeywordEmpty ctx.Match(TKKeywordEmpty); ctx.Action_PrintEmptyProduction(); } else { assert(false); } }
void Parse_SyntaxExpressionSingle(Context& ctx) { if (ctx.Token() == TKLiteralChar || ctx.Token() == TKIdentifier || ctx.Token() == TKLeftCurlyBracketCharacter || ctx.Token() == TKStringLiteral) { //SyntaxExpressionSingle => SyntaxExpressionItem SyntaxExpressionSingleFollow Parse_SyntaxExpressionItem(ctx); Parse_SyntaxExpressionSingleFollow(ctx); } else if (ctx.Token() == TKKeywordEmpty) { //SyntaxExpressionSingle => KeywordEmpty ctx.Match(TKKeywordEmpty); ctx.Action_PrintEmptyProduction(); } else { throw ParserException(ctx.GetLine(), ctx.GetCol(), ErrorCodeUnexpectedToken); } }