// Generated from
// /home/tyron/AndroidStudioProjects/CodeAssist/app/src/main/java/com/tyron/code/ui/editor/language/json/JSON.g4 by ANTLR 4.9.2
package com.tyron.code.language.json;

import java.util.List;
import org.antlr.v4.runtime.*;
import org.antlr.v4.runtime.atn.*;
import org.antlr.v4.runtime.dfa.DFA;
import org.antlr.v4.runtime.tree.*;

@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"})
public class JSONParser extends Parser {
  static {
    RuntimeMetaData.checkVersion("4.9.2", RuntimeMetaData.VERSION);
  }

  protected static final DFA[] _decisionToDFA;
  protected static final PredictionContextCache _sharedContextCache = new PredictionContextCache();
  public static final int TRUE = 1,
      FALSE = 2,
      NULL = 3,
      COLON = 4,
      STRING = 5,
      LBRACE = 6,
      RBRACE = 7,
      LBRACKET = 8,
      RBRACKET = 9,
      COMMA = 10,
      NUMBER = 11,
      WS = 12;
  public static final int RULE_json = 0, RULE_obj = 1, RULE_pair = 2, RULE_arr = 3, RULE_value = 4;

  private static String[] makeRuleNames() {
    return new String[] {"json", "obj", "pair", "arr", "value"};
  }

  public static final String[] ruleNames = makeRuleNames();

  private static String[] makeLiteralNames() {
    return new String[] {
      null, "'true'", "'false'", "'null'", "':'", null, "'{'", "'}'", "'['", "']'", "','"
    };
  }

  private static final String[] _LITERAL_NAMES = makeLiteralNames();

  private static String[] makeSymbolicNames() {
    return new String[] {
      null,
      "TRUE",
      "FALSE",
      "NULL",
      "COLON",
      "STRING",
      "LBRACE",
      "RBRACE",
      "LBRACKET",
      "RBRACKET",
      "COMMA",
      "NUMBER",
      "WS"
    };
  }

  private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames();
  public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES);

  /**
   * @deprecated Use {@link #VOCABULARY} instead.
   */
  @Deprecated public static final String[] tokenNames;

  static {
    tokenNames = new String[_SYMBOLIC_NAMES.length];
    for (int i = 0; i < tokenNames.length; i++) {
      tokenNames[i] = VOCABULARY.getLiteralName(i);
      if (tokenNames[i] == null) {
        tokenNames[i] = VOCABULARY.getSymbolicName(i);
      }

      if (tokenNames[i] == null) {
        tokenNames[i] = "<INVALID>";
      }
    }
  }

  @Override
  @Deprecated
  public String[] getTokenNames() {
    return tokenNames;
  }

  @Override
  public Vocabulary getVocabulary() {
    return VOCABULARY;
  }

  @Override
  public String getGrammarFileName() {
    return "JSON.g4";
  }

  @Override
  public String[] getRuleNames() {
    return ruleNames;
  }

  @Override
  public String getSerializedATN() {
    return _serializedATN;
  }

  @Override
  public ATN getATN() {
    return _ATN;
  }

  public JSONParser(TokenStream input) {
    super(input);
    _interp = new ParserATNSimulator(this, _ATN, _decisionToDFA, _sharedContextCache);
  }

  public static class JsonContext extends ParserRuleContext {
    public ValueContext value() {
      return getRuleContext(ValueContext.class, 0);
    }

    public JsonContext(ParserRuleContext parent, int invokingState) {
      super(parent, invokingState);
    }

    @Override
    public int getRuleIndex() {
      return RULE_json;
    }

    @Override
    public void enterRule(ParseTreeListener listener) {
      if (listener instanceof JSONListener) ((JSONListener) listener).enterJson(this);
    }

    @Override
    public void exitRule(ParseTreeListener listener) {
      if (listener instanceof JSONListener) ((JSONListener) listener).exitJson(this);
    }

    @Override
    public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
      if (visitor instanceof JSONVisitor)
        return ((JSONVisitor<? extends T>) visitor).visitJson(this);
      else return visitor.visitChildren(this);
    }
  }

  public final JsonContext json() throws RecognitionException {
    JsonContext _localctx = new JsonContext(_ctx, getState());
    enterRule(_localctx, 0, RULE_json);
    try {
      enterOuterAlt(_localctx, 1);
      {
        setState(10);
        value();
      }
    } catch (RecognitionException re) {
      _localctx.exception = re;
      _errHandler.reportError(this, re);
      _errHandler.recover(this, re);
    } finally {
      exitRule();
    }
    return _localctx;
  }

  public static class ObjContext extends ParserRuleContext {
    public TerminalNode LBRACE() {
      return getToken(JSONParser.LBRACE, 0);
    }

    public List<PairContext> pair() {
      return getRuleContexts(PairContext.class);
    }

    public PairContext pair(int i) {
      return getRuleContext(PairContext.class, i);
    }

    public TerminalNode RBRACE() {
      return getToken(JSONParser.RBRACE, 0);
    }

    public List<TerminalNode> COMMA() {
      return getTokens(JSONParser.COMMA);
    }

    public TerminalNode COMMA(int i) {
      return getToken(JSONParser.COMMA, i);
    }

    public ObjContext(ParserRuleContext parent, int invokingState) {
      super(parent, invokingState);
    }

    @Override
    public int getRuleIndex() {
      return RULE_obj;
    }

    @Override
    public void enterRule(ParseTreeListener listener) {
      if (listener instanceof JSONListener) ((JSONListener) listener).enterObj(this);
    }

    @Override
    public void exitRule(ParseTreeListener listener) {
      if (listener instanceof JSONListener) ((JSONListener) listener).exitObj(this);
    }

    @Override
    public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
      if (visitor instanceof JSONVisitor)
        return ((JSONVisitor<? extends T>) visitor).visitObj(this);
      else return visitor.visitChildren(this);
    }
  }

  public final ObjContext obj() throws RecognitionException {
    ObjContext _localctx = new ObjContext(_ctx, getState());
    enterRule(_localctx, 2, RULE_obj);
    int _la;
    try {
      setState(25);
      _errHandler.sync(this);
      switch (getInterpreter().adaptivePredict(_input, 1, _ctx)) {
        case 1:
          enterOuterAlt(_localctx, 1);
          {
            setState(12);
            match(LBRACE);
            setState(13);
            pair();
            setState(18);
            _errHandler.sync(this);
            _la = _input.LA(1);
            while (_la == COMMA) {
              {
                {
                  setState(14);
                  match(COMMA);
                  setState(15);
                  pair();
                }
              }
              setState(20);
              _errHandler.sync(this);
              _la = _input.LA(1);
            }
            setState(21);
            match(RBRACE);
          }
          break;
        case 2:
          enterOuterAlt(_localctx, 2);
          {
            setState(23);
            match(LBRACE);
            setState(24);
            match(RBRACE);
          }
          break;
      }
    } catch (RecognitionException re) {
      _localctx.exception = re;
      _errHandler.reportError(this, re);
      _errHandler.recover(this, re);
    } finally {
      exitRule();
    }
    return _localctx;
  }

  public static class PairContext extends ParserRuleContext {
    public TerminalNode STRING() {
      return getToken(JSONParser.STRING, 0);
    }

    public TerminalNode COLON() {
      return getToken(JSONParser.COLON, 0);
    }

    public ValueContext value() {
      return getRuleContext(ValueContext.class, 0);
    }

    public PairContext(ParserRuleContext parent, int invokingState) {
      super(parent, invokingState);
    }

    @Override
    public int getRuleIndex() {
      return RULE_pair;
    }

    @Override
    public void enterRule(ParseTreeListener listener) {
      if (listener instanceof JSONListener) ((JSONListener) listener).enterPair(this);
    }

    @Override
    public void exitRule(ParseTreeListener listener) {
      if (listener instanceof JSONListener) ((JSONListener) listener).exitPair(this);
    }

    @Override
    public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
      if (visitor instanceof JSONVisitor)
        return ((JSONVisitor<? extends T>) visitor).visitPair(this);
      else return visitor.visitChildren(this);
    }
  }

  public final PairContext pair() throws RecognitionException {
    PairContext _localctx = new PairContext(_ctx, getState());
    enterRule(_localctx, 4, RULE_pair);
    try {
      enterOuterAlt(_localctx, 1);
      {
        setState(27);
        match(STRING);
        setState(28);
        match(COLON);
        setState(29);
        value();
      }
    } catch (RecognitionException re) {
      _localctx.exception = re;
      _errHandler.reportError(this, re);
      _errHandler.recover(this, re);
    } finally {
      exitRule();
    }
    return _localctx;
  }

  public static class ArrContext extends ParserRuleContext {
    public TerminalNode LBRACKET() {
      return getToken(JSONParser.LBRACKET, 0);
    }

    public List<ValueContext> value() {
      return getRuleContexts(ValueContext.class);
    }

    public ValueContext value(int i) {
      return getRuleContext(ValueContext.class, i);
    }

    public TerminalNode RBRACKET() {
      return getToken(JSONParser.RBRACKET, 0);
    }

    public List<TerminalNode> COMMA() {
      return getTokens(JSONParser.COMMA);
    }

    public TerminalNode COMMA(int i) {
      return getToken(JSONParser.COMMA, i);
    }

    public ArrContext(ParserRuleContext parent, int invokingState) {
      super(parent, invokingState);
    }

    @Override
    public int getRuleIndex() {
      return RULE_arr;
    }

    @Override
    public void enterRule(ParseTreeListener listener) {
      if (listener instanceof JSONListener) ((JSONListener) listener).enterArr(this);
    }

    @Override
    public void exitRule(ParseTreeListener listener) {
      if (listener instanceof JSONListener) ((JSONListener) listener).exitArr(this);
    }

    @Override
    public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
      if (visitor instanceof JSONVisitor)
        return ((JSONVisitor<? extends T>) visitor).visitArr(this);
      else return visitor.visitChildren(this);
    }
  }

  public final ArrContext arr() throws RecognitionException {
    ArrContext _localctx = new ArrContext(_ctx, getState());
    enterRule(_localctx, 6, RULE_arr);
    int _la;
    try {
      setState(44);
      _errHandler.sync(this);
      switch (getInterpreter().adaptivePredict(_input, 3, _ctx)) {
        case 1:
          enterOuterAlt(_localctx, 1);
          {
            setState(31);
            match(LBRACKET);
            setState(32);
            value();
            setState(37);
            _errHandler.sync(this);
            _la = _input.LA(1);
            while (_la == COMMA) {
              {
                {
                  setState(33);
                  match(COMMA);
                  setState(34);
                  value();
                }
              }
              setState(39);
              _errHandler.sync(this);
              _la = _input.LA(1);
            }
            setState(40);
            match(RBRACKET);
          }
          break;
        case 2:
          enterOuterAlt(_localctx, 2);
          {
            setState(42);
            match(LBRACKET);
            setState(43);
            match(RBRACKET);
          }
          break;
      }
    } catch (RecognitionException re) {
      _localctx.exception = re;
      _errHandler.reportError(this, re);
      _errHandler.recover(this, re);
    } finally {
      exitRule();
    }
    return _localctx;
  }

  public static class ValueContext extends ParserRuleContext {
    public TerminalNode STRING() {
      return getToken(JSONParser.STRING, 0);
    }

    public TerminalNode NUMBER() {
      return getToken(JSONParser.NUMBER, 0);
    }

    public ObjContext obj() {
      return getRuleContext(ObjContext.class, 0);
    }

    public ArrContext arr() {
      return getRuleContext(ArrContext.class, 0);
    }

    public TerminalNode TRUE() {
      return getToken(JSONParser.TRUE, 0);
    }

    public TerminalNode FALSE() {
      return getToken(JSONParser.FALSE, 0);
    }

    public TerminalNode NULL() {
      return getToken(JSONParser.NULL, 0);
    }

    public ValueContext(ParserRuleContext parent, int invokingState) {
      super(parent, invokingState);
    }

    @Override
    public int getRuleIndex() {
      return RULE_value;
    }

    @Override
    public void enterRule(ParseTreeListener listener) {
      if (listener instanceof JSONListener) ((JSONListener) listener).enterValue(this);
    }

    @Override
    public void exitRule(ParseTreeListener listener) {
      if (listener instanceof JSONListener) ((JSONListener) listener).exitValue(this);
    }

    @Override
    public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
      if (visitor instanceof JSONVisitor)
        return ((JSONVisitor<? extends T>) visitor).visitValue(this);
      else return visitor.visitChildren(this);
    }
  }

  public final ValueContext value() throws RecognitionException {
    ValueContext _localctx = new ValueContext(_ctx, getState());
    enterRule(_localctx, 8, RULE_value);
    try {
      setState(53);
      _errHandler.sync(this);
      switch (_input.LA(1)) {
        case STRING:
          enterOuterAlt(_localctx, 1);
          {
            setState(46);
            match(STRING);
          }
          break;
        case NUMBER:
          enterOuterAlt(_localctx, 2);
          {
            setState(47);
            match(NUMBER);
          }
          break;
        case LBRACE:
          enterOuterAlt(_localctx, 3);
          {
            setState(48);
            obj();
          }
          break;
        case LBRACKET:
          enterOuterAlt(_localctx, 4);
          {
            setState(49);
            arr();
          }
          break;
        case TRUE:
          enterOuterAlt(_localctx, 5);
          {
            setState(50);
            match(TRUE);
          }
          break;
        case FALSE:
          enterOuterAlt(_localctx, 6);
          {
            setState(51);
            match(FALSE);
          }
          break;
        case NULL:
          enterOuterAlt(_localctx, 7);
          {
            setState(52);
            match(NULL);
          }
          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 static final String _serializedATN =
      "\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3\16:\4\2\t\2\4\3\t"
          + "\3\4\4\t\4\4\5\t\5\4\6\t\6\3\2\3\2\3\3\3\3\3\3\3\3\7\3\23\n\3\f\3\16\3"
          + "\26\13\3\3\3\3\3\3\3\3\3\5\3\34\n\3\3\4\3\4\3\4\3\4\3\5\3\5\3\5\3\5\7"
          + "\5&\n\5\f\5\16\5)\13\5\3\5\3\5\3\5\3\5\5\5/\n\5\3\6\3\6\3\6\3\6\3\6\3"
          + "\6\3\6\5\68\n\6\3\6\2\2\7\2\4\6\b\n\2\2\2>\2\f\3\2\2\2\4\33\3\2\2\2\6"
          + "\35\3\2\2\2\b.\3\2\2\2\n\67\3\2\2\2\f\r\5\n\6\2\r\3\3\2\2\2\16\17\7\b"
          + "\2\2\17\24\5\6\4\2\20\21\7\f\2\2\21\23\5\6\4\2\22\20\3\2\2\2\23\26\3\2"
          + "\2\2\24\22\3\2\2\2\24\25\3\2\2\2\25\27\3\2\2\2\26\24\3\2\2\2\27\30\7\t"
          + "\2\2\30\34\3\2\2\2\31\32\7\b\2\2\32\34\7\t\2\2\33\16\3\2\2\2\33\31\3\2"
          + "\2\2\34\5\3\2\2\2\35\36\7\7\2\2\36\37\7\6\2\2\37 \5\n\6\2 \7\3\2\2\2!"
          + "\"\7\n\2\2\"\'\5\n\6\2#$\7\f\2\2$&\5\n\6\2%#\3\2\2\2&)\3\2\2\2\'%\3\2"
          + "\2\2\'(\3\2\2\2(*\3\2\2\2)\'\3\2\2\2*+\7\13\2\2+/\3\2\2\2,-\7\n\2\2-/"
          + "\7\13\2\2.!\3\2\2\2.,\3\2\2\2/\t\3\2\2\2\608\7\7\2\2\618\7\r\2\2\628\5"
          + "\4\3\2\638\5\b\5\2\648\7\3\2\2\658\7\4\2\2\668\7\5\2\2\67\60\3\2\2\2\67"
          + "\61\3\2\2\2\67\62\3\2\2\2\67\63\3\2\2\2\67\64\3\2\2\2\67\65\3\2\2\2\67"
          + "\66\3\2\2\28\13\3\2\2\2\7\24\33\'.\67";
  public static final ATN _ATN = new ATNDeserializer().deserialize(_serializedATN.toCharArray());

  static {
    _decisionToDFA = new DFA[_ATN.getNumberOfDecisions()];
    for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) {
      _decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i);
    }
  }
}
