Exemplo n.º 1
0
 void Parse_SyntaxExpressionMoreSingle(Context& ctx)
 {
     if (ctx.Token() == TKVerticalLineCharacter)
     {
         //SyntaxExpressionMoreSingle => VerticalLineCharacter SyntaxExpressionSingle SyntaxExpressionMoreSingle 
         ctx.Match(TKVerticalLineCharacter);
         ctx.Action_CloseProduction();
         Parse_SyntaxExpressionSingle(ctx);
         ctx.Action_CloseProduction();
         Parse_SyntaxExpressionMoreSingle(ctx);
     }
     else if (ctx.Token() == TKSemicolonCharacter)
     {
         //SyntaxExpressionMoreSingle => Epsilon 
     }
     else
     {
         assert(false);
     }
 }
Exemplo n.º 2
0
void Parse_SyntaxExpressionMoreSingle(Context& ctx)
{
    if (ctx.Token() == TKVerticalLineCharacter)
    {
        //SyntaxExpressionMoreSingle => VerticalLineCharacter SyntaxExpressionSingle SyntaxExpressionMoreSingle
        ctx.Match(TKVerticalLineCharacter);
        ctx.Action_CloseProduction();
        Parse_SyntaxExpressionSingle(ctx);
        ctx.Action_CloseProduction();
        Parse_SyntaxExpressionMoreSingle(ctx);
    }
    else if (ctx.Token() == TKSemicolonCharacter)
    {
        //SyntaxExpressionMoreSingle => Epsilon
    }
    else
    {
        throw ParserException(ctx.GetLine(), ctx.GetCol(), ErrorCodeUnexpectedToken);
    }
}