public override Node VisitMultiplyingExpression([NotNull] FormulaGrammerParser.MultiplyingExpressionContext context) { int idxPowExpession = 0; int idxOp = 1; var powExpresion = context.powExpression(idxPowExpession++); var node = this.VisitPowExpression(powExpresion); while ((powExpresion = context.powExpression(idxPowExpession++)) != null) { var op = BinaryOperator.BySymbol(context.GetChild(idxOp).GetText()); var right = this.VisitPowExpression(powExpresion); node = new BinaryOperatorNode(op, node, right); idxOp += 2; } return(node); }
/// <summary> /// Visit a parse tree produced by <see cref="FormulaGrammerParser.multiplyingExpression"/>. /// <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 VisitMultiplyingExpression([NotNull] FormulaGrammerParser.MultiplyingExpressionContext context) { return(VisitChildren(context)); }
/// <summary> /// Exit a parse tree produced by <see cref="FormulaGrammerParser.multiplyingExpression"/>. /// <para>The default implementation does nothing.</para> /// </summary> /// <param name="context">The parse tree.</param> public virtual void ExitMultiplyingExpression([NotNull] FormulaGrammerParser.MultiplyingExpressionContext context) { }