public FactorContext factor() { FactorContext _localctx = new FactorContext(Context, State); EnterRule(_localctx, 6, RULE_factor); try { State = 46; ErrorHandler.Sync(this); switch (Interpreter.AdaptivePredict(TokenStream, 5, Context)) { case 1: EnterOuterAlt(_localctx, 1); { State = 44; Match(FACTOR); } break; case 2: EnterOuterAlt(_localctx, 2); { } break; } } catch (RecognitionException re) { _localctx.exception = re; ErrorHandler.ReportError(this, re); ErrorHandler.Recover(this, re); } finally { ExitRule(); } return(_localctx); }
public override object VisitFactor([NotNull] FactorContext context) { if (context.expression() != null) { _output.Append('('); VisitExpression(context.expression()); _output.Append(')'); } else if (context.NUMBER() != null) { if (context.MINUS() != null) { _output.Append('-'); } _output.Append(context.NUMBER().GetText()); } else if (context.DECIMAL() != null) { if (context.MINUS() != null) { _output.Append('-'); } _output.Append(context.DECIMAL().GetText()); } else if (context.@string() != null) { VisitString(context.@string()); } else if (context.variable_complex_reference() != null) { VisitVariable_complex_reference(context.variable_complex_reference()); } else if (context.function_call() != null) { VisitFunction_call(context.function_call()); } else if (context.@bool() != null) { VisitBool(context.@bool()); } else if (context.unary_increment() != null) { VisitUnary_increment(context.unary_increment()); } else if (context.unary_decrement() != null) { VisitUnary_decrement(context.unary_decrement()); } return(null); }
public FactorContext factor() { FactorContext _localctx = new FactorContext(Context, State); EnterRule(_localctx, 16, RULE_factor); try { State = 92; ErrorHandler.Sync(this); switch (TokenStream.LA(1)) { case LPAREN: EnterOuterAlt(_localctx, 1); { State = 86; Match(LPAREN); State = 87; simple(); State = 88; Match(RPAREN); } break; case INTEGER: EnterOuterAlt(_localctx, 2); { State = 90; floatNum(); } break; case IDENTIFIER: EnterOuterAlt(_localctx, 3); { State = 91; selector(0); } 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 FactorContext factor() { FactorContext _localctx = new FactorContext(_ctx, State); EnterRule(_localctx, 8, RULE_factor); try { State = 36; _errHandler.Sync(this); switch (_input.La(1)) { case T__0: _localctx = new PARContext(_localctx); EnterOuterAlt(_localctx, 1); { State = 30; Match(T__0); State = 31; expr(); State = 32; Match(T__1); } break; case INT: _localctx = new NUMBERContext(_localctx); EnterOuterAlt(_localctx, 2); { State = 34; Match(INT); } break; case ID: _localctx = new VARContext(_localctx); EnterOuterAlt(_localctx, 3); { State = 35; Match(ID); } break; default: throw new NoViableAltException(this); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.ReportError(this, re); _errHandler.Recover(this, re); } finally { ExitRule(); } return(_localctx); }
public FactorContext factor() { FactorContext _localctx = new FactorContext(Context, State); EnterRule(_localctx, 10, RULE_factor); try { State = 53; ErrorHandler.Sync(this); switch (TokenStream.LA(1)) { case NUM: _localctx = new FactorToNumContext(_localctx); EnterOuterAlt(_localctx, 1); { State = 51; Match(NUM); } break; case LP: _localctx = new FactorToParensContext(_localctx); EnterOuterAlt(_localctx, 2); { State = 52; parens(); } 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 FactorContext factor() { FactorContext _localctx = new FactorContext(_ctx, State); EnterRule(_localctx, 10, RULE_factor); try { State = 62; _errHandler.Sync(this); switch (_input.La(1)) { case MINUS: EnterOuterAlt(_localctx, 1); { State = 59; Match(MINUS); State = 60; factor(); } break; case NUMBER: case VARIABLE: case LPAREN: case LBRACK: EnterOuterAlt(_localctx, 2); { State = 61; atom(); } break; default: throw new NoViableAltException(this); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.ReportError(this, re); _errHandler.Recover(this, re); } finally { ExitRule(); } return(_localctx); }
public FactorContext factor() { FactorContext _localctx = new FactorContext(Context, State); EnterRule(_localctx, 14, RULE_factor); try { EnterOuterAlt(_localctx, 1); { State = 60; Match(NUM); } } catch (RecognitionException re) { _localctx.exception = re; ErrorHandler.ReportError(this, re); ErrorHandler.Recover(this, re); } finally { ExitRule(); } return(_localctx); }
public FactorContext factor() { FactorContext _localctx = new FactorContext(_ctx, State); EnterRule(_localctx, 4, RULE_factor); try { State = 29; _errHandler.Sync(this); switch (Interpreter.AdaptivePredict(_input, 2, _ctx)) { case 1: EnterOuterAlt(_localctx, 1); { State = 24; exponente(); { State = 25; Match(T__4); State = 26; factor(); } } break; case 2: EnterOuterAlt(_localctx, 2); { State = 28; exponente(); } break; } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.ReportError(this, re); _errHandler.Recover(this, re); } finally { ExitRule(); } return(_localctx); }
public FactorContext factor() { FactorContext _localctx = new FactorContext(Context, State); EnterRule(_localctx, 124, RULE_factor); try { State = 815; switch (TokenStream.La(1)) { case ADD: EnterOuterAlt(_localctx, 1); { State = 808; Match(ADD); State = 809; factor(); } break; case MINUS: EnterOuterAlt(_localctx, 2); { State = 810; Match(MINUS); State = 811; factor(); } break; case NOT_OP: EnterOuterAlt(_localctx, 3); { State = 812; Match(NOT_OP); State = 813; factor(); } break; case NONE: case TRUE: case FALSE: case NAME: case STRING_LITERAL: case BYTES_LITERAL: case DECIMAL_INTEGER: case OCT_INTEGER: case HEX_INTEGER: case BIN_INTEGER: case FLOAT_NUMBER: case IMAG_NUMBER: case ELLIPSIS: case OPEN_PAREN: case OPEN_BRACK: case OPEN_BRACE: EnterOuterAlt(_localctx, 4); { State = 814; 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 FactorToNumContext(FactorContext context) { CopyFrom(context); }
public FactorToParensContext(FactorContext context) { CopyFrom(context); }
public virtual void CopyFrom(FactorContext context) { base.CopyFrom(context); }
public VARContext(FactorContext context) { CopyFrom(context); }
public NUMBERContext(FactorContext context) { CopyFrom(context); }