UNPKG

bitmark-grammar

Version:
1,776 lines (1,733 loc) 344 kB
// Generated from ./Cloze/clozeParser.g4 by ANTLR 4.9.0-SNAPSHOT import { ATN } from "antlr4ts/atn/ATN"; import { ATNDeserializer } from "antlr4ts/atn/ATNDeserializer"; import { FailedPredicateException } from "antlr4ts/FailedPredicateException"; import { NotNull } from "antlr4ts/Decorators"; import { NoViableAltException } from "antlr4ts/NoViableAltException"; import { Override } from "antlr4ts/Decorators"; import { Parser } from "antlr4ts/Parser"; import { ParserRuleContext } from "antlr4ts/ParserRuleContext"; import { ParserATNSimulator } from "antlr4ts/atn/ParserATNSimulator"; import { ParseTreeListener } from "antlr4ts/tree/ParseTreeListener"; import { ParseTreeVisitor } from "antlr4ts/tree/ParseTreeVisitor"; import { RecognitionException } from "antlr4ts/RecognitionException"; import { RuleContext } from "antlr4ts/RuleContext"; //import { RuleVersion } from "antlr4ts/RuleVersion"; import { TerminalNode } from "antlr4ts/tree/TerminalNode"; import { Token } from "antlr4ts/Token"; import { TokenStream } from "antlr4ts/TokenStream"; import { Vocabulary } from "antlr4ts/Vocabulary"; import { VocabularyImpl } from "antlr4ts/VocabularyImpl"; import * as Utils from "antlr4ts/misc/Utils"; import { clozeParserListener } from "./clozeParserListener"; export class clozeParser extends Parser { public static readonly S = 1; public static readonly OPDOT = 2; public static readonly BitCloze = 3; public static readonly BitClozeinstgrp = 4; public static readonly BitClozesolgrp = 5; public static readonly BitClozeandmulti = 6; public static readonly OPSP = 7; public static readonly OPDOLL = 8; public static readonly OPBUL = 9; public static readonly OPESC = 10; public static readonly OPRANGLES = 11; public static readonly OPRANGLEL = 12; public static readonly OPDANGLE = 13; public static readonly OPU = 14; public static readonly OPB = 15; public static readonly OPQ = 16; public static readonly OPA = 17; public static readonly OPP = 18; public static readonly OPM = 19; public static readonly OPS = 20; public static readonly OPR = 21; public static readonly OPC = 22; public static readonly OPHASH = 23; public static readonly CL = 24; public static readonly COLON = 25; public static readonly AMP = 26; public static readonly DBLCOLON = 27; public static readonly PLUS = 28; public static readonly DotAt = 29; public static readonly Greater = 30; public static readonly Less = 31; public static readonly DBLEQ = 32; public static readonly RightAngle = 33; public static readonly RightArrow = 34; public static readonly OP_N_ETC = 35; public static readonly UNSCO = 36; public static readonly COMMENT = 37; public static readonly DCANY = 38; public static readonly Image_type = 39; public static readonly Audio_type = 40; public static readonly Video_type = 41; public static readonly ArticleText = 42; public static readonly NOTCL = 43; public static readonly NUMERIC = 44; public static readonly STRING = 45; public static readonly NL = 46; public static readonly NOTBITMARK = 47; public static readonly ELIPSIS = 48; public static readonly SENTENCE = 49; public static readonly BARSTRING = 50; public static readonly OPAT = 51; public static readonly AtProgress = 52; public static readonly AtReference = 53; public static readonly AtWidth = 54; public static readonly AtHeight = 55; public static readonly AtProgressPoints = 56; public static readonly AtShortanswer = 57; public static readonly AtLonganswer = 58; public static readonly AtExampleWithStr = 59; public static readonly AtExamplecol = 60; public static readonly AtExamplecl = 61; public static readonly AtSampleSolution = 62; public static readonly AtPartialAnswerS = 63; public static readonly AtPartialAnswer = 64; public static readonly AtLabeltrue = 65; public static readonly AtLabelfalse = 66; public static readonly AtPoints = 67; public static readonly AtSrc = 68; public static readonly AtPartner = 69; public static readonly OPATALT = 70; public static readonly OPAMARK = 71; public static readonly ShowInIndex = 72; public static readonly OpAtCaption = 73; public static readonly OpAtLicense = 74; public static readonly OpAtCopyright = 75; public static readonly OpAtSearch = 76; public static readonly OpAtIsTracked = 77; public static readonly OpAtIsInfoOnly = 78; public static readonly AtDate = 79; public static readonly Http = 80; public static readonly Https = 81; public static readonly AmpAudio = 82; public static readonly AmpImage = 83; public static readonly AmpImageZoom = 84; public static readonly AmpImageWAudio = 85; public static readonly AmpVideo = 86; public static readonly AmpArticle = 87; public static readonly AmpDocument = 88; public static readonly AmpApp = 89; public static readonly AmpWebsite = 90; public static readonly AmpStillImageFilm = 91; public static readonly AmpPdf = 92; public static readonly OpAmpAudio = 93; public static readonly OpAmpImage = 94; public static readonly OpAmpImageZoom = 95; public static readonly OpAmpImageWAudio = 96; public static readonly OpAmpVideo = 97; public static readonly OpAmpArticle = 98; public static readonly OpAmpArticleAtt = 99; public static readonly OpAmpDocument = 100; public static readonly OpAmpApp = 101; public static readonly OpAmpWebsite = 102; public static readonly OpAmpStillImageFilm = 103; public static readonly BracEnclose = 104; public static readonly AmpAudioLink = 105; public static readonly AmpImageLink = 106; public static readonly AmpVideoLink = 107; public static readonly AmpArticleLink = 108; public static readonly AmpDocumentLink = 109; public static readonly AmpDocumentDownload = 110; public static readonly AmpAppLink = 111; public static readonly AmpWebsiteLink = 112; public static readonly AmpStillImageFilmLink = 113; public static readonly OpAmpAudioLink = 114; public static readonly OpAmpImageLink = 115; public static readonly OpAmpVideoLink = 116; public static readonly OpAmpArticleLink = 117; public static readonly OpAmpDocumentLink = 118; public static readonly OpAmpDocumentDownload = 119; public static readonly OpAmpAppLink = 120; public static readonly OpAmpWebsiteLink = 121; public static readonly OpAmpStillImageFilmLink = 122; public static readonly AmpImageEmbed = 123; public static readonly AmpVideoEmbed = 124; public static readonly AmpAudioEmbed = 125; public static readonly AmpDocumentEmbed = 126; public static readonly AmpStillImageFilmEmbed = 127; public static readonly OpAmpImageEmbed = 128; public static readonly OpAmpVideoEmbed = 129; public static readonly OpAmpAudioEmbed = 130; public static readonly OpAmpDocumentEmbed = 131; public static readonly OpAmpStillImageFilmEmbed = 132; public static readonly BitmarkMinus = 133; public static readonly BitmarkPlus = 134; public static readonly ColonText = 135; public static readonly ColonJson = 136; public static readonly Prosemirror = 137; public static readonly Placeholder = 138; public static readonly BASIC = 139; public static readonly JPG = 140; public static readonly PNG = 141; public static readonly GIF = 142; public static readonly SVG = 143; public static readonly MP2 = 144; public static readonly MP3 = 145; public static readonly MP4 = 146; public static readonly FLV = 147; public static readonly WMV = 148; public static readonly MPEG = 149; public static readonly MPG = 150; public static readonly TEL = 151; public static readonly DotArticleAtt = 152; public static readonly STAR = 153; public static readonly URL = 154; public static readonly LIST_LINE = 155; public static readonly ENCLBARS = 156; public static readonly RULE_bitmark = 0; public static readonly RULE_bitmark_ = 1; public static readonly RULE_clozes = 2; public static readonly RULE_bitElem = 3; public static readonly RULE_resource = 4; public static readonly RULE_cloze = 5; public static readonly RULE_cloze_instruction_grouped = 6; public static readonly RULE_cloze_solution_grouped = 7; public static readonly RULE_gap = 8; public static readonly RULE_single_gap = 9; public static readonly RULE_cloze_and_multiple_choice_text = 10; public static readonly RULE_headed_inline_choices = 11; public static readonly RULE_choice_head = 12; public static readonly RULE_inline_choices = 13; public static readonly RULE_choice_plus = 14; public static readonly RULE_choice_minus = 15; public static readonly RULE_choice_star = 16; public static readonly RULE_pimagebit = 17; public static readonly RULE_atpoint = 18; public static readonly RULE_format = 19; public static readonly RULE_resource_format = 20; public static readonly RULE_resource_format_extra = 21; public static readonly RULE_format2 = 22; public static readonly RULE_image_format = 23; public static readonly RULE_video_format = 24; public static readonly RULE_article_format = 25; public static readonly RULE_document_format = 26; public static readonly RULE_app_format = 27; public static readonly RULE_website_format = 28; public static readonly RULE_stillimagefilm_format = 29; public static readonly RULE_op_article_format = 30; public static readonly RULE_op_document_format = 31; public static readonly RULE_op_app_format = 32; public static readonly RULE_op_website_format = 33; public static readonly RULE_op_video_format = 34; public static readonly RULE_op_stillimagefilm_format = 35; public static readonly RULE_articlebit = 36; public static readonly RULE_documentbit = 37; public static readonly RULE_websitebit = 38; public static readonly RULE_appbit = 39; public static readonly RULE_stillimagefilmbit = 40; public static readonly RULE_stillimg_one = 41; public static readonly RULE_videobit = 42; public static readonly RULE_video_one = 43; public static readonly RULE_imagebit = 44; public static readonly RULE_image_one = 45; public static readonly RULE_op_image_format = 46; public static readonly RULE_image_chained = 47; public static readonly RULE_image_chained4match = 48; public static readonly RULE_audiobit = 49; public static readonly RULE_audio_one = 50; public static readonly RULE_audio_format = 51; public static readonly RULE_op_audio_format = 52; public static readonly RULE_resource_chained = 53; public static readonly RULE_telephone = 54; public static readonly RULE_url = 55; public static readonly RULE_item = 56; public static readonly RULE_lead = 57; public static readonly RULE_angleref = 58; public static readonly RULE_example = 59; public static readonly RULE_bracketed_text = 60; public static readonly RULE_reference = 61; public static readonly RULE_progress = 62; public static readonly RULE_dateprop = 63; public static readonly RULE_dateprop_chained = 64; public static readonly RULE_instruction = 65; public static readonly RULE_hint = 66; public static readonly RULE_title = 67; public static readonly RULE_bool_label = 68; public static readonly RULE_progress_points = 69; public static readonly RULE_istracked = 70; public static readonly RULE_isinfoonly = 71; public static readonly RULE_atdef = 72; public static readonly RULE_atdef_ = 73; public static readonly RULE_dollarans = 74; public static readonly RULE_anchor = 75; public static readonly RULE_lines = 76; public static readonly RULE_s_and_w = 77; public static readonly RULE_dclines = 78; public static readonly RULE_opu = 79; public static readonly RULE_opb = 80; public static readonly RULE_opq = 81; public static readonly RULE_opa = 82; public static readonly RULE_opp = 83; public static readonly RULE_opm = 84; public static readonly RULE_ops = 85; public static readonly RULE_opr = 86; public static readonly RULE_opc = 87; public static readonly RULE_cl = 88; public static readonly RULE_clnsp = 89; public static readonly RULE_nl = 90; public static readonly RULE_listline_ = 91; public static readonly RULE_numeric = 92; public static readonly RULE_string = 93; public static readonly RULE_words = 94; public static readonly RULE_sp = 95; // tslint:disable:no-trailing-whitespace public static readonly ruleNames: string[] = [ "bitmark", "bitmark_", "clozes", "bitElem", "resource", "cloze", "cloze_instruction_grouped", "cloze_solution_grouped", "gap", "single_gap", "cloze_and_multiple_choice_text", "headed_inline_choices", "choice_head", "inline_choices", "choice_plus", "choice_minus", "choice_star", "pimagebit", "atpoint", "format", "resource_format", "resource_format_extra", "format2", "image_format", "video_format", "article_format", "document_format", "app_format", "website_format", "stillimagefilm_format", "op_article_format", "op_document_format", "op_app_format", "op_website_format", "op_video_format", "op_stillimagefilm_format", "articlebit", "documentbit", "websitebit", "appbit", "stillimagefilmbit", "stillimg_one", "videobit", "video_one", "imagebit", "image_one", "op_image_format", "image_chained", "image_chained4match", "audiobit", "audio_one", "audio_format", "op_audio_format", "resource_chained", "telephone", "url", "item", "lead", "angleref", "example", "bracketed_text", "reference", "progress", "dateprop", "dateprop_chained", "instruction", "hint", "title", "bool_label", "progress_points", "istracked", "isinfoonly", "atdef", "atdef_", "dollarans", "anchor", "lines", "s_and_w", "dclines", "opu", "opb", "opq", "opa", "opp", "opm", "ops", "opr", "opc", "cl", "clnsp", "nl", "listline_", "numeric", "string", "words", "sp", ]; private static readonly _LITERAL_NAMES: Array<string | undefined> = [ undefined, undefined, "'[.'", undefined, undefined, undefined, undefined, undefined, undefined, undefined, "'[^'", undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, "'[#'", undefined, "':'", "'&'", "'::'", "'+'", "'.@'", "'>'", "'<'", "'=='", "'\u25BA'", "'\u2192'", undefined, "'_'", undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, "'[@'", undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, "'http://'", "'https://'", "'&audio'", "'&image'", "'&image-zoom'", "'&image-with-audio'", "'&video'", "'&article'", "'&document'", "'&app'", "'&website'", "'&still-image-film'", "'&pdf'", undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, "'&audio-link'", "'&image-link'", "'&video-link'", "'&article-link'", "'&document-link'", "'&document-download'", "'&app-link'", "'&website-link'", "'&still-image-film-link'", undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, "'&image-embed'", "'&video-embed'", "'&daudio-embed'", "'&document-embed'", "'&still-image-film-embed'", undefined, undefined, undefined, undefined, undefined, "':bitmark--'", "':bitmark++'", "':text'", "':json'", "':prosemirror'", "':placeholder'", "':basic'", "':jpg'", "':png'", "':gif'", "':svg'", "':mp2'", "':mp3'", "':mp4'", "':flv'", "':wmv'", "':mpeg'", "':mpg'", "'tel:'", "'.article-attachment'", "'*'", ]; private static readonly _SYMBOLIC_NAMES: Array<string | undefined> = [ undefined, "S", "OPDOT", "BitCloze", "BitClozeinstgrp", "BitClozesolgrp", "BitClozeandmulti", "OPSP", "OPDOLL", "OPBUL", "OPESC", "OPRANGLES", "OPRANGLEL", "OPDANGLE", "OPU", "OPB", "OPQ", "OPA", "OPP", "OPM", "OPS", "OPR", "OPC", "OPHASH", "CL", "COLON", "AMP", "DBLCOLON", "PLUS", "DotAt", "Greater", "Less", "DBLEQ", "RightAngle", "RightArrow", "OP_N_ETC", "UNSCO", "COMMENT", "DCANY", "Image_type", "Audio_type", "Video_type", "ArticleText", "NOTCL", "NUMERIC", "STRING", "NL", "NOTBITMARK", "ELIPSIS", "SENTENCE", "BARSTRING", "OPAT", "AtProgress", "AtReference", "AtWidth", "AtHeight", "AtProgressPoints", "AtShortanswer", "AtLonganswer", "AtExampleWithStr", "AtExamplecol", "AtExamplecl", "AtSampleSolution", "AtPartialAnswerS", "AtPartialAnswer", "AtLabeltrue", "AtLabelfalse", "AtPoints", "AtSrc", "AtPartner", "OPATALT", "OPAMARK", "ShowInIndex", "OpAtCaption", "OpAtLicense", "OpAtCopyright", "OpAtSearch", "OpAtIsTracked", "OpAtIsInfoOnly", "AtDate", "Http", "Https", "AmpAudio", "AmpImage", "AmpImageZoom", "AmpImageWAudio", "AmpVideo", "AmpArticle", "AmpDocument", "AmpApp", "AmpWebsite", "AmpStillImageFilm", "AmpPdf", "OpAmpAudio", "OpAmpImage", "OpAmpImageZoom", "OpAmpImageWAudio", "OpAmpVideo", "OpAmpArticle", "OpAmpArticleAtt", "OpAmpDocument", "OpAmpApp", "OpAmpWebsite", "OpAmpStillImageFilm", "BracEnclose", "AmpAudioLink", "AmpImageLink", "AmpVideoLink", "AmpArticleLink", "AmpDocumentLink", "AmpDocumentDownload", "AmpAppLink", "AmpWebsiteLink", "AmpStillImageFilmLink", "OpAmpAudioLink", "OpAmpImageLink", "OpAmpVideoLink", "OpAmpArticleLink", "OpAmpDocumentLink", "OpAmpDocumentDownload", "OpAmpAppLink", "OpAmpWebsiteLink", "OpAmpStillImageFilmLink", "AmpImageEmbed", "AmpVideoEmbed", "AmpAudioEmbed", "AmpDocumentEmbed", "AmpStillImageFilmEmbed", "OpAmpImageEmbed", "OpAmpVideoEmbed", "OpAmpAudioEmbed", "OpAmpDocumentEmbed", "OpAmpStillImageFilmEmbed", "BitmarkMinus", "BitmarkPlus", "ColonText", "ColonJson", "Prosemirror", "Placeholder", "BASIC", "JPG", "PNG", "GIF", "SVG", "MP2", "MP3", "MP4", "FLV", "WMV", "MPEG", "MPG", "TEL", "DotArticleAtt", "STAR", "URL", "LIST_LINE", "ENCLBARS", ]; public static readonly VOCABULARY: Vocabulary = new VocabularyImpl(clozeParser._LITERAL_NAMES, clozeParser._SYMBOLIC_NAMES, []); // @Override // @NotNull public get vocabulary(): Vocabulary { return clozeParser.VOCABULARY; } // tslint:enable:no-trailing-whitespace // @Override public get grammarFileName(): string { return "clozeParser.g4"; } // @Override public get ruleNames(): string[] { return clozeParser.ruleNames; } // @Override public get serializedATN(): string { return clozeParser._serializedATN; } protected createFailedPredicateException(predicate?: string, message?: string): FailedPredicateException { return new FailedPredicateException(this, predicate, message); } constructor(input: TokenStream) { super(input); this._interp = new ParserATNSimulator(clozeParser._ATN, this); } // @RuleVersion(0) public bitmark(): BitmarkContext { let _localctx: BitmarkContext = new BitmarkContext(this._ctx, this.state); this.enterRule(_localctx, 0, clozeParser.RULE_bitmark); let _la: number; try { this.enterOuterAlt(_localctx, 1); { this.state = 205; this._errHandler.sync(this); _la = this._input.LA(1); do { { { this.state = 192; this.bitmark_(); this.state = 202; this._errHandler.sync(this); _la = this._input.LA(1); while (_la === clozeParser.S || _la === clozeParser.NL) { { { this.state = 196; this._errHandler.sync(this); _la = this._input.LA(1); while (_la === clozeParser.S) { { { this.state = 193; this.match(clozeParser.S); } } this.state = 198; this._errHandler.sync(this); _la = this._input.LA(1); } this.state = 199; this.nl(); } } this.state = 204; this._errHandler.sync(this); _la = this._input.LA(1); } } } this.state = 207; 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))) !== 0)); this.state = 209; this.match(clozeParser.EOF); } } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); this._errHandler.recover(this, re); } else { throw re; } } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public bitmark_(): Bitmark_Context { let _localctx: Bitmark_Context = new Bitmark_Context(this._ctx, this.state); this.enterRule(_localctx, 2, clozeParser.RULE_bitmark_); try { this.enterOuterAlt(_localctx, 1); { this.state = 211; this.clozes(); } } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); this._errHandler.recover(this, re); } else { throw re; } } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public clozes(): ClozesContext { let _localctx: ClozesContext = new ClozesContext(this._ctx, this.state); this.enterRule(_localctx, 4, clozeParser.RULE_clozes); try { this.state = 217; this._errHandler.sync(this); switch (this._input.LA(1)) { case clozeParser.BitCloze: this.enterOuterAlt(_localctx, 1); { this.state = 213; this.cloze(); } break; case clozeParser.BitClozeinstgrp: this.enterOuterAlt(_localctx, 2); { this.state = 214; this.cloze_instruction_grouped(); } break; case clozeParser.BitClozesolgrp: this.enterOuterAlt(_localctx, 3); { this.state = 215; this.cloze_solution_grouped(); } break; case clozeParser.BitClozeandmulti: this.enterOuterAlt(_localctx, 4); { this.state = 216; this.cloze_and_multiple_choice_text(); } break; default: throw new NoViableAltException(this); } } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); this._errHandler.recover(this, re); } else { throw re; } } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public bitElem(): BitElemContext { let _localctx: BitElemContext = new BitElemContext(this._ctx, this.state); this.enterRule(_localctx, 6, clozeParser.RULE_bitElem); try { let _alt: number; this.state = 260; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input, 7, this._ctx) ) { case 1: this.enterOuterAlt(_localctx, 1); { this.state = 219; this.match(clozeParser.LIST_LINE); } break; case 2: this.enterOuterAlt(_localctx, 2); { this.state = 220; this.match(clozeParser.NOTBITMARK); } break; case 3: this.enterOuterAlt(_localctx, 3); { this.state = 221; this.dclines(); } break; case 4: this.enterOuterAlt(_localctx, 4); { this.state = 222; this.gap(); } break; case 5: this.enterOuterAlt(_localctx, 5); { this.state = 223; this.atdef(); } break; case 6: this.enterOuterAlt(_localctx, 6); { this.state = 224; this.reference(); } break; case 7: this.enterOuterAlt(_localctx, 7); { this.state = 225; this.item(); } break; case 8: this.enterOuterAlt(_localctx, 8); { this.state = 226; this.instruction(); } break; case 9: this.enterOuterAlt(_localctx, 9); { this.state = 227; this.hint(); } break; case 10: this.enterOuterAlt(_localctx, 10); { this.state = 228; this.s_and_w(); } break; case 11: this.enterOuterAlt(_localctx, 11); { this.state = 229; this.example(); } break; case 12: this.enterOuterAlt(_localctx, 12); { this.state = 230; this.bool_label(); } break; case 13: this.enterOuterAlt(_localctx, 13); { this.state = 231; this.imagebit(); this.state = 235; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 4, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { if (_alt === 1) { { { this.state = 232; this.nl(); } } } this.state = 237; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 4, this._ctx); } } break; case 14: this.enterOuterAlt(_localctx, 14); { this.state = 238; this.audiobit(); this.state = 242; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 5, this._ctx); while (_alt !== 2 && _alt !== 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, 5, this._ctx); } } break; case 15: this.enterOuterAlt(_localctx, 15); { this.state = 245; this.videobit(); this.state = 249; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 6, this._ctx); while (_alt !== 2 && _alt !== 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, 6, this._ctx); } } break; case 16: this.enterOuterAlt(_localctx, 16); { this.state = 252; this.articlebit(); } break; case 17: this.enterOuterAlt(_localctx, 17); { this.state = 253; this.documentbit(); } break; case 18: this.enterOuterAlt(_localctx, 18); { this.state = 254; this.appbit(); } break; case 19: this.enterOuterAlt(_localctx, 19); { this.state = 255; this.websitebit(); } break; case 20: this.enterOuterAlt(_localctx, 20); { this.state = 256; this.stillimagefilmbit(); } break; case 21: this.enterOuterAlt(_localctx, 21); { this.state = 257; this.angleref(); } break; case 22: this.enterOuterAlt(_localctx, 22); { this.state = 258; this.anchor(); } break; case 23: this.enterOuterAlt(_localctx, 23); { this.state = 259; this.sp(); } break; } } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); this._errHandler.recover(this, re); } else { throw re; } } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public resource(): ResourceContext { let _localctx: ResourceContext = new ResourceContext(this._ctx, this.state); this.enterRule(_localctx, 8, clozeParser.RULE_resource); try { this.enterOuterAlt(_localctx, 1); { this.state = 262; this.bitElem(); } } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); this._errHandler.recover(this, re); } else { throw re; } } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public cloze(): ClozeContext { let _localctx: ClozeContext = new ClozeContext(this._ctx, this.state); this.enterRule(_localctx, 10, clozeParser.RULE_cloze); let _la: number; try { let _alt: number; this.enterOuterAlt(_localctx, 1); { this.state = 264; this.match(clozeParser.BitCloze); this.state = 265; this.format(); this.state = 266; this.match(clozeParser.CL); this.state = 270; this._errHandler.sync(this); _la = this._input.LA(1); while (_la === clozeParser.NL) { { { this.state = 267; this.nl(); } } this.state = 272; this._errHandler.sync(this); _la = this._input.LA(1); } this.state = 280; this._errHandler.sync(this); _alt = 1; do { switch (_alt) { case 1: { { this.state = 273; this.bitElem(); this.state = 277; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 9, this._ctx); while (_alt !== 2 && _alt !== 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, 9, this._ctx); } } } break; default: throw new NoViableAltException(this); } this.state = 282; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 10, this._ctx); } while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER); this.state = 287; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 11, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { if (_alt === 1) { { { this.state = 284; this.match(clozeParser.NL); } } } this.state = 289; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 11, this._ctx); } this.state = 303; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input, 14, this._ctx) ) { case 1: { this.state = 290; this.resource(); this.state = 300; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 13, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { if (_alt === 1) { { { this.state = 294; this._errHandler.sync(this); _la = this._input.LA(1); while (_la === clozeParser.NL) { { { this.state = 291; this.match(clozeParser.NL); } } this.state = 296; this._errHandler.sync(this); _la = this._input.LA(1); } this.state = 297; this.resource(); } } } this.state = 302; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 13, this._ctx); } } break; } } } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); this._errHandler.recover(this, re); } else { throw re; } } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public cloze_instruction_grouped(): Cloze_instruction_groupedContext { let _localctx: Cloze_instruction_groupedContext = new Cloze_instruction_groupedContext(this._ctx, this.state); this.enterRule(_localctx, 12, clozeParser.RULE_cloze_instruction_grouped); let _la: number; try { let _alt: number; this.enterOuterAlt(_localctx, 1); { this.state = 305; this.match(clozeParser.BitClozeinstgrp); this.state = 306; this.format(); this.state = 307; this.match(clozeParser.CL); this.state = 309; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input, 15, this._ctx) ) { case 1: { this.state = 308; this.nl(); } break; } this.state = 314; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input, 16, this._ctx) ) { case 1: { this.state = 311; this.item(); this.state = 312; this.nl(); } break; } this.state = 317; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input, 17, this._ctx) ) { case 1: { this.state = 316; this.instruction(); } break; } this.state = 322; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 18, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { if (_alt === 1) { { { this.state = 319; this.nl(); } } } this.state = 324; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 18, this._ctx); } this.state = 334; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 20, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { if (_alt === 1) { { { { this.state = 325; this.bitElem(); this.state = 329; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 19, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { if (_alt === 1) { { { this.state = 326; this.nl(); } } } this.state = 331; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 19, this._ctx); } } } } } this.state = 336; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 20, this._ctx); } this.state = 340; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 21, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { if (_alt === 1) { { { this.state = 337; this.match(clozeParser.NL); } } } this.state = 342; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 21, this._ctx); } this.state = 356; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input, 24, this._ctx) ) { case 1: { this.state = 343; this.resource(); this.state = 353; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 23, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { if (_alt === 1) { { { this.state = 347; this._errHandler.sync(this); _la = this._input.LA(1); while (_la === clozeParser.NL) { { { this.state = 344; this.match(clozeParser.NL); } } this.state = 349; this._errHandler.sync(this); _la = this._input.LA(1); } this.state = 350; this.resource(); } } } this.state = 355; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 23, this._ctx); } } break; } } } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); this._errHandler.recover(this, re); } else { throw re; } } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public cloze_solution_grouped(): Cloze_solution_groupedContext { let _localctx: Cloze_solution_groupedContext = new Cloze_solution_groupedContext(this._ctx, this.state); this.enterRule(_localctx, 14, clozeParser.RULE_cloze_solution_grouped); let _la: number; try { let _alt: number; this.enterOuterAlt(_localctx, 1); { this.state = 358; this.match(clozeParser.BitClozesolgrp); this.state = 359; this.format(); this.state = 360; this.match(clozeParser.CL); this.state = 362; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input, 25, this._ctx) ) { case 1: { this.state = 361; this.nl(); } break; } this.state = 367; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input, 26, this._ctx) ) { case 1: { this.state = 364; this.item(); this.state = 365; this.nl(); } break; } this.state = 370; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input, 27, this._ctx) ) { case 1: { this.state = 369; this.instruction(); } break; } this.state = 375; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 28, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { if (_alt === 1) { { { this.state = 372; this.nl(); } } } this.state = 377; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 28, this._ctx); } this.state = 387; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 30, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { if (_alt === 1) { { { { this.state = 378; this.bitElem(); this.state = 382; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 29, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { if (_alt === 1) { { { this.state = 379; this.nl(); } } } this.state = 384; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 29, this._ctx); } } } } } this.state = 389; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 30, this._ctx); } this.state = 393; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 31, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { if (_alt === 1) { { { this.state = 390; this.match(clozeParser.NL); } } } this.state = 395; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 31, this._ctx); } this.state = 409; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input, 34, this._ctx) ) { case 1: { this.state = 396; this.resource(); this.state = 406; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 33, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { if (_alt === 1) { { { this.state = 400; this._errHandler.sync(this); _la = this._input.LA(1); while (_la === clozeParser.NL) { { { this.state = 397; this.match(clozeParser.NL); } } this.state = 402; this._errHandler.sync(this); _la = this._input.LA(1); } this.state = 403; this.resource(); } } } this.state = 408; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 33, this._ctx); } } break; } } } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); this._errHandler.recover(this, re); } else { throw re; } } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public gap(): GapContext { let _localctx: GapContext = new GapContext(this._ctx, this.state); this.enterRule(_localctx, 16, clozeParser.RULE_gap); try { let _alt: number; this.enterOuterAlt(_localctx, 1); { this.state = 411; this.single_gap(); this.state = 419; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 36, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { if (_alt === 1) { { this.state = 417; this._errHandler.sync(this); switch (this._input.LA(1)) { case clozeParser.OPU: { this.state = 412; this.single_gap(); } break; case clozeParser.OPB: { this.state = 413; this.instruction(); } break; case clozeParser.OPQ: { this.state = 414; this.hint(); } break; case clozeParser.OPC: { this.state = 415; this.item(); } break; case clozeParser.AtExampleWithStr: case clozeParser.AtExamplecol: case clozeParser.AtExamplecl: { this.state = 416; this.example(); } break; default: throw new NoViableAltException(this); } } } this.state = 421; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 36, this._ctx); } } } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); this._errHandler.recover(this, re); } else { throw re; } } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public single_gap(): Single_gapContext { let _localctx: Single_gapContext = new Single_gapContext(this._ctx, this.state); this.enterRule(_localctx, 18, clozeParser.RULE_single_gap); try { let _alt: number; this.enterOuterAlt(_localctx, 1); { this.state = 422; this.match(clozeParser.OPU); this.state = 426; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input, 37, this._ctx) ) { case 1: { this.state = 423; this.numeric(); } break; case 2: { this.state = 424; this.string(); } break; case 3: // tslint:disable-next-line:no-empty { } break; } this.state = 431; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 38, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { if (_alt === 1) { { { this.state = 428; this.s_and_w(); } } } this.state = 433; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 38, this._ctx); } this.state = 434; this.clnsp(); } } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); this._errHandler.recover(this, re); } else { throw re; } } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public cloze_and_multiple_choice_text(): Cloze_and_multiple_choice_textContext { let _localctx: Cloze_and_multiple_choice_textContext = new Cloze_and_multiple_choice_textContext(this._ctx, this.state); this.enterRule(_localctx, 20, clozeParser.RULE_cloze_and_multiple_choice_text); let _la: number; try { let _alt: number; this.enterOuterAlt(_localctx, 1); { this.state = 436; this.match(clozeParser.BitClozeandmulti); this.state = 437; this.format(); this.state = 438; this.match(clozeParser.CL); this.state = 442; this._errHandler.sync(this); _la = this._input.LA(1); while (_la === clozeParser.NL) { { { this.state = 439; this.nl(); } } this.state = 444; this._errHandler.sync(this); _la = this._input.LA(1); } this.state = 459; this._errHandler.sync(this); _alt = 1; do { switch (_alt) { case 1: { this.state = 459; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input, 42, this._ctx) ) { case 1: { this.state = 445; this.bitElem(); this.state = 449; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 40, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { if (_alt === 1) { { { this.state = 446; this.nl(); } } } this.state = 451; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 40, this._ctx); } } break; case 2: { this.state = 452; this.headed_inline_choices(); this.state = 456; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 41, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { if (_alt === 1) { { { this.state = 453; this.nl(); } } } this.state = 458; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 41, this._ctx); } } break; } } break; default: throw new NoViableAltException(this); } this.state = 461; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 43, this._ctx); } while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER); this.state = 466; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 44, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { if (_alt === 1) { { { this.state = 463; this.match(clozeParser.NL); } } } this.state = 468; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 44, this._ctx); } this.state = 482; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input, 47, this._ctx) ) { case 1: { this.state = 469; this.resource(); this.state = 479; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 46, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { if (_alt === 1) { { { this.state = 473; this._errHandler.sync(this); _la = this._input.LA(1); while (_la === clozeParser.NL) { { { this.state = 470; this.match(clozeParser.NL); } } this.state = 475; this._errHandler.sync(this); _la = this._input.LA(1); } this.state = 476; this.resource(); } } } this.state = 481; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 46, this._ctx); } } break; } } } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); this._errHandler.recover(this, re); } else { throw re; } } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public headed_inline_choices(): Headed_inline_choicesContext { let _localctx: Headed_inline_choicesContext = new Headed_inline_choicesContext(this._ctx, this.state); this.enterRule(_localctx, 22, clozeParser.RULE_headed_inline_choices); let _la: number; try { this.enterOuterAlt(_localctx, 1); { this.state = 485; this._errHandler.sync(this); _la = this._input.LA(1); if (_la === clozeParser.OPS) { { this.state = 484; this.choice_head(); } } this.state = 487; this.inline_choices(); } } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); this._errHandler.recover(this, re); } else { throw re; } } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public choice_head(): Choice_headContext { let _localctx: Choice_headContext = new Choice_headContext(this._ctx, this.state); this.enterRule(_localctx, 24, clozeParser.RULE_choice_head); try { this.enterOuterAlt(_localctx, 1); { this.state = 489; this.match(clozeParser.OPS); this.state = 490; this.s_and_w(); this.state = 491; this.match(clozeParser.CL); } } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); this._errHandler.recover(this, re); } else { throw re; } } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public inline_choices(): Inline_choicesContext { let _localctx: Inline_choicesContext = new Inline_choicesContext(this._ctx, this.state); this.enterRule(_localctx, 26, clozeParser.RULE_inline_choices); try { let _alt: number; this.enterOuterAlt(_localctx, 1); { this.state = 496; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input, 49, this._ctx) ) { case 1: { this.state = 493; this.choice_plus(); } break; case 2: { this.state = 494; this.choice_minus(); } break; case 3: { this.state = 495; this.choice_star(); } break; } this.state = 503; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 51, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { if (_alt === 1) { { this.state = 501; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input, 50, this._ctx) ) { case 1: { this.state = 498; this.choice_plus(); } break; case 2: { this.state = 499; this.choice_minus(); } break; case 3: { this.state = 500; this.choice_star(); } break; } } } this.state = 505; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 51, this._ctx); } } } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); this._errHandler.recover(this, re); } else { throw re; } } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public choice_plus(): Choice_plusContext { let _localctx: Choice_plusContext = new Choice_plusContext(this._ctx, this.state); this.enterRule(_localctx, 28, clozeParser.RULE_choice_plus); let _la: number; try { let _alt: number; this.enterOuterAlt(_localctx, 1); { this.state = 507; this._errHandler.sync(this); _la = this._input.LA(1); if (_la === clozeParser.OPC) { { this.state = 506; this.item(); } } this.state = 509; this.match(clozeParser.OPP); this.state = 511; this._errHandler.sync(this); _alt = 1; do { switch (_alt) { case 1: { { this.state = 510; this.s_a