Esempio n. 1
0
        public override Result VisitExpr_logical_operation([NotNull] STGrammerParser.Expr_logical_operationContext context)
        {
            string strLhs = Visit(context.lhs).Info as string;
            string strRhs = Visit(context.rhs).Info as string;

            switch (context.op.Type)
            {
            case STGrammerParser.AND: return(new Result(true, strLhs + " AND " + strRhs));

            case STGrammerParser.AND2: return(new Result(true, strLhs + " AND " + strRhs));

            case STGrammerParser.OR: return(new Result(true, strLhs + " OR " + strRhs));

            case STGrammerParser.XOR: return(new Result(true, strLhs + " XOR " + strRhs));

            default: return(DefaultResult);
            }
        }
Esempio n. 2
0
 /// <summary>
 /// Visit a parse tree produced by the <c>expr_logical_operation</c>
 /// labeled alternative in <see cref="STGrammerParser.expr"/>.
 /// <para>
 /// The default implementation returns the result of calling <see cref="AbstractParseTreeVisitor{Result}.VisitChildren(IRuleNode)"/>
 /// on <paramref name="context"/>.
 /// </para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 /// <return>The visitor result.</return>
 public virtual Result VisitExpr_logical_operation([NotNull] STGrammerParser.Expr_logical_operationContext context)
 {
     return(VisitChildren(context));
 }