bitmark-grammar
Version:
1,145 lines (1,144 loc) • 453 kB
JavaScript
"use strict";
// Generated from ./antlr/clozeParser.g4 by ANTLR 4.9.0-SNAPSHOT
Object.defineProperty(exports, "__esModule", { value: true });
exports.SpContext = exports.WordsContext = exports.StringContext = exports.NumericContext = exports.Listline_Context = exports.NlContext = exports.ClnspContext = exports.ClContext = exports.OpcContext = exports.OprContext = exports.OpsContext = exports.OpmContext = exports.OppContext = exports.OpaContext = exports.OpqContext = exports.OpbContext = exports.OpuContext = exports.DclinesContext = exports.S_and_wContext = exports.LinesContext = exports.AnchorContext = exports.DollaransContext = exports.Atdef_Context = exports.AtdefContext = exports.IsinfoonlyContext = exports.IstrackedContext = exports.Progress_pointsContext = exports.Bool_labelContext = exports.TitleContext = exports.HintContext = exports.InstructionContext = exports.Dateprop_chainedContext = exports.DatepropContext = exports.ProgressContext = exports.ReferenceContext = exports.Bracketed_textContext = exports.ExampleContext = exports.AnglerefContext = exports.LeadContext = exports.ItemContext = exports.UrlContext = exports.TelephoneContext = exports.Resource_chainedContext = exports.Op_audio_formatContext = exports.Audio_formatContext = exports.Audio_oneContext = exports.AudiobitContext = exports.Image_chained4matchContext = exports.Image_chainedContext = exports.Op_image_formatContext = exports.Image_oneContext = exports.ImagebitContext = exports.Video_oneContext = exports.VideobitContext = exports.Stillimg_oneContext = exports.StillimagefilmbitContext = exports.AppbitContext = exports.WebsitebitContext = exports.DocumentbitContext = exports.ArticlebitContext = exports.Op_stillimagefilm_formatContext = exports.Op_video_formatContext = exports.Op_website_formatContext = exports.Op_app_formatContext = exports.Op_document_formatContext = exports.Op_article_formatContext = exports.Stillimagefilm_formatContext = exports.Website_formatContext = exports.App_formatContext = exports.Document_formatContext = exports.Article_formatContext = exports.Video_formatContext = exports.Image_formatContext = exports.Format2Context = exports.Resource_format_extraContext = exports.Resource_formatContext = exports.FormatContext = exports.AtpointContext = exports.PimagebitContext = exports.Choice_starContext = exports.Choice_minusContext = exports.Choice_plusContext = exports.Inline_choicesContext = exports.Choice_headContext = exports.Headed_inline_choicesContext = exports.Cloze_and_multiple_choice_textContext = exports.Gap_text_instruction_groupedContext = exports.Gap_textContext = exports.Single_gapContext = exports.GapContext = exports.Cloze_solution_groupedContext = exports.Cloze_instruction_groupedContext = exports.ClozeContext = exports.ResourceContext = exports.BitElemContext = exports.ClozesContext = exports.Bitmark_Context = exports.BitmarkContext = exports.clozeParser = void 0;
const ATN_1 = require("antlr4ts/atn/ATN");
const ATNDeserializer_1 = require("antlr4ts/atn/ATNDeserializer");
const FailedPredicateException_1 = require("antlr4ts/FailedPredicateException");
const NoViableAltException_1 = require("antlr4ts/NoViableAltException");
const Parser_1 = require("antlr4ts/Parser");
const ParserRuleContext_1 = require("antlr4ts/ParserRuleContext");
const ParserATNSimulator_1 = require("antlr4ts/atn/ParserATNSimulator");
const RecognitionException_1 = require("antlr4ts/RecognitionException");
const Token_1 = require("antlr4ts/Token");
const VocabularyImpl_1 = require("antlr4ts/VocabularyImpl");
const Utils = require("antlr4ts/misc/Utils");
class clozeParser extends Parser_1.Parser {
constructor(input) {
super(input);
this._interp = new ParserATNSimulator_1.ParserATNSimulator(clozeParser._ATN, this);
}
// @Override
// @NotNull
get vocabulary() {
return clozeParser.VOCABULARY;
}
// tslint:enable:no-trailing-whitespace
// @Override
get grammarFileName() { return "clozeParser.g4"; }
// @Override
get ruleNames() { return clozeParser.ruleNames; }
// @Override
get serializedATN() { return clozeParser._serializedATN; }
createFailedPredicateException(predicate, message) {
return new FailedPredicateException_1.FailedPredicateException(this, predicate, message);
}
// @RuleVersion(0)
bitmark() {
let _localctx = new BitmarkContext(this._ctx, this.state);
this.enterRule(_localctx, 0, clozeParser.RULE_bitmark);
let _la;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 209;
this._errHandler.sync(this);
_la = this._input.LA(1);
do {
{
{
this.state = 196;
this.bitmark_();
this.state = 206;
this._errHandler.sync(this);
_la = this._input.LA(1);
while (_la === clozeParser.S || _la === clozeParser.NL) {
{
{
this.state = 200;
this._errHandler.sync(this);
_la = this._input.LA(1);
while (_la === clozeParser.S) {
{
{
this.state = 197;
this.match(clozeParser.S);
}
}
this.state = 202;
this._errHandler.sync(this);
_la = this._input.LA(1);
}
this.state = 203;
this.nl();
}
}
this.state = 208;
this._errHandler.sync(this);
_la = this._input.LA(1);
}
}
}
this.state = 211;
this._errHandler.sync(this);
_la = this._input.LA(1);
} while ((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << clozeParser.BitCloze) | (1 << clozeParser.BitClozeinstgrp) | (1 << clozeParser.BitClozesolgrp) | (1 << clozeParser.BitClozeandmulti) | (1 << clozeParser.BitGapText) | (1 << clozeParser.BitGapTextInstructionGrouped))) !== 0));
this.state = 213;
this.match(clozeParser.EOF);
}
}
catch (re) {
if (re instanceof RecognitionException_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)
bitmark_() {
let _localctx = new Bitmark_Context(this._ctx, this.state);
this.enterRule(_localctx, 2, clozeParser.RULE_bitmark_);
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 215;
this.clozes();
}
}
catch (re) {
if (re instanceof RecognitionException_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)
clozes() {
let _localctx = new ClozesContext(this._ctx, this.state);
this.enterRule(_localctx, 4, clozeParser.RULE_clozes);
try {
this.state = 223;
this._errHandler.sync(this);
switch (this._input.LA(1)) {
case clozeParser.BitCloze:
this.enterOuterAlt(_localctx, 1);
{
this.state = 217;
this.cloze();
}
break;
case clozeParser.BitClozeinstgrp:
this.enterOuterAlt(_localctx, 2);
{
this.state = 218;
this.cloze_instruction_grouped();
}
break;
case clozeParser.BitClozesolgrp:
this.enterOuterAlt(_localctx, 3);
{
this.state = 219;
this.cloze_solution_grouped();
}
break;
case clozeParser.BitClozeandmulti:
this.enterOuterAlt(_localctx, 4);
{
this.state = 220;
this.cloze_and_multiple_choice_text();
}
break;
case clozeParser.BitGapText:
this.enterOuterAlt(_localctx, 5);
{
this.state = 221;
this.gap_text();
}
break;
case clozeParser.BitGapTextInstructionGrouped:
this.enterOuterAlt(_localctx, 6);
{
this.state = 222;
this.gap_text_instruction_grouped();
}
break;
default:
throw new NoViableAltException_1.NoViableAltException(this);
}
}
catch (re) {
if (re instanceof RecognitionException_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)
bitElem() {
let _localctx = new BitElemContext(this._ctx, this.state);
this.enterRule(_localctx, 6, clozeParser.RULE_bitElem);
try {
let _alt;
this.state = 267;
this._errHandler.sync(this);
switch (this.interpreter.adaptivePredict(this._input, 7, this._ctx)) {
case 1:
this.enterOuterAlt(_localctx, 1);
{
this.state = 225;
this.match(clozeParser.LIST_LINE);
}
break;
case 2:
this.enterOuterAlt(_localctx, 2);
{
this.state = 226;
this.match(clozeParser.NOTBITMARK);
}
break;
case 3:
this.enterOuterAlt(_localctx, 3);
{
this.state = 227;
this.dclines();
}
break;
case 4:
this.enterOuterAlt(_localctx, 4);
{
this.state = 228;
this.gap();
}
break;
case 5:
this.enterOuterAlt(_localctx, 5);
{
this.state = 229;
this.atdef();
}
break;
case 6:
this.enterOuterAlt(_localctx, 6);
{
this.state = 230;
this.reference();
}
break;
case 7:
this.enterOuterAlt(_localctx, 7);
{
this.state = 231;
this.item();
}
break;
case 8:
this.enterOuterAlt(_localctx, 8);
{
this.state = 232;
this.lead();
}
break;
case 9:
this.enterOuterAlt(_localctx, 9);
{
this.state = 233;
this.instruction();
}
break;
case 10:
this.enterOuterAlt(_localctx, 10);
{
this.state = 234;
this.hint();
}
break;
case 11:
this.enterOuterAlt(_localctx, 11);
{
this.state = 235;
this.s_and_w();
}
break;
case 12:
this.enterOuterAlt(_localctx, 12);
{
this.state = 236;
this.example();
}
break;
case 13:
this.enterOuterAlt(_localctx, 13);
{
this.state = 237;
this.bool_label();
}
break;
case 14:
this.enterOuterAlt(_localctx, 14);
{
this.state = 238;
this.imagebit();
this.state = 242;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 4, this._ctx);
while (_alt !== 2 && _alt !== ATN_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1) {
{
{
this.state = 239;
this.nl();
}
}
}
this.state = 244;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 4, this._ctx);
}
}
break;
case 15:
this.enterOuterAlt(_localctx, 15);
{
this.state = 245;
this.audiobit();
this.state = 249;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 5, this._ctx);
while (_alt !== 2 && _alt !== ATN_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1) {
{
{
this.state = 246;
this.nl();
}
}
}
this.state = 251;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 5, this._ctx);
}
}
break;
case 16:
this.enterOuterAlt(_localctx, 16);
{
this.state = 252;
this.videobit();
this.state = 256;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 6, this._ctx);
while (_alt !== 2 && _alt !== ATN_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1) {
{
{
this.state = 253;
this.nl();
}
}
}
this.state = 258;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 6, this._ctx);
}
}
break;
case 17:
this.enterOuterAlt(_localctx, 17);
{
this.state = 259;
this.articlebit();
}
break;
case 18:
this.enterOuterAlt(_localctx, 18);
{
this.state = 260;
this.documentbit();
}
break;
case 19:
this.enterOuterAlt(_localctx, 19);
{
this.state = 261;
this.appbit();
}
break;
case 20:
this.enterOuterAlt(_localctx, 20);
{
this.state = 262;
this.websitebit();
}
break;
case 21:
this.enterOuterAlt(_localctx, 21);
{
this.state = 263;
this.stillimagefilmbit();
}
break;
case 22:
this.enterOuterAlt(_localctx, 22);
{
this.state = 264;
this.angleref();
}
break;
case 23:
this.enterOuterAlt(_localctx, 23);
{
this.state = 265;
this.anchor();
}
break;
case 24:
this.enterOuterAlt(_localctx, 24);
{
this.state = 266;
this.sp();
}
break;
}
}
catch (re) {
if (re instanceof RecognitionException_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)
resource() {
let _localctx = new ResourceContext(this._ctx, this.state);
this.enterRule(_localctx, 8, clozeParser.RULE_resource);
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 269;
this.bitElem();
}
}
catch (re) {
if (re instanceof RecognitionException_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)
cloze() {
let _localctx = new ClozeContext(this._ctx, this.state);
this.enterRule(_localctx, 10, clozeParser.RULE_cloze);
try {
let _alt;
this.enterOuterAlt(_localctx, 1);
{
this.state = 271;
this.match(clozeParser.BitCloze);
this.state = 272;
this.format();
this.state = 273;
this.match(clozeParser.CL);
this.state = 277;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 8, this._ctx);
while (_alt !== 2 && _alt !== ATN_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1) {
{
{
this.state = 274;
this.nl();
}
}
}
this.state = 279;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 8, this._ctx);
}
this.state = 289;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 10, this._ctx);
while (_alt !== 2 && _alt !== ATN_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1) {
{
{
this.state = 280;
this.bitElem();
this.state = 284;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 9, this._ctx);
while (_alt !== 2 && _alt !== ATN_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1) {
{
{
this.state = 281;
this.nl();
}
}
}
this.state = 286;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 9, this._ctx);
}
}
}
}
this.state = 291;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 10, this._ctx);
}
}
}
catch (re) {
if (re instanceof RecognitionException_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)
cloze_instruction_grouped() {
let _localctx = new Cloze_instruction_groupedContext(this._ctx, this.state);
this.enterRule(_localctx, 12, clozeParser.RULE_cloze_instruction_grouped);
let _la;
try {
let _alt;
this.enterOuterAlt(_localctx, 1);
{
this.state = 292;
this.match(clozeParser.BitClozeinstgrp);
this.state = 293;
this.format();
this.state = 294;
this.match(clozeParser.CL);
this.state = 296;
this._errHandler.sync(this);
switch (this.interpreter.adaptivePredict(this._input, 11, this._ctx)) {
case 1:
{
this.state = 295;
this.nl();
}
break;
}
this.state = 307;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 13, this._ctx);
while (_alt !== 2 && _alt !== ATN_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1) {
{
{
this.state = 298;
this.bitElem();
this.state = 302;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 12, this._ctx);
while (_alt !== 2 && _alt !== ATN_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1) {
{
{
this.state = 299;
this.nl();
}
}
}
this.state = 304;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 12, this._ctx);
}
}
}
}
this.state = 309;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 13, this._ctx);
}
this.state = 313;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 14, this._ctx);
while (_alt !== 2 && _alt !== ATN_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1) {
{
{
this.state = 310;
this.match(clozeParser.NL);
}
}
}
this.state = 315;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 14, this._ctx);
}
this.state = 329;
this._errHandler.sync(this);
switch (this.interpreter.adaptivePredict(this._input, 17, this._ctx)) {
case 1:
{
this.state = 316;
this.resource();
this.state = 326;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 16, this._ctx);
while (_alt !== 2 && _alt !== ATN_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1) {
{
{
this.state = 320;
this._errHandler.sync(this);
_la = this._input.LA(1);
while (_la === clozeParser.NL) {
{
{
this.state = 317;
this.match(clozeParser.NL);
}
}
this.state = 322;
this._errHandler.sync(this);
_la = this._input.LA(1);
}
this.state = 323;
this.resource();
}
}
}
this.state = 328;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 16, this._ctx);
}
}
break;
}
}
}
catch (re) {
if (re instanceof RecognitionException_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)
cloze_solution_grouped() {
let _localctx = new Cloze_solution_groupedContext(this._ctx, this.state);
this.enterRule(_localctx, 14, clozeParser.RULE_cloze_solution_grouped);
let _la;
try {
let _alt;
this.enterOuterAlt(_localctx, 1);
{
this.state = 331;
this.match(clozeParser.BitClozesolgrp);
this.state = 332;
this.format();
this.state = 333;
this.match(clozeParser.CL);
this.state = 335;
this._errHandler.sync(this);
switch (this.interpreter.adaptivePredict(this._input, 18, this._ctx)) {
case 1:
{
this.state = 334;
this.nl();
}
break;
}
this.state = 346;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 20, this._ctx);
while (_alt !== 2 && _alt !== ATN_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1) {
{
{
this.state = 337;
this.bitElem();
this.state = 341;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 19, this._ctx);
while (_alt !== 2 && _alt !== ATN_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1) {
{
{
this.state = 338;
this.nl();
}
}
}
this.state = 343;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 19, this._ctx);
}
}
}
}
this.state = 348;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 20, this._ctx);
}
this.state = 352;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 21, this._ctx);
while (_alt !== 2 && _alt !== ATN_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1) {
{
{
this.state = 349;
this.match(clozeParser.NL);
}
}
}
this.state = 354;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 21, this._ctx);
}
this.state = 368;
this._errHandler.sync(this);
switch (this.interpreter.adaptivePredict(this._input, 24, this._ctx)) {
case 1:
{
this.state = 355;
this.resource();
this.state = 365;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 23, this._ctx);
while (_alt !== 2 && _alt !== ATN_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1) {
{
{
this.state = 359;
this._errHandler.sync(this);
_la = this._input.LA(1);
while (_la === clozeParser.NL) {
{
{
this.state = 356;
this.match(clozeParser.NL);
}
}
this.state = 361;
this._errHandler.sync(this);
_la = this._input.LA(1);
}
this.state = 362;
this.resource();
}
}
}
this.state = 367;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 23, this._ctx);
}
}
break;
}
}
}
catch (re) {
if (re instanceof RecognitionException_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)
gap() {
let _localctx = new GapContext(this._ctx, this.state);
this.enterRule(_localctx, 16, clozeParser.RULE_gap);
try {
let _alt;
this.enterOuterAlt(_localctx, 1);
{
this.state = 370;
this.single_gap();
this.state = 378;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 26, this._ctx);
while (_alt !== 2 && _alt !== ATN_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1) {
{
this.state = 376;
this._errHandler.sync(this);
switch (this._input.LA(1)) {
case clozeParser.OPU:
{
this.state = 371;
this.single_gap();
}
break;
case clozeParser.OPB:
{
this.state = 372;
this.instruction();
}
break;
case clozeParser.OPQ:
{
this.state = 373;
this.hint();
}
break;
case clozeParser.OPC:
case clozeParser.OPITEM:
{
this.state = 374;
this.item();
}
break;
case clozeParser.AtExampleWithStr:
case clozeParser.AtExamplecol:
case clozeParser.AtExamplecl:
{
this.state = 375;
this.example();
}
break;
default:
throw new NoViableAltException_1.NoViableAltException(this);
}
}
}
this.state = 380;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 26, this._ctx);
}
}
}
catch (re) {
if (re instanceof RecognitionException_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)
single_gap() {
let _localctx = new Single_gapContext(this._ctx, this.state);
this.enterRule(_localctx, 18, clozeParser.RULE_single_gap);
try {
let _alt;
this.enterOuterAlt(_localctx, 1);
{
this.state = 381;
this.match(clozeParser.OPU);
this.state = 385;
this._errHandler.sync(this);
switch (this.interpreter.adaptivePredict(this._input, 27, this._ctx)) {
case 1:
{
this.state = 382;
this.numeric();
}
break;
case 2:
{
this.state = 383;
this.string();
}
break;
case 3:
// tslint:disable-next-line:no-empty
{
}
break;
}
this.state = 390;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 28, this._ctx);
while (_alt !== 2 && _alt !== ATN_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1) {
{
{
this.state = 387;
this.s_and_w();
}
}
}
this.state = 392;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 28, this._ctx);
}
this.state = 393;
this.clnsp();
}
}
catch (re) {
if (re instanceof RecognitionException_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)
gap_text() {
let _localctx = new Gap_textContext(this._ctx, this.state);
this.enterRule(_localctx, 20, clozeParser.RULE_gap_text);
try {
let _alt;
this.enterOuterAlt(_localctx, 1);
{
this.state = 395;
this.match(clozeParser.BitGapText);
this.state = 396;
this.format();
this.state = 397;
this.match(clozeParser.CL);
this.state = 401;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 29, this._ctx);
while (_alt !== 2 && _alt !== ATN_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1) {
{
{
this.state = 398;
this.nl();
}
}
}
this.state = 403;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 29, this._ctx);
}
this.state = 413;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 31, this._ctx);
while (_alt !== 2 && _alt !== ATN_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1) {
{
{
this.state = 404;
this.bitElem();
this.state = 408;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 30, this._ctx);
while (_alt !== 2 && _alt !== ATN_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1) {
{
{
this.state = 405;
this.nl();
}
}
}
this.state = 410;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 30, this._ctx);
}
}
}
}
this.state = 415;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 31, this._ctx);
}
}
}
catch (re) {
if (re instanceof RecognitionException_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)
gap_text_instruction_grouped() {
let _localctx = new Gap_text_instruction_groupedContext(this._ctx, this.state);
this.enterRule(_localctx, 22, clozeParser.RULE_gap_text_instruction_grouped);
let _la;
try {
let _alt;
this.enterOuterAlt(_localctx, 1);
{
this.state = 416;
this.match(clozeParser.BitGapTextInstructionGrouped);
this.state = 417;
this.format();
this.state = 418;
this.match(clozeParser.CL);
this.state = 420;
this._errHandler.sync(this);
switch (this.interpreter.adaptivePredict(this._input, 32, this._ctx)) {
case 1:
{
this.state = 419;
this.nl();
}
break;
}
this.state = 431;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 34, this._ctx);
while (_alt !== 2 && _alt !== ATN_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1) {
{
{
this.state = 422;
this.bitElem();
this.state = 426;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 33, this._ctx);
while (_alt !== 2 && _alt !== ATN_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1) {
{
{
this.state = 423;
this.nl();
}
}
}
this.state = 428;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 33, this._ctx);
}
}
}
}
this.state = 433;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 34, this._ctx);
}
this.state = 437;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 35, this._ctx);
while (_alt !== 2 && _alt !== ATN_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1) {
{
{
this.state = 434;
this.match(clozeParser.NL);
}
}
}
this.state = 439;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 35, this._ctx);
}
this.state = 453;
this._errHandler.sync(this);
switch (this.interpreter.adaptivePredict(this._input, 38, this._ctx)) {
case 1:
{
this.state = 440;
this.resource();
this.state = 450;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 37, this._ctx);
while (_alt !== 2 && _alt !== ATN_1.ATN.INVALID_ALT_NUMBER) {
if (_alt === 1) {
{
{
this.state = 444;
this._errHandler.sync(this);
_la = this._input.LA(1);
while (_la === clozeParser.NL) {
{
{
this.state = 441;
this.match(clozeParser.NL);
}
}
this.state = 446;
this._errHandler.sync(this);
_la = this._input.LA(1);
}
this.state = 447;
this.resource();
}
}
}
this.state = 452;
this._errHandler.sync(this);
_alt = this.interpreter.adaptivePredict(this._input, 37, this._ctx);
}
}
break;
}
}
}