yini-parser
Version:
Node.js parser for YINI — a clean, structured INI alternative with types, simple section nesting, comments, and strict mode.
1,321 lines • 93.7 kB
JavaScript
"use strict";
// Generated from grammar/v1.0.0-rc.2x/YiniParser.g4 by ANTLR 4.13.2
// noinspection ES6UnusedImports,JSUnusedGlobalSymbols,JSUnusedLocalSymbols
Object.defineProperty(exports, "__esModule", { value: true });
exports.Bad_memberContext = exports.Empty_listContext = exports.Empty_objectContext = exports.Boolean_literalContext = exports.String_concatContext = exports.String_literalContext = exports.Null_literalContext = exports.Number_literalContext = exports.ElementContext = exports.ElementsContext = exports.List_in_bracketsContext = exports.ListContext = exports.ObjectMemberContext = exports.ObjectMemberListContext = exports.Object_literalContext = exports.ValueContext = exports.Member_colon_listContext = exports.MemberContext = exports.Section_membersContext = exports.Terminal_lineContext = exports.SectionContext = exports.YiniContext = void 0;
const antlr4_1 = require("antlr4");
class YiniParser extends antlr4_1.Parser {
get grammarFileName() { return "YiniParser.g4"; }
get literalNames() { return YiniParser.literalNames; }
get symbolicNames() { return YiniParser.symbolicNames; }
get ruleNames() { return YiniParser.ruleNames; }
get serializedATN() { return YiniParser._serializedATN; }
createFailedPredicateException(predicate, message) {
return new antlr4_1.FailedPredicateException(this, predicate, message);
}
constructor(input) {
super(input);
this._interp = new antlr4_1.ParserATNSimulator(this, YiniParser._ATN, YiniParser.DecisionsToDFA, new antlr4_1.PredictionContextCache());
}
// @RuleVersion(0)
yini() {
let localctx = new YiniContext(this, this._ctx, this.state);
this.enterRule(localctx, 0, YiniParser.RULE_yini);
let _la;
try {
let _alt;
this.enterOuterAlt(localctx, 1);
{
this.state = 45;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === 27) {
{
this.state = 44;
this.match(YiniParser.SHEBANG);
}
}
this.state = 50;
this._errHandler.sync(this);
_alt = this._interp.adaptivePredict(this._input, 1, this._ctx);
while (_alt !== 2 && _alt !== antlr4_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1) {
{
{
this.state = 47;
this.match(YiniParser.INLINE_COMMENT);
}
}
}
this.state = 52;
this._errHandler.sync(this);
_alt = this._interp.adaptivePredict(this._input, 1, this._ctx);
}
this.state = 56;
this._errHandler.sync(this);
_alt = this._interp.adaptivePredict(this._input, 2, this._ctx);
while (_alt !== 2 && _alt !== antlr4_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1) {
{
{
this.state = 53;
this.match(YiniParser.NL);
}
}
}
this.state = 58;
this._errHandler.sync(this);
_alt = this._interp.adaptivePredict(this._input, 2, this._ctx);
}
this.state = 60;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === 1) {
{
this.state = 59;
this.match(YiniParser.YINI_MARKER);
}
}
this.state = 65;
this._errHandler.sync(this);
_la = this._input.LA(1);
while (_la === 45) {
{
{
this.state = 62;
this.match(YiniParser.INLINE_COMMENT);
}
}
this.state = 67;
this._errHandler.sync(this);
_la = this._input.LA(1);
}
this.state = 71;
this._errHandler.sync(this);
_la = this._input.LA(1);
while (_la === 39) {
{
{
this.state = 68;
this.match(YiniParser.NL);
}
}
this.state = 73;
this._errHandler.sync(this);
_la = this._input.LA(1);
}
this.state = 75;
this._errHandler.sync(this);
_la = this._input.LA(1);
do {
{
{
this.state = 74;
this.section();
}
}
this.state = 77;
this._errHandler.sync(this);
_la = this._input.LA(1);
} while ((((_la) & ~0x1F) === 0 && ((1 << _la) & 935371268) !== 0) || ((((_la - 32)) & ~0x1F) === 0 && ((1 << (_la - 32)) & 33281) !== 0));
this.state = 82;
this._errHandler.sync(this);
_la = this._input.LA(1);
while (_la === 39) {
{
{
this.state = 79;
this.match(YiniParser.NL);
}
}
this.state = 84;
this._errHandler.sync(this);
_la = this._input.LA(1);
}
this.state = 86;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === 3) {
{
this.state = 85;
this.terminal_line();
}
}
this.state = 89;
this._errHandler.sync(this);
switch (this._interp.adaptivePredict(this._input, 9, this._ctx)) {
case 1:
{
this.state = 88;
this.match(YiniParser.EOF);
}
break;
}
}
}
catch (re) {
if (re instanceof antlr4_1.RecognitionException) {
localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localctx;
}
// @RuleVersion(0)
section() {
let localctx = new SectionContext(this, this._ctx, this.state);
this.enterRule(localctx, 2, YiniParser.RULE_section);
try {
this.enterOuterAlt(localctx, 1);
{
this.state = 92;
this._errHandler.sync(this);
switch (this._interp.adaptivePredict(this._input, 10, this._ctx)) {
case 1:
{
this.state = 91;
this.match(YiniParser.SECTION_HEAD);
}
break;
}
this.state = 94;
this.section_members();
}
}
catch (re) {
if (re instanceof antlr4_1.RecognitionException) {
localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localctx;
}
// @RuleVersion(0)
terminal_line() {
let localctx = new Terminal_lineContext(this, this._ctx, this.state);
this.enterRule(localctx, 4, YiniParser.RULE_terminal_line);
let _la;
try {
this.enterOuterAlt(localctx, 1);
{
this.state = 96;
this.match(YiniParser.TERMINAL_TOKEN);
this.state = 111;
this._errHandler.sync(this);
switch (this._interp.adaptivePredict(this._input, 14, this._ctx)) {
case 1:
{
this.state = 98;
this._errHandler.sync(this);
_la = this._input.LA(1);
do {
{
{
this.state = 97;
this.match(YiniParser.NL);
}
}
this.state = 100;
this._errHandler.sync(this);
_la = this._input.LA(1);
} while (_la === 39);
}
break;
case 2:
{
this.state = 103;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === 45) {
{
this.state = 102;
this.match(YiniParser.INLINE_COMMENT);
}
}
this.state = 108;
this._errHandler.sync(this);
_la = this._input.LA(1);
while (_la === 39) {
{
{
this.state = 105;
this.match(YiniParser.NL);
}
}
this.state = 110;
this._errHandler.sync(this);
_la = this._input.LA(1);
}
}
break;
}
}
}
catch (re) {
if (re instanceof antlr4_1.RecognitionException) {
localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localctx;
}
// @RuleVersion(0)
section_members() {
let localctx = new Section_membersContext(this, this._ctx, this.state);
this.enterRule(localctx, 6, YiniParser.RULE_section_members);
try {
let _alt;
this.enterOuterAlt(localctx, 1);
{
this.state = 114;
this._errHandler.sync(this);
_alt = 1;
do {
switch (_alt) {
case 1:
{
{
this.state = 113;
this.member();
}
}
break;
default:
throw new antlr4_1.NoViableAltException(this);
}
this.state = 116;
this._errHandler.sync(this);
_alt = this._interp.adaptivePredict(this._input, 15, this._ctx);
} while (_alt !== 2 && _alt !== antlr4_1.ATN.INVALID_ALT_NUMBER);
}
}
catch (re) {
if (re instanceof antlr4_1.RecognitionException) {
localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localctx;
}
// @RuleVersion(0)
member() {
let localctx = new MemberContext(this, this._ctx, this.state);
this.enterRule(localctx, 8, YiniParser.RULE_member);
let _la;
try {
let _alt;
this.state = 140;
this._errHandler.sync(this);
switch (this._interp.adaptivePredict(this._input, 21, this._ctx)) {
case 1:
this.enterOuterAlt(localctx, 1);
{
this.state = 118;
this.match(YiniParser.KEY);
this.state = 120;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === 41) {
{
this.state = 119;
this.match(YiniParser.WS);
}
}
this.state = 122;
this.match(YiniParser.EQ);
this.state = 124;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === 41) {
{
this.state = 123;
this.match(YiniParser.WS);
}
}
this.state = 127;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (((((_la - 13)) & ~0x1F) === 0 && ((1 << (_la - 13)) & 572933) !== 0)) {
{
this.state = 126;
this.value();
}
}
this.state = 130;
this._errHandler.sync(this);
_alt = 1;
do {
switch (_alt) {
case 1:
{
{
this.state = 129;
this.match(YiniParser.NL);
}
}
break;
default:
throw new antlr4_1.NoViableAltException(this);
}
this.state = 132;
this._errHandler.sync(this);
_alt = this._interp.adaptivePredict(this._input, 19, this._ctx);
} while (_alt !== 2 && _alt !== antlr4_1.ATN.INVALID_ALT_NUMBER);
}
break;
case 2:
this.enterOuterAlt(localctx, 2);
{
this.state = 134;
this.member_colon_list();
}
break;
case 3:
this.enterOuterAlt(localctx, 3);
{
this.state = 135;
this.match(YiniParser.SECTION_HEAD);
this.state = 137;
this._errHandler.sync(this);
switch (this._interp.adaptivePredict(this._input, 20, this._ctx)) {
case 1:
{
this.state = 136;
this.section_members();
}
break;
}
}
break;
case 4:
this.enterOuterAlt(localctx, 4);
{
this.state = 139;
this.bad_member();
}
break;
}
}
catch (re) {
if (re instanceof antlr4_1.RecognitionException) {
localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localctx;
}
// @RuleVersion(0)
member_colon_list() {
let localctx = new Member_colon_listContext(this, this._ctx, this.state);
this.enterRule(localctx, 10, YiniParser.RULE_member_colon_list);
let _la;
try {
let _alt;
this.enterOuterAlt(localctx, 1);
{
this.state = 142;
this.match(YiniParser.KEY);
this.state = 143;
this.match(YiniParser.COLON);
this.state = 145;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === 41) {
{
this.state = 144;
this.match(YiniParser.WS);
}
}
this.state = 148;
this._errHandler.sync(this);
switch (this._interp.adaptivePredict(this._input, 23, this._ctx)) {
case 1:
{
this.state = 147;
this.elements();
}
break;
}
this.state = 151;
this._errHandler.sync(this);
_alt = 1;
do {
switch (_alt) {
case 1:
{
{
this.state = 150;
this.match(YiniParser.NL);
}
}
break;
default:
throw new antlr4_1.NoViableAltException(this);
}
this.state = 153;
this._errHandler.sync(this);
_alt = this._interp.adaptivePredict(this._input, 24, this._ctx);
} while (_alt !== 2 && _alt !== antlr4_1.ATN.INVALID_ALT_NUMBER);
}
}
catch (re) {
if (re instanceof antlr4_1.RecognitionException) {
localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localctx;
}
// @RuleVersion(0)
value() {
let localctx = new ValueContext(this, this._ctx, this.state);
this.enterRule(localctx, 12, YiniParser.RULE_value);
try {
this.state = 161;
this._errHandler.sync(this);
switch (this._input.LA(1)) {
case 24:
this.enterOuterAlt(localctx, 1);
{
this.state = 155;
this.null_literal();
}
break;
case 32:
this.enterOuterAlt(localctx, 2);
{
this.state = 156;
this.string_literal();
}
break;
case 28:
this.enterOuterAlt(localctx, 3);
{
this.state = 157;
this.number_literal();
}
break;
case 22:
case 23:
this.enterOuterAlt(localctx, 4);
{
this.state = 158;
this.boolean_literal();
}
break;
case 13:
case 26:
this.enterOuterAlt(localctx, 5);
{
this.state = 159;
this.list_in_brackets();
}
break;
case 15:
case 25:
this.enterOuterAlt(localctx, 6);
{
this.state = 160;
this.object_literal();
}
break;
default:
throw new antlr4_1.NoViableAltException(this);
}
}
catch (re) {
if (re instanceof antlr4_1.RecognitionException) {
localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localctx;
}
// @RuleVersion(0)
object_literal() {
let localctx = new Object_literalContext(this, this._ctx, this.state);
this.enterRule(localctx, 14, YiniParser.RULE_object_literal);
let _la;
try {
let _alt;
this.state = 191;
this._errHandler.sync(this);
switch (this._interp.adaptivePredict(this._input, 30, this._ctx)) {
case 1:
this.enterOuterAlt(localctx, 1);
{
this.state = 163;
this.match(YiniParser.OC);
this.state = 167;
this._errHandler.sync(this);
_la = this._input.LA(1);
while (_la === 39) {
{
{
this.state = 164;
this.match(YiniParser.NL);
}
}
this.state = 169;
this._errHandler.sync(this);
_la = this._input.LA(1);
}
this.state = 170;
this.objectMemberList();
this.state = 174;
this._errHandler.sync(this);
_la = this._input.LA(1);
while (_la === 39) {
{
{
this.state = 171;
this.match(YiniParser.NL);
}
}
this.state = 176;
this._errHandler.sync(this);
_la = this._input.LA(1);
}
this.state = 177;
this.match(YiniParser.CC);
this.state = 181;
this._errHandler.sync(this);
_alt = this._interp.adaptivePredict(this._input, 28, this._ctx);
while (_alt !== 2 && _alt !== antlr4_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1) {
{
{
this.state = 178;
this.match(YiniParser.NL);
}
}
}
this.state = 183;
this._errHandler.sync(this);
_alt = this._interp.adaptivePredict(this._input, 28, this._ctx);
}
}
break;
case 2:
this.enterOuterAlt(localctx, 2);
{
this.state = 184;
this.empty_object();
this.state = 188;
this._errHandler.sync(this);
_alt = this._interp.adaptivePredict(this._input, 29, this._ctx);
while (_alt !== 2 && _alt !== antlr4_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1) {
{
{
this.state = 185;
this.match(YiniParser.NL);
}
}
}
this.state = 190;
this._errHandler.sync(this);
_alt = this._interp.adaptivePredict(this._input, 29, this._ctx);
}
}
break;
}
}
catch (re) {
if (re instanceof antlr4_1.RecognitionException) {
localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localctx;
}
// @RuleVersion(0)
objectMemberList() {
let localctx = new ObjectMemberListContext(this, this._ctx, this.state);
this.enterRule(localctx, 16, YiniParser.RULE_objectMemberList);
let _la;
try {
let _alt;
this.state = 217;
this._errHandler.sync(this);
switch (this._input.LA(1)) {
case 29:
this.enterOuterAlt(localctx, 1);
{
this.state = 193;
this.objectMember();
this.state = 204;
this._errHandler.sync(this);
_alt = this._interp.adaptivePredict(this._input, 32, this._ctx);
while (_alt !== 2 && _alt !== antlr4_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1) {
{
{
this.state = 194;
this.match(YiniParser.COMMA);
this.state = 198;
this._errHandler.sync(this);
_la = this._input.LA(1);
while (_la === 39) {
{
{
this.state = 195;
this.match(YiniParser.NL);
}
}
this.state = 200;
this._errHandler.sync(this);
_la = this._input.LA(1);
}
this.state = 201;
this.objectMember();
}
}
}
this.state = 206;
this._errHandler.sync(this);
_alt = this._interp.adaptivePredict(this._input, 32, this._ctx);
}
this.state = 208;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === 11) {
{
this.state = 207;
this.match(YiniParser.COMMA);
}
}
}
break;
case 15:
case 25:
this.enterOuterAlt(localctx, 2);
{
this.state = 210;
this.empty_object();
this.state = 214;
this._errHandler.sync(this);
_alt = this._interp.adaptivePredict(this._input, 34, this._ctx);
while (_alt !== 2 && _alt !== antlr4_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1) {
{
{
this.state = 211;
this.match(YiniParser.NL);
}
}
}
this.state = 216;
this._errHandler.sync(this);
_alt = this._interp.adaptivePredict(this._input, 34, this._ctx);
}
}
break;
default:
throw new antlr4_1.NoViableAltException(this);
}
}
catch (re) {
if (re instanceof antlr4_1.RecognitionException) {
localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localctx;
}
// @RuleVersion(0)
objectMember() {
let localctx = new ObjectMemberContext(this, this._ctx, this.state);
this.enterRule(localctx, 18, YiniParser.RULE_objectMember);
let _la;
try {
this.enterOuterAlt(localctx, 1);
{
this.state = 219;
this.match(YiniParser.KEY);
this.state = 221;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === 41) {
{
this.state = 220;
this.match(YiniParser.WS);
}
}
this.state = 223;
this.match(YiniParser.COLON);
this.state = 227;
this._errHandler.sync(this);
_la = this._input.LA(1);
while (_la === 39) {
{
{
this.state = 224;
this.match(YiniParser.NL);
}
}
this.state = 229;
this._errHandler.sync(this);
_la = this._input.LA(1);
}
this.state = 230;
this.value();
}
}
catch (re) {
if (re instanceof antlr4_1.RecognitionException) {
localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localctx;
}
// @RuleVersion(0)
list() {
let localctx = new ListContext(this, this._ctx, this.state);
this.enterRule(localctx, 20, YiniParser.RULE_list);
try {
this.state = 234;
this._errHandler.sync(this);
switch (this._interp.adaptivePredict(this._input, 38, this._ctx)) {
case 1:
this.enterOuterAlt(localctx, 1);
{
this.state = 232;
this.elements();
}
break;
case 2:
this.enterOuterAlt(localctx, 2);
{
this.state = 233;
this.list_in_brackets();
}
break;
}
}
catch (re) {
if (re instanceof antlr4_1.RecognitionException) {
localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localctx;
}
// @RuleVersion(0)
list_in_brackets() {
let localctx = new List_in_bracketsContext(this, this._ctx, this.state);
this.enterRule(localctx, 22, YiniParser.RULE_list_in_brackets);
let _la;
try {
let _alt;
this.state = 259;
this._errHandler.sync(this);
switch (this._interp.adaptivePredict(this._input, 42, this._ctx)) {
case 1:
this.enterOuterAlt(localctx, 1);
{
this.state = 236;
this.match(YiniParser.OB);
this.state = 240;
this._errHandler.sync(this);
_alt = this._interp.adaptivePredict(this._input, 39, this._ctx);
while (_alt !== 2 && _alt !== antlr4_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1) {
{
{
this.state = 237;
this.match(YiniParser.NL);
}
}
}
this.state = 242;
this._errHandler.sync(this);
_alt = this._interp.adaptivePredict(this._input, 39, this._ctx);
}
this.state = 243;
this.elements();
this.state = 247;
this._errHandler.sync(this);
_la = this._input.LA(1);
while (_la === 39) {
{
{
this.state = 244;
this.match(YiniParser.NL);
}
}
this.state = 249;
this._errHandler.sync(this);
_la = this._input.LA(1);
}
this.state = 250;
this.match(YiniParser.CB);
}
break;
case 2:
this.enterOuterAlt(localctx, 2);
{
this.state = 252;
this.empty_list();
this.state = 256;
this._errHandler.sync(this);
_alt = this._interp.adaptivePredict(this._input, 41, this._ctx);
while (_alt !== 2 && _alt !== antlr4_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1) {
{
{
this.state = 253;
this.match(YiniParser.NL);
}
}
}
this.state = 258;
this._errHandler.sync(this);
_alt = this._interp.adaptivePredict(this._input, 41, this._ctx);
}
}
break;
}
}
catch (re) {
if (re instanceof antlr4_1.RecognitionException) {
localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localctx;
}
// @RuleVersion(0)
elements() {
let localctx = new ElementsContext(this, this._ctx, this.state);
this.enterRule(localctx, 24, YiniParser.RULE_elements);
let _la;
try {
this.state = 269;
this._errHandler.sync(this);
switch (this._interp.adaptivePredict(this._input, 44, this._ctx)) {
case 1:
this.enterOuterAlt(localctx, 1);
{
this.state = 261;
this.element();
this.state = 263;
this._errHandler.sync(this);
_la = this._input.LA(1);
if (_la === 11) {
{
this.state = 262;
this.match(YiniParser.COMMA);
}
}
}
break;
case 2:
this.enterOuterAlt(localctx, 2);
{
this.state = 265;
this.element();
this.state = 266;
this.match(YiniParser.COMMA);
this.state = 267;
this.elements();
}
break;
}
}
catch (re) {
if (re instanceof antlr4_1.RecognitionException) {
localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localctx;
}
// @RuleVersion(0)
element() {
let localctx = new ElementContext(this, this._ctx, this.state);
this.enterRule(localctx, 26, YiniParser.RULE_element);
let _la;
try {
let _alt;
this.state = 297;
this._errHandler.sync(this);
switch (this._interp.adaptivePredict(this._input, 49, this._ctx)) {
case 1:
this.enterOuterAlt(localctx, 1);
{
this.state = 274;
this._errHandler.sync(this);
_la = this._input.LA(1);
while (_la === 39) {
{
{
this.state = 271;
this.match(YiniParser.NL);
}
}
this.state = 276;
this._errHandler.sync(this);
_la = this._input.LA(1);
}
this.state = 277;
this.value();
this.state = 281;
this._errHandler.sync(this);
_alt = this._interp.adaptivePredict(this._input, 46, this._ctx);
while (_alt !== 2 && _alt !== antlr4_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1) {
{
{
this.state = 278;
this.match(YiniParser.NL);
}
}
}
this.state = 283;
this._errHandler.sync(this);
_alt = this._interp.adaptivePredict(this._input, 46, this._ctx);
}
}
break;
case 2:
this.enterOuterAlt(localctx, 2);
{
this.state = 287;
this._errHandler.sync(this);
_la = this._input.LA(1);
while (_la === 39) {
{
{
this.state = 284;
this.match(YiniParser.NL);
}
}
this.state = 289;
this._errHandler.sync(this);
_la = this._input.LA(1);
}
this.state = 290;
this.list_in_brackets();
this.state = 294;
this._errHandler.sync(this);
_alt = this._interp.adaptivePredict(this._input, 48, this._ctx);
while (_alt !== 2 && _alt !== antlr4_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1) {
{
{
this.state = 291;
this.match(YiniParser.NL);
}
}
}
this.state = 296;
this._errHandler.sync(this);
_alt = this._interp.adaptivePredict(this._input, 48, this._ctx);
}
}
break;
}
}
catch (re) {
if (re instanceof antlr4_1.RecognitionException) {
localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localctx;
}
// @RuleVersion(0)
number_literal() {
let localctx = new Number_literalContext(this, this._ctx, this.state);
this.enterRule(localctx, 28, YiniParser.RULE_number_literal);
try {
this.enterOuterAlt(localctx, 1);
{
this.state = 299;
this.match(YiniParser.NUMBER);
}
}
catch (re) {
if (re instanceof antlr4_1.RecognitionException) {
localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localctx;
}
// @RuleVersion(0)
null_literal() {
let localctx = new Null_literalContext(this, this._ctx, this.state);
this.enterRule(localctx, 30, YiniParser.RULE_null_literal);
try {
this.enterOuterAlt(localctx, 1);
{
this.state = 301;
this.match(YiniParser.NULL);
}
}
catch (re) {
if (re instanceof antlr4_1.RecognitionException) {
localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localctx;
}
// @RuleVersion(0)
string_literal() {
let localctx = new String_literalContext(this, this._ctx, this.state);
this.enterRule(localctx, 32, YiniParser.RULE_string_literal);
try {
let _alt;
this.enterOuterAlt(localctx, 1);
{
this.state = 303;
this.match(YiniParser.STRING);
this.state = 307;
this._errHandler.sync(this);
_alt = this._interp.adaptivePredict(this._input, 50, this._ctx);
while (_alt !== 2 && _alt !== antlr4_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1) {
{
{
this.state = 304;
this.string_concat();
}
}
}
this.state = 309;
this._errHandler.sync(this);
_alt = this._interp.adaptivePredict(this._input, 50, this._ctx);
}
}
}
catch (re) {
if (re instanceof antlr4_1.RecognitionException) {
localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localctx;
}
// @RuleVersion(0)
string_concat() {
let localctx = new String_concatContext(this, this._ctx, this.state);
this.enterRule(localctx, 34, YiniParser.RULE_string_concat);
let _la;
try {
this.enterOuterAlt(localctx, 1);
{
this.state = 313;
this._errHandler.sync(this);
_la = this._input.LA(1);
while (_la === 39) {
{
{
this.state = 310;
this.match(YiniParser.NL);
}
}
this.state = 315;
this._errHandler.sync(this);
_la = this._input.LA(1);
}
this.state = 316;
this.match(YiniParser.PLUS);
this.state = 320;
this._errHandler.sync(this);
_la = this._input.LA(1);
while (_la === 39) {
{
{
this.state = 317;
this.match(YiniParser.NL);
}
}
this.state = 322;
this._errHandler.sync(this);
_la = this._input.LA(1);
}
this.state = 323;
this.match(YiniParser.STRING);
}
}
catch (re) {
if (re instanceof antlr4_1.RecognitionException) {
localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localctx;
}
// @RuleVersion(0)
boolean_literal() {
let localctx = new Boolean_literalContext(this, this._ctx, this.state);
this.enterRule(localctx, 36, YiniParser.RULE_boolean_literal);
let _la;
try {
this.enterOuterAlt(localctx, 1);
{
this.state = 325;
_la = this._input.LA(1);
if (!(_la === 22 || _la === 23)) {
this._errHandler.recoverInline(this);
}
else {
this._errHandler.reportMatch(this);
this.consume();
}
}
}
catch (re) {
if (re instanceof antlr4_1.RecognitionException) {
localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localctx;
}
// @RuleVersion(0)
empty_object() {
let localctx = new Empty_objectContext(this, this._ctx, this.state);
this.enterRule(localctx, 38, YiniParser.RULE_empty_object);
let _la;
try {
this.state = 336;
this._errHandler.sync(this);
switch (this.