Esempio n. 1
0
        public override Result VisitFunc_operation([NotNull] STGrammerParser.Func_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));

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

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

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

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

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

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

            default: return(DefaultResult);
            }
        }
Esempio n. 2
0
 /// <summary>
 /// Visit a parse tree produced by the <c>func_operation</c>
 /// labeled alternative in <see cref="STGrammerParser.func_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 VisitFunc_operation([NotNull] STGrammerParser.Func_operationContext context)
 {
     return(VisitChildren(context));
 }