public override ExpressionNode VisitFactor([NotNull] mdxParser.FactorContext context) { if (context.children.Count > 1) { var List = context.children; DimensionNodes DimensionList = new DimensionNodes(); DimensionList.List = new List <ExpressionNode>(); for (int i = 1; i < List.Count; i = i + 2) { Operator mul = new Operator(); var k = List[i - 1].Payload; mul.Left = new NumberNode { Value = (string)k.GetType().GetProperty("Text").GetValue(k, null) }; mul.Right = Visit(List[i + 1]); k = List[i].Payload; mul.Operation = (string)k.GetType().GetProperty("Text").GetValue(k, null); DimensionList.List.Add(mul); } return(DimensionList); } else { var k = base.VisitFactor(context); return(k); } }
/// <summary> /// Exit a parse tree produced by <see cref="mdxParser.factor"/>. /// <para>The default implementation does nothing.</para> /// </summary> /// <param name="context">The parse tree.</param> public virtual void ExitFactor([NotNull] mdxParser.FactorContext context) { }
/// <summary> /// Visit a parse tree produced by <see cref="mdxParser.factor"/>. /// <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 VisitFactor([NotNull] mdxParser.FactorContext context) { return(VisitChildren(context)); }