public override Result VisitPlus([NotNull] ExpressionParser.PlusContext context) { if (context.op != null) { if (context.op.Type == ExpressionParser.MINUS) { Result a = Visit(context.factor()); object rlt = OperatorProvider.UnaryExecute("op_UnaryNegation", a.Value);; return(new Result { Value = rlt }); } } return(Visit(context.factor())); }
/// <summary> /// Exit a parse tree produced by the <c>Plus</c> /// labeled alternative in <see cref="ExpressionParser.unary"/>. /// <para>The default implementation does nothing.</para> /// </summary> /// <param name="context">The parse tree.</param> public virtual void ExitPlus([NotNull] ExpressionParser.PlusContext context) { }
/// <summary> /// Visit a parse tree produced by the <c>Plus</c> /// labeled alternative in <see cref="ExpressionParser.unary"/>. /// <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 VisitPlus([NotNull] ExpressionParser.PlusContext context) { return(VisitChildren(context)); }