Exemple #1
0
 void Parse_SyntaxExpressionAction(Context& ctx)
 {
     if (ctx.Token() == TKLeftCurlyBracketCharacter)
     {
         //SyntaxExpressionAction => LeftCurlyBracketCharacter Identifier RightCurlyBracketCharacter 
         ctx.Match(TKLeftCurlyBracketCharacter);
         ctx.Match(TKIdentifier);
         ctx.Action_PrintAction();
         ctx.Match(TKRightCurlyBracketCharacter);
     }
     else
     {
         assert(false);
     }
 }
Exemple #2
0
void Parse_SyntaxExpressionAction(Context& ctx)
{
    if (ctx.Token() == TKLeftCurlyBracketCharacter)
    {
        //SyntaxExpressionAction => LeftCurlyBracketCharacter Identifier RightCurlyBracketCharacter
        ctx.Match(TKLeftCurlyBracketCharacter);
        ctx.Match(TKIdentifier);
        ctx.Action_PrintAction();
        ctx.Match(TKRightCurlyBracketCharacter);
    }
    else
    {
        throw ParserException(ctx.GetLine(), ctx.GetCol(), ErrorCodeUnexpectedToken);
    }
}