public override Result VisitExpr_multipricative([NotNull] STGrammerParser.Expr_multipricativeContext context) { string strLhs = Visit(context.lhs).Info as string; string strRhs = Visit(context.rhs).Info as string; switch (context.op.Type) { case STGrammerParser.ASTERISK: return(new Result(true, strLhs + "*" + strRhs)); case STGrammerParser.SLASH: return(new Result(true, strLhs + "/" + strRhs)); case STGrammerParser.POW: return(new Result(true, strLhs + "^" + strRhs)); case STGrammerParser.MOD: return(new Result(true, strLhs + " MOD " + strRhs)); default: return(DefaultResult); } }
/// <summary> /// Visit a parse tree produced by the <c>expr_multipricative</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_multipricative([NotNull] STGrammerParser.Expr_multipricativeContext context) { return(VisitChildren(context)); }