adaptive-expressions
Version:
Common Expression Language
960 lines • 153 kB
JavaScript
"use strict";
// Generated from src/CommonRegex.g4 by ANTLR 4.7.3-SNAPSHOT
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.LetterContext = exports.Non_close_parenContext = exports.Non_close_parensContext = exports.Alpha_numsContext = exports.NameContext = exports.DigitContext = exports.DigitsContext = exports.Octal_digitContext = exports.Octal_charContext = exports.NumberContext = exports.Shared_literalContext = exports.Cc_literalContext = exports.LiteralContext = exports.Shared_atomContext = exports.Cc_atomContext = exports.AtomContext = exports.Option_flagContext = exports.OptionContext = exports.Non_captureContext = exports.CaptureContext = exports.Character_classContext = exports.Quantifier_typeContext = exports.QuantifierContext = exports.ElementContext = exports.ExprContext = exports.AlternationContext = exports.ParseContext = exports.CommonRegexParser = void 0;
const ATNDeserializer_1 = require("antlr4ts/atn/ATNDeserializer");
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 = __importStar(require("antlr4ts/misc/Utils"));
class CommonRegexParser extends Parser_1.Parser {
constructor(input) {
super(input);
this._interp = new ParserATNSimulator_1.ParserATNSimulator(CommonRegexParser._ATN, this);
}
// @Override
// @NotNull
get vocabulary() {
return CommonRegexParser.VOCABULARY;
}
// tslint:enable:no-trailing-whitespace
// @Override
get grammarFileName() { return "CommonRegex.g4"; }
// @Override
get ruleNames() { return CommonRegexParser.ruleNames; }
// @Override
get serializedATN() { return CommonRegexParser._serializedATN; }
// @RuleVersion(0)
parse() {
let _localctx = 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_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)
alternation() {
let _localctx = new AlternationContext(this._ctx, this.state);
this.enterRule(_localctx, 2, CommonRegexParser.RULE_alternation);
let _la;
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_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)
expr() {
let _localctx = new ExprContext(this._ctx, this.state);
this.enterRule(_localctx, 4, CommonRegexParser.RULE_expr);
let _la;
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_1.RecognitionException) {
_localctx.exception = re;
this._errHandler.reportError(this, re);
this._errHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return _localctx;
}
// @RuleVersion(0)
element() {
let _localctx = new ElementContext(this._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_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)
quantifier() {
let _localctx = 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_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)
quantifier_type() {
let _localctx = 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_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)
character_class() {
let _localctx = new Character_classContext(this._ctx, this.state);
this.enterRule(_localctx, 12, CommonRegexParser.RULE_character_class);
let _la;
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_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)
capture() {
let _localctx = 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_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)
non_capture() {
let _localctx = 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_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)
option() {
let _localctx = new OptionContext(this._ctx, this.state);
this.enterRule(_localctx, 18, CommonRegexParser.RULE_option);
let _la;
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_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)
option_flag() {
let _localctx = new Option_flagContext(this._ctx, this.state);
this.enterRule(_localctx, 20, CommonRegexParser.RULE_option_flag);
let _la;
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_1.Token.EOF) {
this.matchedEOF = true;
}
this._errHandler.reportMatch(this);
this.consume();
}
}
}
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)
atom() {
let _localctx = 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_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)
cc_atom() {
let _localctx = 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_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)
shared_atom() {
let _localctx = new Shared_atomContext(this._ctx, this.state);
this.enterRule(_localctx, 26, CommonRegexParser.RULE_shared_atom);
let _la;
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_1.Token.EOF) {
this.matchedEOF = true;
}
this._errHandler.reportMatch(this);
this.consume();
}
}
}
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)
literal() {
let _localctx = 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 Commo