adaptive-expressions
Version:
Common Expression Language
1,297 lines (1,266 loc) • 133 kB
text/typescript
// Generated from src/CommonRegex.g4 by ANTLR 4.7.3-SNAPSHOT
/**
* @module adaptive-expressions
*/
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
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 { CommonRegexListener } from "./CommonRegexListener";
import { CommonRegexVisitor } from "./CommonRegexVisitor";
export class CommonRegexParser extends Parser {
public static readonly Quoted = 1;
public static readonly BlockQuoted = 2;
public static readonly BellChar = 3;
public static readonly ControlChar = 4;
public static readonly EscapeChar = 5;
public static readonly FormFeed = 6;
public static readonly NewLine = 7;
public static readonly CarriageReturn = 8;
public static readonly Tab = 9;
public static readonly Backslash = 10;
public static readonly HexChar = 11;
public static readonly Dot = 12;
public static readonly DecimalDigit = 13;
public static readonly NotDecimalDigit = 14;
public static readonly CharWithProperty = 15;
public static readonly CharWithoutProperty = 16;
public static readonly WhiteSpace = 17;
public static readonly NotWhiteSpace = 18;
public static readonly WordChar = 19;
public static readonly NotWordChar = 20;
public static readonly CharacterClassStart = 21;
public static readonly CharacterClassEnd = 22;
public static readonly Caret = 23;
public static readonly Hyphen = 24;
public static readonly QuestionMark = 25;
public static readonly Plus = 26;
public static readonly Star = 27;
public static readonly OpenBrace = 28;
public static readonly CloseBrace = 29;
public static readonly Comma = 30;
public static readonly EndOfSubject = 31;
public static readonly Pipe = 32;
public static readonly OpenParen = 33;
public static readonly CloseParen = 34;
public static readonly LessThan = 35;
public static readonly GreaterThan = 36;
public static readonly SingleQuote = 37;
public static readonly Underscore = 38;
public static readonly Colon = 39;
public static readonly Hash = 40;
public static readonly Equals = 41;
public static readonly Exclamation = 42;
public static readonly Ampersand = 43;
public static readonly ALC = 44;
public static readonly BLC = 45;
public static readonly CLC = 46;
public static readonly DLC = 47;
public static readonly ELC = 48;
public static readonly FLC = 49;
public static readonly GLC = 50;
public static readonly HLC = 51;
public static readonly ILC = 52;
public static readonly JLC = 53;
public static readonly KLC = 54;
public static readonly LLC = 55;
public static readonly MLC = 56;
public static readonly NLC = 57;
public static readonly OLC = 58;
public static readonly PLC = 59;
public static readonly QLC = 60;
public static readonly RLC = 61;
public static readonly SLC = 62;
public static readonly TLC = 63;
public static readonly ULC = 64;
public static readonly VLC = 65;
public static readonly WLC = 66;
public static readonly XLC = 67;
public static readonly YLC = 68;
public static readonly ZLC = 69;
public static readonly AUC = 70;
public static readonly BUC = 71;
public static readonly CUC = 72;
public static readonly DUC = 73;
public static readonly EUC = 74;
public static readonly FUC = 75;
public static readonly GUC = 76;
public static readonly HUC = 77;
public static readonly IUC = 78;
public static readonly JUC = 79;
public static readonly KUC = 80;
public static readonly LUC = 81;
public static readonly MUC = 82;
public static readonly NUC = 83;
public static readonly OUC = 84;
public static readonly PUC = 85;
public static readonly QUC = 86;
public static readonly RUC = 87;
public static readonly SUC = 88;
public static readonly TUC = 89;
public static readonly UUC = 90;
public static readonly VUC = 91;
public static readonly WUC = 92;
public static readonly XUC = 93;
public static readonly YUC = 94;
public static readonly ZUC = 95;
public static readonly D1 = 96;
public static readonly D2 = 97;
public static readonly D3 = 98;
public static readonly D4 = 99;
public static readonly D5 = 100;
public static readonly D6 = 101;
public static readonly D7 = 102;
public static readonly D8 = 103;
public static readonly D9 = 104;
public static readonly D0 = 105;
public static readonly OtherChar = 106;
public static readonly RULE_parse = 0;
public static readonly RULE_alternation = 1;
public static readonly RULE_expr = 2;
public static readonly RULE_element = 3;
public static readonly RULE_quantifier = 4;
public static readonly RULE_quantifier_type = 5;
public static readonly RULE_character_class = 6;
public static readonly RULE_capture = 7;
public static readonly RULE_non_capture = 8;
public static readonly RULE_option = 9;
public static readonly RULE_option_flag = 10;
public static readonly RULE_atom = 11;
public static readonly RULE_cc_atom = 12;
public static readonly RULE_shared_atom = 13;
public static readonly RULE_literal = 14;
public static readonly RULE_cc_literal = 15;
public static readonly RULE_shared_literal = 16;
public static readonly RULE_number = 17;
public static readonly RULE_octal_char = 18;
public static readonly RULE_octal_digit = 19;
public static readonly RULE_digits = 20;
public static readonly RULE_digit = 21;
public static readonly RULE_name = 22;
public static readonly RULE_alpha_nums = 23;
public static readonly RULE_non_close_parens = 24;
public static readonly RULE_non_close_paren = 25;
public static readonly RULE_letter = 26;
// tslint:disable:no-trailing-whitespace
public static readonly ruleNames: string[] = [
"parse", "alternation", "expr", "element", "quantifier", "quantifier_type",
"character_class", "capture", "non_capture", "option", "option_flag",
"atom", "cc_atom", "shared_atom", "literal", "cc_literal", "shared_literal",
"number", "octal_char", "octal_digit", "digits", "digit", "name", "alpha_nums",
"non_close_parens", "non_close_paren", "letter",
];
private static readonly _LITERAL_NAMES: Array<string | undefined> = [
undefined, undefined, undefined, "'\\'", "'\\'", "'\\'", "'\\'", "'\\'",
"'\\'", "'\\'", "'\\'", undefined, "'.'", "'\\'", "'\\'", undefined, undefined,
"'\\'", "'\\'", "'\\'", "'\\'", "'['", "']'", "'^'", "'-'", "'?'", "'+'",
"'*'", "'{'", "'}'", "','", "'$'", "'|'", "'('", "')'", "'<'", "'>'",
"'''", "'_'", "':'", "'#'", "'='", "'!'", "'&'", "'a'", "'b'", "'c'",
"'d'", "'e'", "'f'", "'g'", "'h'", "'i'", "'j'", "'k'", "'l'", "'m'",
"'n'", "'o'", "'p'", "'q'", "'r'", "'s'", "'t'", "'u'", "'v'", "'w'",
"'x'", "'y'", "'z'", "'A'", "'B'", "'C'", "'D'", "'E'", "'F'", "'G'",
"'H'", "'I'", "'J'", "'K'", "'L'", "'M'", "'N'", "'O'", "'P'", "'Q'",
"'R'", "'S'", "'T'", "'U'", "'V'", "'W'", "'X'", "'Y'", "'Z'", "'1'",
"'2'", "'3'", "'4'", "'5'", "'6'", "'7'", "'8'", "'9'", "'0'",
];
private static readonly _SYMBOLIC_NAMES: Array<string | undefined> = [
undefined, "Quoted", "BlockQuoted", "BellChar", "ControlChar", "EscapeChar",
"FormFeed", "NewLine", "CarriageReturn", "Tab", "Backslash", "HexChar",
"Dot", "DecimalDigit", "NotDecimalDigit", "CharWithProperty", "CharWithoutProperty",
"WhiteSpace", "NotWhiteSpace", "WordChar", "NotWordChar", "CharacterClassStart",
"CharacterClassEnd", "Caret", "Hyphen", "QuestionMark", "Plus", "Star",
"OpenBrace", "CloseBrace", "Comma", "EndOfSubject", "Pipe", "OpenParen",
"CloseParen", "LessThan", "GreaterThan", "SingleQuote", "Underscore",
"Colon", "Hash", "Equals", "Exclamation", "Ampersand", "ALC", "BLC", "CLC",
"DLC", "ELC", "FLC", "GLC", "HLC", "ILC", "JLC", "KLC", "LLC", "MLC",
"NLC", "OLC", "PLC", "QLC", "RLC", "SLC", "TLC", "ULC", "VLC", "WLC",
"XLC", "YLC", "ZLC", "AUC", "BUC", "CUC", "DUC", "EUC", "FUC", "GUC",
"HUC", "IUC", "JUC", "KUC", "LUC", "MUC", "NUC", "OUC", "PUC", "QUC",
"RUC", "SUC", "TUC", "UUC", "VUC", "WUC", "XUC", "YUC", "ZUC", "D1", "D2",
"D3", "D4", "D5", "D6", "D7", "D8", "D9", "D0", "OtherChar",
];
public static readonly VOCABULARY: Vocabulary = new VocabularyImpl(CommonRegexParser._LITERAL_NAMES, CommonRegexParser._SYMBOLIC_NAMES, []);
// @Override
// @NotNull
public get vocabulary(): Vocabulary {
return CommonRegexParser.VOCABULARY;
}
// tslint:enable:no-trailing-whitespace
// @Override
public get grammarFileName(): string { return "CommonRegex.g4"; }
// @Override
public get ruleNames(): string[] { return CommonRegexParser.ruleNames; }
// @Override
public get serializedATN(): string { return CommonRegexParser._serializedATN; }
constructor(input: TokenStream) {
super(input);
this._interp = new ParserATNSimulator(CommonRegexParser._ATN, this);
}
// @RuleVersion(0)
public parse(): ParseContext {
let _localctx: ParseContext = new ParseContext(this._ctx, this.state);
this.enterRule(_localctx, 0, CommonRegexParser.RULE_parse);
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 54;
this.alternation();
this.state = 55;
this.match(CommonRegexParser.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 alternation(): AlternationContext {
let _localctx: AlternationContext = new AlternationContext(this._ctx, this.state);
this.enterRule(_localctx, 2, CommonRegexParser.RULE_alternation);
let _la: number;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 57;
this.expr();
this.state = 62;
this._errHandler.sync(this);
_la = this._input.LA(1);
while (_la === CommonRegexParser.Pipe) {
{
{
this.state = 58;
this.match(CommonRegexParser.Pipe);
this.state = 59;
this.expr();
}
}
this.state = 64;
this._errHandler.sync(this);
_la = this._input.LA(1);
}
}
}
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 expr(): ExprContext {
let _localctx: ExprContext = new ExprContext(this._ctx, this.state);
this.enterRule(_localctx, 4, CommonRegexParser.RULE_expr);
let _la: number;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 68;
this._errHandler.sync(this);
_la = this._input.LA(1);
while ((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << CommonRegexParser.Quoted) | (1 << CommonRegexParser.BlockQuoted) | (1 << CommonRegexParser.BellChar) | (1 << CommonRegexParser.ControlChar) | (1 << CommonRegexParser.EscapeChar) | (1 << CommonRegexParser.FormFeed) | (1 << CommonRegexParser.NewLine) | (1 << CommonRegexParser.CarriageReturn) | (1 << CommonRegexParser.Tab) | (1 << CommonRegexParser.Backslash) | (1 << CommonRegexParser.HexChar) | (1 << CommonRegexParser.Dot) | (1 << CommonRegexParser.DecimalDigit) | (1 << CommonRegexParser.NotDecimalDigit) | (1 << CommonRegexParser.CharWithProperty) | (1 << CommonRegexParser.CharWithoutProperty) | (1 << CommonRegexParser.WhiteSpace) | (1 << CommonRegexParser.NotWhiteSpace) | (1 << CommonRegexParser.WordChar) | (1 << CommonRegexParser.NotWordChar) | (1 << CommonRegexParser.CharacterClassStart) | (1 << CommonRegexParser.CharacterClassEnd) | (1 << CommonRegexParser.Caret) | (1 << CommonRegexParser.Hyphen) | (1 << CommonRegexParser.OpenBrace) | (1 << CommonRegexParser.CloseBrace) | (1 << CommonRegexParser.Comma) | (1 << CommonRegexParser.EndOfSubject))) !== 0) || ((((_la - 33)) & ~0x1F) === 0 && ((1 << (_la - 33)) & ((1 << (CommonRegexParser.OpenParen - 33)) | (1 << (CommonRegexParser.LessThan - 33)) | (1 << (CommonRegexParser.GreaterThan - 33)) | (1 << (CommonRegexParser.SingleQuote - 33)) | (1 << (CommonRegexParser.Underscore - 33)) | (1 << (CommonRegexParser.Colon - 33)) | (1 << (CommonRegexParser.Hash - 33)) | (1 << (CommonRegexParser.Equals - 33)) | (1 << (CommonRegexParser.Exclamation - 33)) | (1 << (CommonRegexParser.Ampersand - 33)) | (1 << (CommonRegexParser.ALC - 33)) | (1 << (CommonRegexParser.BLC - 33)) | (1 << (CommonRegexParser.CLC - 33)) | (1 << (CommonRegexParser.DLC - 33)) | (1 << (CommonRegexParser.ELC - 33)) | (1 << (CommonRegexParser.FLC - 33)) | (1 << (CommonRegexParser.GLC - 33)) | (1 << (CommonRegexParser.HLC - 33)) | (1 << (CommonRegexParser.ILC - 33)) | (1 << (CommonRegexParser.JLC - 33)) | (1 << (CommonRegexParser.KLC - 33)) | (1 << (CommonRegexParser.LLC - 33)) | (1 << (CommonRegexParser.MLC - 33)) | (1 << (CommonRegexParser.NLC - 33)) | (1 << (CommonRegexParser.OLC - 33)) | (1 << (CommonRegexParser.PLC - 33)) | (1 << (CommonRegexParser.QLC - 33)) | (1 << (CommonRegexParser.RLC - 33)) | (1 << (CommonRegexParser.SLC - 33)) | (1 << (CommonRegexParser.TLC - 33)) | (1 << (CommonRegexParser.ULC - 33)))) !== 0) || ((((_la - 65)) & ~0x1F) === 0 && ((1 << (_la - 65)) & ((1 << (CommonRegexParser.VLC - 65)) | (1 << (CommonRegexParser.WLC - 65)) | (1 << (CommonRegexParser.XLC - 65)) | (1 << (CommonRegexParser.YLC - 65)) | (1 << (CommonRegexParser.ZLC - 65)) | (1 << (CommonRegexParser.AUC - 65)) | (1 << (CommonRegexParser.BUC - 65)) | (1 << (CommonRegexParser.CUC - 65)) | (1 << (CommonRegexParser.DUC - 65)) | (1 << (CommonRegexParser.EUC - 65)) | (1 << (CommonRegexParser.FUC - 65)) | (1 << (CommonRegexParser.GUC - 65)) | (1 << (CommonRegexParser.HUC - 65)) | (1 << (CommonRegexParser.IUC - 65)) | (1 << (CommonRegexParser.JUC - 65)) | (1 << (CommonRegexParser.KUC - 65)) | (1 << (CommonRegexParser.LUC - 65)) | (1 << (CommonRegexParser.MUC - 65)) | (1 << (CommonRegexParser.NUC - 65)) | (1 << (CommonRegexParser.OUC - 65)) | (1 << (CommonRegexParser.PUC - 65)) | (1 << (CommonRegexParser.QUC - 65)) | (1 << (CommonRegexParser.RUC - 65)) | (1 << (CommonRegexParser.SUC - 65)) | (1 << (CommonRegexParser.TUC - 65)) | (1 << (CommonRegexParser.UUC - 65)) | (1 << (CommonRegexParser.VUC - 65)) | (1 << (CommonRegexParser.WUC - 65)) | (1 << (CommonRegexParser.XUC - 65)) | (1 << (CommonRegexParser.YUC - 65)) | (1 << (CommonRegexParser.ZUC - 65)) | (1 << (CommonRegexParser.D1 - 65)))) !== 0) || ((((_la - 97)) & ~0x1F) === 0 && ((1 << (_la - 97)) & ((1 << (CommonRegexParser.D2 - 97)) | (1 << (CommonRegexParser.D3 - 97)) | (1 << (CommonRegexParser.D4 - 97)) | (1 << (CommonRegexParser.D5 - 97)) | (1 << (CommonRegexParser.D6 - 97)) | (1 << (CommonRegexParser.D7 - 97)) | (1 << (CommonRegexParser.D8 - 97)) | (1 << (CommonRegexParser.D9 - 97)) | (1 << (CommonRegexParser.D0 - 97)) | (1 << (CommonRegexParser.OtherChar - 97)))) !== 0)) {
{
{
this.state = 65;
this.element();
}
}
this.state = 70;
this._errHandler.sync(this);
_la = this._input.LA(1);
}
}
}
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 element(): ElementContext {
let _localctx: ElementContext = new ElementContext(this._ctx, this.state);
this.enterRule(_localctx, 6, CommonRegexParser.RULE_element);
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 71;
this.atom();
this.state = 73;
this._errHandler.sync(this);
switch ( this.interpreter.adaptivePredict(this._input, 2, this._ctx) ) {
case 1:
{
this.state = 72;
this.quantifier();
}
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 quantifier(): QuantifierContext {
let _localctx: QuantifierContext = new QuantifierContext(this._ctx, this.state);
this.enterRule(_localctx, 8, CommonRegexParser.RULE_quantifier);
try {
this.state = 99;
this._errHandler.sync(this);
switch ( this.interpreter.adaptivePredict(this._input, 3, this._ctx) ) {
case 1:
this.enterOuterAlt(_localctx, 1);
{
this.state = 75;
this.match(CommonRegexParser.QuestionMark);
this.state = 76;
this.quantifier_type();
}
break;
case 2:
this.enterOuterAlt(_localctx, 2);
{
this.state = 77;
this.match(CommonRegexParser.Plus);
this.state = 78;
this.quantifier_type();
}
break;
case 3:
this.enterOuterAlt(_localctx, 3);
{
this.state = 79;
this.match(CommonRegexParser.Star);
this.state = 80;
this.quantifier_type();
}
break;
case 4:
this.enterOuterAlt(_localctx, 4);
{
this.state = 81;
this.match(CommonRegexParser.OpenBrace);
this.state = 82;
this.number();
this.state = 83;
this.match(CommonRegexParser.CloseBrace);
this.state = 84;
this.quantifier_type();
}
break;
case 5:
this.enterOuterAlt(_localctx, 5);
{
this.state = 86;
this.match(CommonRegexParser.OpenBrace);
this.state = 87;
this.number();
this.state = 88;
this.match(CommonRegexParser.Comma);
this.state = 89;
this.match(CommonRegexParser.CloseBrace);
this.state = 90;
this.quantifier_type();
}
break;
case 6:
this.enterOuterAlt(_localctx, 6);
{
this.state = 92;
this.match(CommonRegexParser.OpenBrace);
this.state = 93;
this.number();
this.state = 94;
this.match(CommonRegexParser.Comma);
this.state = 95;
this.number();
this.state = 96;
this.match(CommonRegexParser.CloseBrace);
this.state = 97;
this.quantifier_type();
}
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 quantifier_type(): Quantifier_typeContext {
let _localctx: Quantifier_typeContext = new Quantifier_typeContext(this._ctx, this.state);
this.enterRule(_localctx, 10, CommonRegexParser.RULE_quantifier_type);
try {
this.state = 104;
this._errHandler.sync(this);
switch (this._input.LA(1)) {
case CommonRegexParser.Plus:
this.enterOuterAlt(_localctx, 1);
{
this.state = 101;
this.match(CommonRegexParser.Plus);
}
break;
case CommonRegexParser.QuestionMark:
this.enterOuterAlt(_localctx, 2);
{
this.state = 102;
this.match(CommonRegexParser.QuestionMark);
}
break;
case CommonRegexParser.EOF:
case CommonRegexParser.Quoted:
case CommonRegexParser.BlockQuoted:
case CommonRegexParser.BellChar:
case CommonRegexParser.ControlChar:
case CommonRegexParser.EscapeChar:
case CommonRegexParser.FormFeed:
case CommonRegexParser.NewLine:
case CommonRegexParser.CarriageReturn:
case CommonRegexParser.Tab:
case CommonRegexParser.Backslash:
case CommonRegexParser.HexChar:
case CommonRegexParser.Dot:
case CommonRegexParser.DecimalDigit:
case CommonRegexParser.NotDecimalDigit:
case CommonRegexParser.CharWithProperty:
case CommonRegexParser.CharWithoutProperty:
case CommonRegexParser.WhiteSpace:
case CommonRegexParser.NotWhiteSpace:
case CommonRegexParser.WordChar:
case CommonRegexParser.NotWordChar:
case CommonRegexParser.CharacterClassStart:
case CommonRegexParser.CharacterClassEnd:
case CommonRegexParser.Caret:
case CommonRegexParser.Hyphen:
case CommonRegexParser.OpenBrace:
case CommonRegexParser.CloseBrace:
case CommonRegexParser.Comma:
case CommonRegexParser.EndOfSubject:
case CommonRegexParser.Pipe:
case CommonRegexParser.OpenParen:
case CommonRegexParser.CloseParen:
case CommonRegexParser.LessThan:
case CommonRegexParser.GreaterThan:
case CommonRegexParser.SingleQuote:
case CommonRegexParser.Underscore:
case CommonRegexParser.Colon:
case CommonRegexParser.Hash:
case CommonRegexParser.Equals:
case CommonRegexParser.Exclamation:
case CommonRegexParser.Ampersand:
case CommonRegexParser.ALC:
case CommonRegexParser.BLC:
case CommonRegexParser.CLC:
case CommonRegexParser.DLC:
case CommonRegexParser.ELC:
case CommonRegexParser.FLC:
case CommonRegexParser.GLC:
case CommonRegexParser.HLC:
case CommonRegexParser.ILC:
case CommonRegexParser.JLC:
case CommonRegexParser.KLC:
case CommonRegexParser.LLC:
case CommonRegexParser.MLC:
case CommonRegexParser.NLC:
case CommonRegexParser.OLC:
case CommonRegexParser.PLC:
case CommonRegexParser.QLC:
case CommonRegexParser.RLC:
case CommonRegexParser.SLC:
case CommonRegexParser.TLC:
case CommonRegexParser.ULC:
case CommonRegexParser.VLC:
case CommonRegexParser.WLC:
case CommonRegexParser.XLC:
case CommonRegexParser.YLC:
case CommonRegexParser.ZLC:
case CommonRegexParser.AUC:
case CommonRegexParser.BUC:
case CommonRegexParser.CUC:
case CommonRegexParser.DUC:
case CommonRegexParser.EUC:
case CommonRegexParser.FUC:
case CommonRegexParser.GUC:
case CommonRegexParser.HUC:
case CommonRegexParser.IUC:
case CommonRegexParser.JUC:
case CommonRegexParser.KUC:
case CommonRegexParser.LUC:
case CommonRegexParser.MUC:
case CommonRegexParser.NUC:
case CommonRegexParser.OUC:
case CommonRegexParser.PUC:
case CommonRegexParser.QUC:
case CommonRegexParser.RUC:
case CommonRegexParser.SUC:
case CommonRegexParser.TUC:
case CommonRegexParser.UUC:
case CommonRegexParser.VUC:
case CommonRegexParser.WUC:
case CommonRegexParser.XUC:
case CommonRegexParser.YUC:
case CommonRegexParser.ZUC:
case CommonRegexParser.D1:
case CommonRegexParser.D2:
case CommonRegexParser.D3:
case CommonRegexParser.D4:
case CommonRegexParser.D5:
case CommonRegexParser.D6:
case CommonRegexParser.D7:
case CommonRegexParser.D8:
case CommonRegexParser.D9:
case CommonRegexParser.D0:
case CommonRegexParser.OtherChar:
this.enterOuterAlt(_localctx, 3);
// tslint:disable-next-line:no-empty
{
}
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 character_class(): Character_classContext {
let _localctx: Character_classContext = new Character_classContext(this._ctx, this.state);
this.enterRule(_localctx, 12, CommonRegexParser.RULE_character_class);
let _la: number;
try {
this.state = 123;
this._errHandler.sync(this);
switch ( this.interpreter.adaptivePredict(this._input, 7, this._ctx) ) {
case 1:
this.enterOuterAlt(_localctx, 1);
{
this.state = 106;
this.match(CommonRegexParser.CharacterClassStart);
this.state = 107;
this.match(CommonRegexParser.Caret);
this.state = 109;
this._errHandler.sync(this);
_la = this._input.LA(1);
do {
{
{
this.state = 108;
this.cc_atom();
}
}
this.state = 111;
this._errHandler.sync(this);
_la = this._input.LA(1);
} while ((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << CommonRegexParser.Quoted) | (1 << CommonRegexParser.BlockQuoted) | (1 << CommonRegexParser.BellChar) | (1 << CommonRegexParser.ControlChar) | (1 << CommonRegexParser.EscapeChar) | (1 << CommonRegexParser.FormFeed) | (1 << CommonRegexParser.NewLine) | (1 << CommonRegexParser.CarriageReturn) | (1 << CommonRegexParser.Tab) | (1 << CommonRegexParser.Backslash) | (1 << CommonRegexParser.HexChar) | (1 << CommonRegexParser.Dot) | (1 << CommonRegexParser.DecimalDigit) | (1 << CommonRegexParser.NotDecimalDigit) | (1 << CommonRegexParser.CharWithProperty) | (1 << CommonRegexParser.CharWithoutProperty) | (1 << CommonRegexParser.WhiteSpace) | (1 << CommonRegexParser.NotWhiteSpace) | (1 << CommonRegexParser.WordChar) | (1 << CommonRegexParser.NotWordChar) | (1 << CommonRegexParser.CharacterClassStart) | (1 << CommonRegexParser.Caret) | (1 << CommonRegexParser.Hyphen) | (1 << CommonRegexParser.QuestionMark) | (1 << CommonRegexParser.Plus) | (1 << CommonRegexParser.Star) | (1 << CommonRegexParser.OpenBrace) | (1 << CommonRegexParser.CloseBrace) | (1 << CommonRegexParser.Comma) | (1 << CommonRegexParser.EndOfSubject))) !== 0) || ((((_la - 32)) & ~0x1F) === 0 && ((1 << (_la - 32)) & ((1 << (CommonRegexParser.Pipe - 32)) | (1 << (CommonRegexParser.OpenParen - 32)) | (1 << (CommonRegexParser.CloseParen - 32)) | (1 << (CommonRegexParser.LessThan - 32)) | (1 << (CommonRegexParser.GreaterThan - 32)) | (1 << (CommonRegexParser.SingleQuote - 32)) | (1 << (CommonRegexParser.Underscore - 32)) | (1 << (CommonRegexParser.Colon - 32)) | (1 << (CommonRegexParser.Hash - 32)) | (1 << (CommonRegexParser.Equals - 32)) | (1 << (CommonRegexParser.Exclamation - 32)) | (1 << (CommonRegexParser.Ampersand - 32)) | (1 << (CommonRegexParser.ALC - 32)) | (1 << (CommonRegexParser.BLC - 32)) | (1 << (CommonRegexParser.CLC - 32)) | (1 << (CommonRegexParser.DLC - 32)) | (1 << (CommonRegexParser.ELC - 32)) | (1 << (CommonRegexParser.FLC - 32)) | (1 << (CommonRegexParser.GLC - 32)) | (1 << (CommonRegexParser.HLC - 32)) | (1 << (CommonRegexParser.ILC - 32)) | (1 << (CommonRegexParser.JLC - 32)) | (1 << (CommonRegexParser.KLC - 32)) | (1 << (CommonRegexParser.LLC - 32)) | (1 << (CommonRegexParser.MLC - 32)) | (1 << (CommonRegexParser.NLC - 32)) | (1 << (CommonRegexParser.OLC - 32)) | (1 << (CommonRegexParser.PLC - 32)) | (1 << (CommonRegexParser.QLC - 32)) | (1 << (CommonRegexParser.RLC - 32)) | (1 << (CommonRegexParser.SLC - 32)) | (1 << (CommonRegexParser.TLC - 32)))) !== 0) || ((((_la - 64)) & ~0x1F) === 0 && ((1 << (_la - 64)) & ((1 << (CommonRegexParser.ULC - 64)) | (1 << (CommonRegexParser.VLC - 64)) | (1 << (CommonRegexParser.WLC - 64)) | (1 << (CommonRegexParser.XLC - 64)) | (1 << (CommonRegexParser.YLC - 64)) | (1 << (CommonRegexParser.ZLC - 64)) | (1 << (CommonRegexParser.AUC - 64)) | (1 << (CommonRegexParser.BUC - 64)) | (1 << (CommonRegexParser.CUC - 64)) | (1 << (CommonRegexParser.DUC - 64)) | (1 << (CommonRegexParser.EUC - 64)) | (1 << (CommonRegexParser.FUC - 64)) | (1 << (CommonRegexParser.GUC - 64)) | (1 << (CommonRegexParser.HUC - 64)) | (1 << (CommonRegexParser.IUC - 64)) | (1 << (CommonRegexParser.JUC - 64)) | (1 << (CommonRegexParser.KUC - 64)) | (1 << (CommonRegexParser.LUC - 64)) | (1 << (CommonRegexParser.MUC - 64)) | (1 << (CommonRegexParser.NUC - 64)) | (1 << (CommonRegexParser.OUC - 64)) | (1 << (CommonRegexParser.PUC - 64)) | (1 << (CommonRegexParser.QUC - 64)) | (1 << (CommonRegexParser.RUC - 64)) | (1 << (CommonRegexParser.SUC - 64)) | (1 << (CommonRegexParser.TUC - 64)) | (1 << (CommonRegexParser.UUC - 64)) | (1 << (CommonRegexParser.VUC - 64)) | (1 << (CommonRegexParser.WUC - 64)) | (1 << (CommonRegexParser.XUC - 64)) | (1 << (CommonRegexParser.YUC - 64)) | (1 << (CommonRegexParser.ZUC - 64)))) !== 0) || ((((_la - 96)) & ~0x1F) === 0 && ((1 << (_la - 96)) & ((1 << (CommonRegexParser.D1 - 96)) | (1 << (CommonRegexParser.D2 - 96)) | (1 << (CommonRegexParser.D3 - 96)) | (1 << (CommonRegexParser.D4 - 96)) | (1 << (CommonRegexParser.D5 - 96)) | (1 << (CommonRegexParser.D6 - 96)) | (1 << (CommonRegexParser.D7 - 96)) | (1 << (CommonRegexParser.D8 - 96)) | (1 << (CommonRegexParser.D9 - 96)) | (1 << (CommonRegexParser.D0 - 96)) | (1 << (CommonRegexParser.OtherChar - 96)))) !== 0));
this.state = 113;
this.match(CommonRegexParser.CharacterClassEnd);
}
break;
case 2:
this.enterOuterAlt(_localctx, 2);
{
this.state = 115;
this.match(CommonRegexParser.CharacterClassStart);
this.state = 117;
this._errHandler.sync(this);
_la = this._input.LA(1);
do {
{
{
this.state = 116;
this.cc_atom();
}
}
this.state = 119;
this._errHandler.sync(this);
_la = this._input.LA(1);
} while ((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << CommonRegexParser.Quoted) | (1 << CommonRegexParser.BlockQuoted) | (1 << CommonRegexParser.BellChar) | (1 << CommonRegexParser.ControlChar) | (1 << CommonRegexParser.EscapeChar) | (1 << CommonRegexParser.FormFeed) | (1 << CommonRegexParser.NewLine) | (1 << CommonRegexParser.CarriageReturn) | (1 << CommonRegexParser.Tab) | (1 << CommonRegexParser.Backslash) | (1 << CommonRegexParser.HexChar) | (1 << CommonRegexParser.Dot) | (1 << CommonRegexParser.DecimalDigit) | (1 << CommonRegexParser.NotDecimalDigit) | (1 << CommonRegexParser.CharWithProperty) | (1 << CommonRegexParser.CharWithoutProperty) | (1 << CommonRegexParser.WhiteSpace) | (1 << CommonRegexParser.NotWhiteSpace) | (1 << CommonRegexParser.WordChar) | (1 << CommonRegexParser.NotWordChar) | (1 << CommonRegexParser.CharacterClassStart) | (1 << CommonRegexParser.Caret) | (1 << CommonRegexParser.Hyphen) | (1 << CommonRegexParser.QuestionMark) | (1 << CommonRegexParser.Plus) | (1 << CommonRegexParser.Star) | (1 << CommonRegexParser.OpenBrace) | (1 << CommonRegexParser.CloseBrace) | (1 << CommonRegexParser.Comma) | (1 << CommonRegexParser.EndOfSubject))) !== 0) || ((((_la - 32)) & ~0x1F) === 0 && ((1 << (_la - 32)) & ((1 << (CommonRegexParser.Pipe - 32)) | (1 << (CommonRegexParser.OpenParen - 32)) | (1 << (CommonRegexParser.CloseParen - 32)) | (1 << (CommonRegexParser.LessThan - 32)) | (1 << (CommonRegexParser.GreaterThan - 32)) | (1 << (CommonRegexParser.SingleQuote - 32)) | (1 << (CommonRegexParser.Underscore - 32)) | (1 << (CommonRegexParser.Colon - 32)) | (1 << (CommonRegexParser.Hash - 32)) | (1 << (CommonRegexParser.Equals - 32)) | (1 << (CommonRegexParser.Exclamation - 32)) | (1 << (CommonRegexParser.Ampersand - 32)) | (1 << (CommonRegexParser.ALC - 32)) | (1 << (CommonRegexParser.BLC - 32)) | (1 << (CommonRegexParser.CLC - 32)) | (1 << (CommonRegexParser.DLC - 32)) | (1 << (CommonRegexParser.ELC - 32)) | (1 << (CommonRegexParser.FLC - 32)) | (1 << (CommonRegexParser.GLC - 32)) | (1 << (CommonRegexParser.HLC - 32)) | (1 << (CommonRegexParser.ILC - 32)) | (1 << (CommonRegexParser.JLC - 32)) | (1 << (CommonRegexParser.KLC - 32)) | (1 << (CommonRegexParser.LLC - 32)) | (1 << (CommonRegexParser.MLC - 32)) | (1 << (CommonRegexParser.NLC - 32)) | (1 << (CommonRegexParser.OLC - 32)) | (1 << (CommonRegexParser.PLC - 32)) | (1 << (CommonRegexParser.QLC - 32)) | (1 << (CommonRegexParser.RLC - 32)) | (1 << (CommonRegexParser.SLC - 32)) | (1 << (CommonRegexParser.TLC - 32)))) !== 0) || ((((_la - 64)) & ~0x1F) === 0 && ((1 << (_la - 64)) & ((1 << (CommonRegexParser.ULC - 64)) | (1 << (CommonRegexParser.VLC - 64)) | (1 << (CommonRegexParser.WLC - 64)) | (1 << (CommonRegexParser.XLC - 64)) | (1 << (CommonRegexParser.YLC - 64)) | (1 << (CommonRegexParser.ZLC - 64)) | (1 << (CommonRegexParser.AUC - 64)) | (1 << (CommonRegexParser.BUC - 64)) | (1 << (CommonRegexParser.CUC - 64)) | (1 << (CommonRegexParser.DUC - 64)) | (1 << (CommonRegexParser.EUC - 64)) | (1 << (CommonRegexParser.FUC - 64)) | (1 << (CommonRegexParser.GUC - 64)) | (1 << (CommonRegexParser.HUC - 64)) | (1 << (CommonRegexParser.IUC - 64)) | (1 << (CommonRegexParser.JUC - 64)) | (1 << (CommonRegexParser.KUC - 64)) | (1 << (CommonRegexParser.LUC - 64)) | (1 << (CommonRegexParser.MUC - 64)) | (1 << (CommonRegexParser.NUC - 64)) | (1 << (CommonRegexParser.OUC - 64)) | (1 << (CommonRegexParser.PUC - 64)) | (1 << (CommonRegexParser.QUC - 64)) | (1 << (CommonRegexParser.RUC - 64)) | (1 << (CommonRegexParser.SUC - 64)) | (1 << (CommonRegexParser.TUC - 64)) | (1 << (CommonRegexParser.UUC - 64)) | (1 << (CommonRegexParser.VUC - 64)) | (1 << (CommonRegexParser.WUC - 64)) | (1 << (CommonRegexParser.XUC - 64)) | (1 << (CommonRegexParser.YUC - 64)) | (1 << (CommonRegexParser.ZUC - 64)))) !== 0) || ((((_la - 96)) & ~0x1F) === 0 && ((1 << (_la - 96)) & ((1 << (CommonRegexParser.D1 - 96)) | (1 << (CommonRegexParser.D2 - 96)) | (1 << (CommonRegexParser.D3 - 96)) | (1 << (CommonRegexParser.D4 - 96)) | (1 << (CommonRegexParser.D5 - 96)) | (1 << (CommonRegexParser.D6 - 96)) | (1 << (CommonRegexParser.D7 - 96)) | (1 << (CommonRegexParser.D8 - 96)) | (1 << (CommonRegexParser.D9 - 96)) | (1 << (CommonRegexParser.D0 - 96)) | (1 << (CommonRegexParser.OtherChar - 96)))) !== 0));
this.state = 121;
this.match(CommonRegexParser.CharacterClassEnd);
}
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 capture(): CaptureContext {
let _localctx: CaptureContext = new CaptureContext(this._ctx, this.state);
this.enterRule(_localctx, 14, CommonRegexParser.RULE_capture);
try {
this.state = 137;
this._errHandler.sync(this);
switch ( this.interpreter.adaptivePredict(this._input, 8, this._ctx) ) {
case 1:
this.enterOuterAlt(_localctx, 1);
{
this.state = 125;
this.match(CommonRegexParser.OpenParen);
this.state = 126;
this.match(CommonRegexParser.QuestionMark);
this.state = 127;
this.match(CommonRegexParser.LessThan);
this.state = 128;
this.name();
this.state = 129;
this.match(CommonRegexParser.GreaterThan);
this.state = 130;
this.alternation();
this.state = 131;
this.match(CommonRegexParser.CloseParen);
}
break;
case 2:
this.enterOuterAlt(_localctx, 2);
{
this.state = 133;
this.match(CommonRegexParser.OpenParen);
this.state = 134;
this.alternation();
this.state = 135;
this.match(CommonRegexParser.CloseParen);
}
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 non_capture(): Non_captureContext {
let _localctx: Non_captureContext = new Non_captureContext(this._ctx, this.state);
this.enterRule(_localctx, 16, CommonRegexParser.RULE_non_capture);
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 139;
this.match(CommonRegexParser.OpenParen);
this.state = 140;
this.match(CommonRegexParser.QuestionMark);
this.state = 141;
this.match(CommonRegexParser.Colon);
this.state = 142;
this.alternation();
this.state = 143;
this.match(CommonRegexParser.CloseParen);
}
}
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 option(): OptionContext {
let _localctx: OptionContext = new OptionContext(this._ctx, this.state);
this.enterRule(_localctx, 18, CommonRegexParser.RULE_option);
let _la: number;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 145;
this.match(CommonRegexParser.OpenParen);
this.state = 146;
this.match(CommonRegexParser.QuestionMark);
this.state = 148;
this._errHandler.sync(this);
_la = this._input.LA(1);
do {
{
{
this.state = 147;
this.option_flag();
}
}
this.state = 150;
this._errHandler.sync(this);
_la = this._input.LA(1);
} while (((((_la - 52)) & ~0x1F) === 0 && ((1 << (_la - 52)) & ((1 << (CommonRegexParser.ILC - 52)) | (1 << (CommonRegexParser.MLC - 52)) | (1 << (CommonRegexParser.SLC - 52)))) !== 0));
this.state = 152;
this.match(CommonRegexParser.CloseParen);
}
}
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 option_flag(): Option_flagContext {
let _localctx: Option_flagContext = new Option_flagContext(this._ctx, this.state);
this.enterRule(_localctx, 20, CommonRegexParser.RULE_option_flag);
let _la: number;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 154;
_la = this._input.LA(1);
if (!(((((_la - 52)) & ~0x1F) === 0 && ((1 << (_la - 52)) & ((1 << (CommonRegexParser.ILC - 52)) | (1 << (CommonRegexParser.MLC - 52)) | (1 << (CommonRegexParser.SLC - 52)))) !== 0))) {
this._errHandler.recoverInline(this);
} else {
if (this._input.LA(1) === Token.EOF) {
this.matchedEOF = true;
}
this._errHandler.reportMatch(this);
this.consume();
}
}
}
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 atom(): AtomContext {
let _localctx: AtomContext = new AtomContext(this._ctx, this.state);
this.enterRule(_localctx, 22, CommonRegexParser.RULE_atom);
try {
this.state = 165;
this._errHandler.sync(this);
switch ( this.interpreter.adaptivePredict(this._input, 10, this._ctx) ) {
case 1:
this.enterOuterAlt(_localctx, 1);
{
this.state = 156;
this.shared_atom();
}
break;
case 2:
this.enterOuterAlt(_localctx, 2);
{
this.state = 157;
this.literal();
}
break;
case 3:
this.enterOuterAlt(_localctx, 3);
{
this.state = 158;
this.character_class();
}
break;
case 4:
this.enterOuterAlt(_localctx, 4);
{
this.state = 159;
this.capture();
}
break;
case 5:
this.enterOuterAlt(_localctx, 5);
{
this.state = 160;
this.non_capture();
}
break;
case 6:
this.enterOuterAlt(_localctx, 6);
{
this.state = 161;
this.option();
}
break;
case 7:
this.enterOuterAlt(_localctx, 7);
{
this.state = 162;
this.match(CommonRegexParser.Dot);
}
break;
case 8:
this.enterOuterAlt(_localctx, 8);
{
this.state = 163;
this.match(CommonRegexParser.Caret);
}
break;
case 9:
this.enterOuterAlt(_localctx, 9);
{
this.state = 164;
this.match(CommonRegexParser.EndOfSubject);
}
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 cc_atom(): Cc_atomContext {
let _localctx: Cc_atomContext = new Cc_atomContext(this._ctx, this.state);
this.enterRule(_localctx, 24, CommonRegexParser.RULE_cc_atom);
try {
this.state = 173;
this._errHandler.sync(this);
switch ( this.interpreter.adaptivePredict(this._input, 11, this._ctx) ) {
case 1:
this.enterOuterAlt(_localctx, 1);
{
this.state = 167;
this.cc_literal();
this.state = 168;
this.match(CommonRegexParser.Hyphen);
this.state = 169;
this.cc_literal();
}
break;
case 2:
this.enterOuterAlt(_localctx, 2);
{
this.state = 171;
this.shared_atom();
}
break;
case 3:
this.enterOuterAlt(_localctx, 3);
{
this.state = 172;
this.cc_literal();
}
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 shared_atom(): Shared_atomContext {
let _localctx: Shared_atomContext = new Shared_atomContext(this._ctx, this.state);
this.enterRule(_localctx, 26, CommonRegexParser.RULE_shared_atom);
let _la: number;
try {
this.enterOuterAlt(_localctx, 1);
{
this.state = 175;
_la = this._input.LA(1);
if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << CommonRegexParser.ControlChar) | (1 << CommonRegexParser.DecimalDigit) | (1 << CommonRegexParser.NotDecimalDigit) | (1 << CommonRegexParser.CharWithProperty) | (1 << CommonRegexParser.CharWithoutProperty) | (1 << CommonRegexParser.WhiteSpace) | (1 << CommonRegexParser.NotWhiteSpace) | (1 << CommonRegexParser.WordChar) | (1 << CommonRegexParser.NotWordChar))) !== 0))) {
this._errHandler.recoverInline(this);
} else {
if (this._input.LA(1) === Token.EOF) {
this.matchedEOF = true;
}
this._errHandler.reportMatch(this);
this.consume();
}
}
}
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 literal(): LiteralContext {
let _localctx: LiteralContext = new LiteralContext(this._ctx, this.state);
this.enterRule(_localctx, 28, CommonRegexParser.RULE_literal);
try {
this.state = 179;
this._errHandler.sync(this);
switch (this._input.LA(1)) {
case CommonRegexParser.Quoted:
case CommonRegexParser.BlockQuoted:
case CommonRegexParser.BellChar:
case CommonRegexParser.EscapeChar:
case CommonRegexParser.FormFeed:
case CommonRegexParser.NewLine:
case CommonRegexParser.CarriageReturn:
case CommonRegexParser.Tab:
case CommonRegexParser.Backslash:
case CommonRegexParser.HexChar:
case CommonRegexParser.Hyphen:
case CommonRegexParser.OpenBrace:
case CommonRegexParser.CloseBrace:
case CommonRegexParser.Comma:
case CommonRegexParser.LessThan:
case CommonRegexParser.GreaterThan:
case CommonRegexParser.SingleQuote:
case CommonRegexParser.Underscore:
case CommonRegexParser.Colon:
case CommonRegexParser.Hash:
case CommonRegexParser.Equals:
case CommonRegexParser.Exclamation:
case CommonRegexParser.Ampersand:
case CommonRegexParser.ALC:
case CommonRegexParser.BLC:
case CommonRegexParser.CLC:
case CommonRegexParser.DLC:
case CommonRegexParser.ELC:
case CommonRegexParser.FLC:
case CommonRegexParser.GLC:
case CommonRegexParser.HLC:
case CommonRegexParser.ILC:
case CommonRegexParser.JLC:
case CommonRegexParser.KLC:
case CommonRegexParser.LLC:
case CommonRegexParser.MLC:
case CommonRegexParser.NLC:
case CommonRegexParser.OLC:
case CommonRegexParser.PLC:
case CommonRegexParser.QLC:
case CommonRegexParser.RLC:
case CommonRegexParser.SLC:
case CommonRegexParser.TLC:
case CommonRegexParser.ULC:
case CommonRegexParser.VLC:
case CommonRegexParser.WLC:
case CommonRegexParser.XLC:
case CommonRegexParser.YLC:
case CommonRegexParser.ZLC:
case CommonRegexParser.AUC:
case CommonRegexParser.BUC:
case CommonRegexParser.CUC:
case CommonRegexParser.DUC:
case CommonRegexParser.EUC:
case CommonRegexParser.FUC:
case CommonRegexParser.GUC:
case CommonRegexParser.HUC:
case CommonRegexParser.IUC:
case CommonRegexParser.JUC:
case CommonRegexParser.KUC:
case CommonRegexParser.LUC:
case CommonRegexParser.MUC:
case CommonRegexParser.NUC:
case CommonRegexParser.OUC:
case CommonRegexParser.PUC:
case CommonRegexParser.QUC:
case CommonRegexParser.RUC:
case CommonRegexParser.SUC:
case CommonRegexParser.TUC:
case CommonRegexParser.UUC:
case CommonRegexParser.VUC:
case CommonRegexParser.WUC:
case CommonRegexParser.XUC:
case CommonRegexParser.YUC:
case CommonRegexParser.ZUC:
case CommonRegexParser.D1:
case CommonRegexParser.D2:
case CommonRegexParser.D3:
case CommonRegexParser.D4:
case CommonRegexParser.D5:
case CommonRegexParser.D6:
case CommonRegexParser.D7:
case CommonRegexParser.D8:
case CommonRegexParser.D9:
case CommonRegexParser.D0:
case CommonRegexParser.OtherChar:
this.enterOuterAlt(_localctx, 1);
{
this.state = 177;
this.shared_literal();
}
break;
case CommonRegexParser.CharacterClassEnd:
this.enterOuterAlt(_localctx, 2);
{
this.state = 178;
this.match(CommonRegexParser.CharacterClassEnd);
}
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 cc_literal(): Cc_literalContext {
let _localctx: Cc_literalContext = new Cc_literalContext(this._ctx, this.state);
this.enterRule(_localctx, 30, CommonRegexParser.RULE_cc_literal);
try {
this.state = 192;
this._errHandler.sync(this);
switch (this._input.LA(1)) {
case CommonRegexParser.Quoted:
case CommonRegexParser.BlockQuoted:
case CommonRegexParser.BellChar:
case CommonRegexParser.EscapeChar:
case CommonRegexParser.FormFeed:
case CommonRegexParser.NewLine:
case CommonRegexParser.CarriageReturn:
case CommonRegexParser.Tab:
case CommonRegexParser.Backslash:
case CommonRegexParser.HexChar:
case CommonRegexParser.Hyphen:
case CommonRegexParser.OpenBrace:
case CommonRegexParser.CloseBrace:
case CommonRegexParser.Comma:
case CommonRegexParser.LessThan:
case CommonRegexParser.GreaterThan:
case CommonRegexParser.SingleQuote:
case CommonRegexParser.Underscore:
case CommonRegexParser.Colon:
case CommonRegexParser.Hash:
case CommonRegexParser.Equals:
case CommonRegexParser.Exclamation:
case CommonRegexParser.Ampersand:
case CommonRegexParser.ALC:
case CommonRegexParser.BLC:
case CommonRegexParser.CLC:
case CommonRegexParser.DLC:
case CommonRegexParser.ELC:
case CommonRegexParser.FLC:
case CommonRegexParser.GLC:
case CommonRegexParser.HLC:
case CommonRegexParser.ILC:
case CommonRegexParser.JLC:
case CommonRegexParser.KLC:
case CommonRegexParser.LLC:
case CommonRegexParser.MLC:
case CommonRegexParser.NLC:
case CommonRegexParser.OLC:
case CommonRegexParser.PLC:
case CommonRegexParser.QLC:
case CommonRegexParser.RLC:
case CommonRegexParser.SLC:
case CommonRegexParser.TLC:
case CommonRegexParser.ULC:
case CommonRegexParser.VLC:
case CommonRegexParser.WLC:
case CommonRegexParser.XLC:
case CommonRegexParser.YLC:
case CommonRegexParser.ZLC:
case CommonRegexParser.AUC:
case CommonRegexParser.BUC:
case CommonRegexParser.CUC:
case CommonRegexParser.DUC:
case CommonRegexParser.EUC:
case CommonRegexParser.FUC:
case CommonRegexParser.GUC:
case CommonRegexParser.HUC:
case CommonRegexParser.IUC:
case CommonRegexParser.JUC:
case CommonRegexParser.KUC:
case CommonRegexParser.LUC:
case CommonRegexParser.MUC:
case CommonRegexParser.NUC:
case CommonRegexParser.OUC:
case CommonRegexParser.PUC:
case CommonRegexParser.QUC:
case CommonRegexParser.RUC:
case CommonRegexParser.SUC:
case CommonRegexParser.TUC:
case CommonRegexParser.UUC:
case CommonRegexParser.VUC:
case CommonRegexParser.WUC:
case CommonRegexParser.XUC:
case CommonRegexParser.YUC:
case CommonRegexParser.ZUC:
case CommonRegexParser.D1:
case CommonRegexParser.D2:
case CommonRegexParser.D3:
case CommonRegexParser.D4:
case CommonRegexParser.D5:
case CommonRegexParser.D6:
case CommonRegexParser.D7:
case CommonRegexParser.D8:
case CommonRegexParser.D9:
case CommonRegexParser.D0:
case CommonRegexParser.OtherChar:
this.enterOuterAlt(_localctx, 1);
{
this.state = 181;
this.shared_literal();
}
break;
case CommonRegexParser.Dot:
this.enterOuterAlt(_localctx, 2);
{
this.state = 182;
this.match(CommonRegexParser.Dot);
}
break;
case CommonRegexParser.CharacterClassStart:
this.enterOuterAlt(_localctx, 3);
{
this.state = 183;
this.match(CommonRegexParser.CharacterClassStart);
}
break;
case CommonRegexParser.Caret:
this.enterOuterAlt(_localctx, 4);
{
this.state = 184;
this.match(CommonRegexParser.Caret);
}
break;
case CommonRegexParser.QuestionMark:
this.enterOuterAlt(_localctx, 5);
{
this.state = 185;
this.match(CommonRege