value()

in backend/src/tools/AgtypeParser.js [164:238]


    value() {
        let localctx = new ValueContext(this, this._ctx, this.state);
        this.enterRule(localctx, 4, AgtypeParser.RULE_value);
        try {
            this.state = 31;
            this._errHandler.sync(this);
            switch (this._input.LA(1)) {
                case AgtypeParser.STRING:
                    localctx = new StringValueContext(this, localctx);
                    this.enterOuterAlt(localctx, 1);
                    this.state = 23;
                    this.match(AgtypeParser.STRING);
                    break;
                case AgtypeParser.INTEGER:
                    localctx = new IntegerValueContext(this, localctx);
                    this.enterOuterAlt(localctx, 2);
                    this.state = 24;
                    this.match(AgtypeParser.INTEGER);
                    break;
                case AgtypeParser.T__10:
                case AgtypeParser.T__11:
                case AgtypeParser.T__12:
                case AgtypeParser.RegularFloat:
                case AgtypeParser.ExponentFloat:
                    localctx = new FloatValueContext(this, localctx);
                    this.enterOuterAlt(localctx, 3);
                    this.state = 25;
                    this.floatLiteral();
                    break;
                case AgtypeParser.T__0:
                    localctx = new TrueBooleanContext(this, localctx);
                    this.enterOuterAlt(localctx, 4);
                    this.state = 26;
                    this.match(AgtypeParser.T__0);
                    break;
                case AgtypeParser.T__1:
                    localctx = new FalseBooleanContext(this, localctx);
                    this.enterOuterAlt(localctx, 5);
                    this.state = 27;
                    this.match(AgtypeParser.T__1);
                    break;
                case AgtypeParser.T__2:
                    localctx = new NullValueContext(this, localctx);
                    this.enterOuterAlt(localctx, 6);
                    this.state = 28;
                    this.match(AgtypeParser.T__2);
                    break;
                case AgtypeParser.T__3:
                    localctx = new ObjectValueContext(this, localctx);
                    this.enterOuterAlt(localctx, 7);
                    this.state = 29;
                    this.obj();
                    break;
                case AgtypeParser.T__7:
                    localctx = new ArrayValueContext(this, localctx);
                    this.enterOuterAlt(localctx, 8);
                    this.state = 30;
                    this.array();
                    break;
                default:
                    throw new antlr4.error.NoViableAltException(this);
            }
        } catch (re) {
            if (re instanceof antlr4.error.RecognitionException) {
                localctx.exception = re;
                this._errHandler.reportError(this, re);
                this._errHandler.recover(this, re);
            } else {
                throw re;
            }
        } finally {
            this.exitRule();
        }
        return localctx;
    }