public override object VisitNegate(NegateContext context) { var r = (new Result()); var expr = (Result)(Visit(context.expression())); r.data = expr.data; r.text = "!" + expr.text; return(r); }
public NegateContext negate() { NegateContext _localctx = new NegateContext(Context, State); EnterRule(_localctx, 6, RULE_negate); try { State = 42; ErrorHandler.Sync(this); switch (TokenStream.LA(1)) { case ADDOP: _localctx = new AddopNegateContext(_localctx); EnterOuterAlt(_localctx, 1); { State = 39; Match(ADDOP); State = 40; negate(); } break; case NUM: case LP: _localctx = new NegateToPowerContext(_localctx); EnterOuterAlt(_localctx, 2); { State = 41; power(); } break; default: throw new NoViableAltException(this); } } catch (RecognitionException re) { _localctx.exception = re; ErrorHandler.ReportError(this, re); ErrorHandler.Recover(this, re); } finally { ExitRule(); } return(_localctx); }
public NegateToPowerContext(NegateContext context) { CopyFrom(context); }
public AddopNegateContext(NegateContext context) { CopyFrom(context); }
public virtual void CopyFrom(NegateContext context) { base.CopyFrom(context); }