UNPKG

@atlassianlabs/jql-parser

Version:

JQL lexer, parser, listener and visitor

2,175 lines (1,686 loc) 113 kB
import _defineProperty from "@babel/runtime/helpers/defineProperty"; // Generated from JQLParser.g4 by ANTLR 4.7.3-SNAPSHOT import { ATNDeserializer } from 'antlr4ts/atn/ATNDeserializer'; import { NoViableAltException } from 'antlr4ts/NoViableAltException'; import { Parser } from 'antlr4ts/Parser'; import { ParserRuleContext } from 'antlr4ts/ParserRuleContext'; import { ParserATNSimulator } from 'antlr4ts/atn/ParserATNSimulator'; import { RecognitionException } from 'antlr4ts/RecognitionException'; import { Token } from 'antlr4ts/Token'; import { VocabularyImpl } from 'antlr4ts/VocabularyImpl'; import * as Utils from 'antlr4ts/misc/Utils'; export class JQLParser extends Parser { // tslint:disable:no-trailing-whitespace // @Override // @NotNull get vocabulary() { return JQLParser.VOCABULARY; } // tslint:enable:no-trailing-whitespace // @Override get grammarFileName() { return 'JQLParser.g4'; } // @Override get ruleNames() { return JQLParser.ruleNames; } // @Override get serializedATN() { return JQLParser._serializedATN; } constructor(input) { super(input); this._interp = new ParserATNSimulator(JQLParser._ATN, this); } // @RuleVersion(0) jqlQuery() { let _localctx = new JqlQueryContext(this._ctx, this.state); this.enterRule(_localctx, 0, JQLParser.RULE_jqlQuery); let _la; try { this.enterOuterAlt(_localctx, 1); { this.state = 83; this._errHandler.sync(this); _la = this._input.LA(1); if ((_la & ~0x1f) === 0 && (1 << _la & (1 << JQLParser.LPAREN | 1 << JQLParser.BANG | 1 << JQLParser.NOT)) !== 0 || (_la - 33 & ~0x1f) === 0 && (1 << _la - 33 & (1 << JQLParser.POSNUMBER - 33 | 1 << JQLParser.NEGNUMBER - 33 | 1 << JQLParser.CUSTOMFIELD - 33 | 1 << JQLParser.STRING - 33 | 1 << JQLParser.QUOTE_STRING - 33 | 1 << JQLParser.SQUOTE_STRING - 33)) !== 0) { { this.state = 82; this.jqlWhere(); } } this.state = 86; this._errHandler.sync(this); _la = this._input.LA(1); if (_la === JQLParser.ORDER) { { this.state = 85; this.jqlOrderBy(); } } this.state = 88; this.match(JQLParser.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) jqlWhere() { let _localctx = new JqlWhereContext(this._ctx, this.state); this.enterRule(_localctx, 2, JQLParser.RULE_jqlWhere); try { this.enterOuterAlt(_localctx, 1); { this.state = 90; this.jqlOrClause(); } } 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) jqlOrClause() { let _localctx = new JqlOrClauseContext(this._ctx, this.state); this.enterRule(_localctx, 4, JQLParser.RULE_jqlOrClause); let _la; try { this.enterOuterAlt(_localctx, 1); { this.state = 92; this.jqlAndClause(); this.state = 97; this._errHandler.sync(this); _la = this._input.LA(1); while (_la === JQLParser.OR) { { { this.state = 93; this.match(JQLParser.OR); this.state = 94; this.jqlAndClause(); } } this.state = 99; 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) jqlAndClause() { let _localctx = new JqlAndClauseContext(this._ctx, this.state); this.enterRule(_localctx, 6, JQLParser.RULE_jqlAndClause); let _la; try { this.enterOuterAlt(_localctx, 1); { this.state = 100; this.jqlNotClause(); this.state = 105; this._errHandler.sync(this); _la = this._input.LA(1); while (_la === JQLParser.AND) { { { this.state = 101; this.match(JQLParser.AND); this.state = 102; this.jqlNotClause(); } } this.state = 107; 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) jqlNotClause() { let _localctx = new JqlNotClauseContext(this._ctx, this.state); this.enterRule(_localctx, 8, JQLParser.RULE_jqlNotClause); let _la; try { this.state = 112; this._errHandler.sync(this); switch (this._input.LA(1)) { case JQLParser.BANG: case JQLParser.NOT: this.enterOuterAlt(_localctx, 1); { this.state = 108; _la = this._input.LA(1); if (!(_la === JQLParser.BANG || _la === JQLParser.NOT)) { this._errHandler.recoverInline(this); } else { if (this._input.LA(1) === Token.EOF) { this.matchedEOF = true; } this._errHandler.reportMatch(this); this.consume(); } this.state = 109; this.jqlNotClause(); } break; case JQLParser.LPAREN: this.enterOuterAlt(_localctx, 2); { this.state = 110; this.jqlSubClause(); } break; case JQLParser.POSNUMBER: case JQLParser.NEGNUMBER: case JQLParser.CUSTOMFIELD: case JQLParser.STRING: case JQLParser.QUOTE_STRING: case JQLParser.SQUOTE_STRING: this.enterOuterAlt(_localctx, 3); { this.state = 111; this.jqlTerminalClause(); } 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) jqlSubClause() { let _localctx = new JqlSubClauseContext(this._ctx, this.state); this.enterRule(_localctx, 10, JQLParser.RULE_jqlSubClause); try { this.enterOuterAlt(_localctx, 1); { this.state = 114; this.match(JQLParser.LPAREN); this.state = 115; this.jqlOrClause(); this.state = 116; this.match(JQLParser.RPAREN); } } 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) jqlTerminalClause() { let _localctx = new JqlTerminalClauseContext(this._ctx, this.state); this.enterRule(_localctx, 12, JQLParser.RULE_jqlTerminalClause); try { this.enterOuterAlt(_localctx, 1); { this.state = 118; this.jqlField(); this.state = 119; this.jqlTerminalClauseRhs(); } } 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) jqlTerminalClauseRhs() { let _localctx = new JqlTerminalClauseRhsContext(this._ctx, this.state); this.enterRule(_localctx, 14, JQLParser.RULE_jqlTerminalClauseRhs); let _la; try { this.state = 176; this._errHandler.sync(this); switch (this.interpreter.adaptivePredict(this._input, 14, this._ctx)) { case 1: _localctx = new JqlEqualsClauseContext(_localctx); this.enterOuterAlt(_localctx, 1); { this.state = 121; this.jqlEqualsOperator(); this.state = 125; this._errHandler.sync(this); switch (this.interpreter.adaptivePredict(this._input, 5, this._ctx)) { case 1: { this.state = 122; this.jqlEmpty(); } break; case 2: { this.state = 123; this.jqlValue(); } break; case 3: { this.state = 124; this.jqlFunction(); } break; } } break; case 2: _localctx = new JqlLikeClauseContext(_localctx); this.enterOuterAlt(_localctx, 2); { this.state = 127; this.jqlLikeOperator(); this.state = 131; this._errHandler.sync(this); switch (this.interpreter.adaptivePredict(this._input, 6, this._ctx)) { case 1: { this.state = 128; this.jqlEmpty(); } break; case 2: { this.state = 129; this.jqlValue(); } break; case 3: { this.state = 130; this.jqlFunction(); } break; } } break; case 3: _localctx = new JqlComparisonClauseContext(_localctx); this.enterOuterAlt(_localctx, 3); { this.state = 133; this.jqlComparisonOperator(); this.state = 136; this._errHandler.sync(this); switch (this.interpreter.adaptivePredict(this._input, 7, this._ctx)) { case 1: { this.state = 134; this.jqlValue(); } break; case 2: { this.state = 135; this.jqlFunction(); } break; } } break; case 4: _localctx = new JqlInClauseContext(_localctx); this.enterOuterAlt(_localctx, 4); { this.state = 138; this.jqlInOperator(); this.state = 141; this._errHandler.sync(this); switch (this._input.LA(1)) { case JQLParser.LPAREN: { this.state = 139; this.jqlList(); } break; case JQLParser.POSNUMBER: case JQLParser.NEGNUMBER: case JQLParser.STRING: case JQLParser.QUOTE_STRING: case JQLParser.SQUOTE_STRING: { this.state = 140; this.jqlFunction(); } break; default: throw new NoViableAltException(this); } } break; case 5: _localctx = new JqlIsClauseContext(_localctx); this.enterOuterAlt(_localctx, 5); { this.state = 143; this.jqlIsOperator(); this.state = 144; this.jqlEmpty(); } break; case 6: _localctx = new JqlWasClauseContext(_localctx); this.enterOuterAlt(_localctx, 6); { this.state = 146; this.jqlWasOperator(); this.state = 150; this._errHandler.sync(this); switch (this.interpreter.adaptivePredict(this._input, 9, this._ctx)) { case 1: { this.state = 147; this.jqlEmpty(); } break; case 2: { this.state = 148; this.jqlValue(); } break; case 3: { this.state = 149; this.jqlFunction(); } break; } this.state = 155; this._errHandler.sync(this); _la = this._input.LA(1); while ((_la & ~0x1f) === 0 && (1 << _la & (1 << JQLParser.BEFORE | 1 << JQLParser.AFTER | 1 << JQLParser.ON | 1 << JQLParser.DURING | 1 << JQLParser.BY)) !== 0) { { { this.state = 152; this.jqlWasPredicate(); } } this.state = 157; this._errHandler.sync(this); _la = this._input.LA(1); } } break; case 7: _localctx = new JqlWasInClauseContext(_localctx); this.enterOuterAlt(_localctx, 7); { this.state = 158; this.jqlWasInOperator(); this.state = 161; this._errHandler.sync(this); switch (this._input.LA(1)) { case JQLParser.LPAREN: { this.state = 159; this.jqlList(); } break; case JQLParser.POSNUMBER: case JQLParser.NEGNUMBER: case JQLParser.STRING: case JQLParser.QUOTE_STRING: case JQLParser.SQUOTE_STRING: { this.state = 160; this.jqlFunction(); } break; default: throw new NoViableAltException(this); } this.state = 166; this._errHandler.sync(this); _la = this._input.LA(1); while ((_la & ~0x1f) === 0 && (1 << _la & (1 << JQLParser.BEFORE | 1 << JQLParser.AFTER | 1 << JQLParser.ON | 1 << JQLParser.DURING | 1 << JQLParser.BY)) !== 0) { { { this.state = 163; this.jqlWasPredicate(); } } this.state = 168; this._errHandler.sync(this); _la = this._input.LA(1); } } break; case 8: _localctx = new JqlChangedClauseContext(_localctx); this.enterOuterAlt(_localctx, 8); { this.state = 169; this.jqlChangedOperator(); this.state = 173; this._errHandler.sync(this); _la = this._input.LA(1); while ((_la & ~0x1f) === 0 && (1 << _la & (1 << JQLParser.BEFORE | 1 << JQLParser.AFTER | 1 << JQLParser.FROM | 1 << JQLParser.TO | 1 << JQLParser.ON | 1 << JQLParser.DURING | 1 << JQLParser.BY)) !== 0) { { { this.state = 170; this.jqlChangedPredicate(); } } this.state = 175; this._errHandler.sync(this); _la = this._input.LA(1); } } 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) jqlEqualsOperator() { let _localctx = new JqlEqualsOperatorContext(this._ctx, this.state); this.enterRule(_localctx, 16, JQLParser.RULE_jqlEqualsOperator); let _la; try { this.enterOuterAlt(_localctx, 1); { this.state = 178; _la = this._input.LA(1); if (!(_la === JQLParser.EQUALS || _la === JQLParser.NOT_EQUALS)) { 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) jqlLikeOperator() { let _localctx = new JqlLikeOperatorContext(this._ctx, this.state); this.enterRule(_localctx, 18, JQLParser.RULE_jqlLikeOperator); let _la; try { this.enterOuterAlt(_localctx, 1); { this.state = 180; _la = this._input.LA(1); if (!(_la === JQLParser.LIKE || _la === JQLParser.NOT_LIKE)) { 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) jqlComparisonOperator() { let _localctx = new JqlComparisonOperatorContext(this._ctx, this.state); this.enterRule(_localctx, 20, JQLParser.RULE_jqlComparisonOperator); let _la; try { this.enterOuterAlt(_localctx, 1); { this.state = 182; _la = this._input.LA(1); if (!((_la & ~0x1f) === 0 && (1 << _la & (1 << JQLParser.LT | 1 << JQLParser.GT | 1 << JQLParser.GTEQ | 1 << JQLParser.LTEQ)) !== 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) jqlInOperator() { let _localctx = new JqlInOperatorContext(this._ctx, this.state); this.enterRule(_localctx, 22, JQLParser.RULE_jqlInOperator); try { this.state = 187; this._errHandler.sync(this); switch (this._input.LA(1)) { case JQLParser.IN: this.enterOuterAlt(_localctx, 1); { this.state = 184; this.match(JQLParser.IN); } break; case JQLParser.NOT: this.enterOuterAlt(_localctx, 2); { this.state = 185; this.match(JQLParser.NOT); this.state = 186; this.match(JQLParser.IN); } 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) jqlIsOperator() { let _localctx = new JqlIsOperatorContext(this._ctx, this.state); this.enterRule(_localctx, 24, JQLParser.RULE_jqlIsOperator); try { this.state = 192; this._errHandler.sync(this); switch (this.interpreter.adaptivePredict(this._input, 16, this._ctx)) { case 1: this.enterOuterAlt(_localctx, 1); { this.state = 189; this.match(JQLParser.IS); } break; case 2: this.enterOuterAlt(_localctx, 2); { this.state = 190; this.match(JQLParser.IS); this.state = 191; this.match(JQLParser.NOT); } 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) jqlWasOperator() { let _localctx = new JqlWasOperatorContext(this._ctx, this.state); this.enterRule(_localctx, 26, JQLParser.RULE_jqlWasOperator); try { this.state = 197; this._errHandler.sync(this); switch (this.interpreter.adaptivePredict(this._input, 17, this._ctx)) { case 1: this.enterOuterAlt(_localctx, 1); { this.state = 194; this.match(JQLParser.WAS); } break; case 2: this.enterOuterAlt(_localctx, 2); { this.state = 195; this.match(JQLParser.WAS); this.state = 196; this.match(JQLParser.NOT); } 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) jqlWasInOperator() { let _localctx = new JqlWasInOperatorContext(this._ctx, this.state); this.enterRule(_localctx, 28, JQLParser.RULE_jqlWasInOperator); try { this.state = 204; this._errHandler.sync(this); switch (this.interpreter.adaptivePredict(this._input, 18, this._ctx)) { case 1: this.enterOuterAlt(_localctx, 1); { this.state = 199; this.match(JQLParser.WAS); this.state = 200; this.match(JQLParser.IN); } break; case 2: this.enterOuterAlt(_localctx, 2); { this.state = 201; this.match(JQLParser.WAS); this.state = 202; this.match(JQLParser.NOT); this.state = 203; this.match(JQLParser.IN); } 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) jqlChangedOperator() { let _localctx = new JqlChangedOperatorContext(this._ctx, this.state); this.enterRule(_localctx, 30, JQLParser.RULE_jqlChangedOperator); try { this.enterOuterAlt(_localctx, 1); { this.state = 206; this.match(JQLParser.CHANGED); } } 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) jqlField() { let _localctx = new JqlFieldContext(this._ctx, this.state); this.enterRule(_localctx, 32, JQLParser.RULE_jqlField); let _la; try { this.state = 219; this._errHandler.sync(this); switch (this._input.LA(1)) { case JQLParser.POSNUMBER: case JQLParser.NEGNUMBER: _localctx = new JqlNumberFieldContext(_localctx); this.enterOuterAlt(_localctx, 1); { this.state = 208; this.jqlNumber(); } break; case JQLParser.CUSTOMFIELD: case JQLParser.STRING: case JQLParser.QUOTE_STRING: case JQLParser.SQUOTE_STRING: _localctx = new JqlNonNumberFieldContext(_localctx); this.enterOuterAlt(_localctx, 2); { { this.state = 211; this._errHandler.sync(this); switch (this._input.LA(1)) { case JQLParser.STRING: case JQLParser.QUOTE_STRING: case JQLParser.SQUOTE_STRING: { this.state = 209; this.jqlString(); } break; case JQLParser.CUSTOMFIELD: { this.state = 210; this.jqlCustomField(); } break; default: throw new NoViableAltException(this); } this.state = 216; this._errHandler.sync(this); _la = this._input.LA(1); while (_la === JQLParser.LBRACKET) { { { this.state = 213; this.jqlFieldProperty(); } } this.state = 218; this._errHandler.sync(this); _la = this._input.LA(1); } } } 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) jqlFieldProperty() { let _localctx = new JqlFieldPropertyContext(this._ctx, this.state); this.enterRule(_localctx, 34, JQLParser.RULE_jqlFieldProperty); let _la; try { this.enterOuterAlt(_localctx, 1); { { this.state = 221; this.match(JQLParser.LBRACKET); { this.state = 222; this.jqlArgument(); } this.state = 223; this.match(JQLParser.RBRACKET); } this.state = 228; this._errHandler.sync(this); _la = this._input.LA(1); while ((_la - 33 & ~0x1f) === 0 && (1 << _la - 33 & (1 << JQLParser.POSNUMBER - 33 | 1 << JQLParser.NEGNUMBER - 33 | 1 << JQLParser.STRING - 33 | 1 << JQLParser.QUOTE_STRING - 33 | 1 << JQLParser.SQUOTE_STRING - 33)) !== 0) { { { this.state = 225; this.jqlPropertyArgument(); } } this.state = 230; 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) jqlCustomField() { let _localctx = new JqlCustomFieldContext(this._ctx, this.state); this.enterRule(_localctx, 36, JQLParser.RULE_jqlCustomField); try { this.enterOuterAlt(_localctx, 1); { this.state = 231; this.match(JQLParser.CUSTOMFIELD); this.state = 232; this.match(JQLParser.LBRACKET); this.state = 233; this.match(JQLParser.POSNUMBER); this.state = 234; this.match(JQLParser.RBRACKET); } } 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) jqlString() { let _localctx = new JqlStringContext(this._ctx, this.state); this.enterRule(_localctx, 38, JQLParser.RULE_jqlString); let _la; try { this.enterOuterAlt(_localctx, 1); { this.state = 236; _la = this._input.LA(1); if (!((_la - 37 & ~0x1f) === 0 && (1 << _la - 37 & (1 << JQLParser.STRING - 37 | 1 << JQLParser.QUOTE_STRING - 37 | 1 << JQLParser.SQUOTE_STRING - 37)) !== 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) jqlNumber() { let _localctx = new JqlNumberContext(this._ctx, this.state); this.enterRule(_localctx, 40, JQLParser.RULE_jqlNumber); let _la; try { this.enterOuterAlt(_localctx, 1); { this.state = 238; _localctx._jqlNum = this._input.LT(1); _la = this._input.LA(1); if (!(_la === JQLParser.POSNUMBER || _la === JQLParser.NEGNUMBER)) { _localctx._jqlNum = 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) jqlOperand() { let _localctx = new JqlOperandContext(this._ctx, this.state); this.enterRule(_localctx, 42, JQLParser.RULE_jqlOperand); try { this.state = 244; this._errHandler.sync(this); switch (this.interpreter.adaptivePredict(this._input, 23, this._ctx)) { case 1: this.enterOuterAlt(_localctx, 1); { this.state = 240; this.jqlEmpty(); } break; case 2: this.enterOuterAlt(_localctx, 2); { this.state = 241; this.jqlValue(); } break; case 3: this.enterOuterAlt(_localctx, 3); { this.state = 242; this.jqlFunction(); } break; case 4: this.enterOuterAlt(_localctx, 4); { this.state = 243; this.jqlList(); } 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) jqlEmpty() { let _localctx = new JqlEmptyContext(this._ctx, this.state); this.enterRule(_localctx, 44, JQLParser.RULE_jqlEmpty); try { this.enterOuterAlt(_localctx, 1); { this.state = 246; this.match(JQLParser.EMPTY); } } 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) jqlValue() { let _localctx = new JqlValueContext(this._ctx, this.state); this.enterRule(_localctx, 46, JQLParser.RULE_jqlValue); try { this.state = 250; this._errHandler.sync(this); switch (this._input.LA(1)) { case JQLParser.STRING: case JQLParser.QUOTE_STRING: case JQLParser.SQUOTE_STRING: this.enterOuterAlt(_localctx, 1); { this.state = 248; this.jqlString(); } break; case JQLParser.POSNUMBER: case JQLParser.NEGNUMBER: this.enterOuterAlt(_localctx, 2); { this.state = 249; this.jqlNumber(); } 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) jqlFunction() { let _localctx = new JqlFunctionContext(this._ctx, this.state); this.enterRule(_localctx, 48, JQLParser.RULE_jqlFunction); let _la; try { this.enterOuterAlt(_localctx, 1); { this.state = 252; this.jqlFunctionName(); this.state = 253; this.match(JQLParser.LPAREN); this.state = 255; this._errHandler.sync(this); _la = this._input.LA(1); if ((_la - 33 & ~0x1f) === 0 && (1 << _la - 33 & (1 << JQLParser.POSNUMBER - 33 | 1 << JQLParser.NEGNUMBER - 33 | 1 << JQLParser.STRING - 33 | 1 << JQLParser.QUOTE_STRING - 33 | 1 << JQLParser.SQUOTE_STRING - 33)) !== 0) { { this.state = 254; this.jqlArgumentList(); } } this.state = 257; this.match(JQLParser.RPAREN); } } 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) jqlFunctionName() { let _localctx = new JqlFunctionNameContext(this._ctx, this.state); this.enterRule(_localctx, 50, JQLParser.RULE_jqlFunctionName); try { this.state = 261; this._errHandler.sync(this); switch (this._input.LA(1)) { case JQLParser.STRING: case JQLParser.QUOTE_STRING: case JQLParser.SQUOTE_STRING: this.enterOuterAlt(_localctx, 1); { this.state = 259; this.jqlString(); } break; case JQLParser.POSNUMBER: case JQLParser.NEGNUMBER: this.enterOuterAlt(_localctx, 2); { this.state = 260; this.jqlNumber(); } 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) jqlArgumentList() { let _localctx = new JqlArgumentListContext(this._ctx, this.state); this.enterRule(_localctx, 52, JQLParser.RULE_jqlArgumentList); let _la; try { this.enterOuterAlt(_localctx, 1); { this.state = 263; this.jqlArgument(); this.state = 268; this._errHandler.sync(this); _la = this._input.LA(1); while (_la === JQLParser.COMMA) { { { this.state = 264; this.match(JQLParser.COMMA); this.state = 265; this.jqlArgument(); } } this.state = 270; 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) jqlList() { let _localctx = new JqlListContext(this._ctx, this.state); this.enterRule(_localctx, 54, JQLParser.RULE_jqlList); let _la; try { this.enterOuterAlt(_localctx, 1); { this.state = 271; this.jqlListStart(); this.state = 272; this.jqlOperand(); this.state = 277; this._errHandler.sync(this); _la = this._input.LA(1); while (_la === JQLParser.COMMA) { { { this.state = 273; this.match(JQLParser.COMMA); this.state = 274; this.jqlOperand(); } } this.state = 279; this._errHandler.sync(this); _la = this._input.LA(1); } this.state = 280; this.jqlListEnd(); } } 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) jqlListStart() { let _localctx = new JqlListStartContext(this._ctx, this.state); this.enterRule(_localctx, 56, JQLParser.RULE_jqlListStart); try { this.enterOuterAlt(_localctx, 1); { this.state = 282; this.match(JQLParser.LPAREN); } } 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) jqlListEnd() { let _localctx = new JqlListEndContext(this._ctx, this.state); this.enterRule(_localctx, 58, JQLParser.RULE_jqlListEnd); try { this.enterOuterAlt(_localctx, 1); { this.state = 284; this.match(JQLParser.RPAREN); } } 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) jqlPropertyArgument() { let _localctx = new JqlPropertyArgumentContext(this._ctx, this.state); this.enterRule(_localctx, 60, JQLParser.RULE_jqlPropertyArgument); try { this.enterOuterAlt(_localctx, 1); { this.state = 286; this.jqlArgument(); } } 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) jqlArgument() { let _localctx = new JqlArgumentContext(this._ctx, this.state); this.enterRule(_localctx, 62, JQLParser.RULE_jqlArgument); try { this.state = 290; this._errHandler.sync(this); switch (this._input.LA(1)) { case JQLParser.STRING: case JQLParser.QUOTE_STRING: case JQLParser.SQUOTE_STRING: this.enterOuterAlt(_localctx, 1); { this.state = 288; this.jqlString(); } break; case JQLParser.POSNUMBER: case JQLParser.NEGNUMBER: this.enterOuterAlt(_localctx, 2); { this.state = 289; this.jqlNumber(); } 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) jqlWasPredicate() { let _localctx = new JqlWasPredicateContext(this._ctx, this.state); this.enterRule(_localctx, 64, JQLParser.RULE_jqlWasPredicate); try { this.enterOuterAlt(_localctx, 1); { this.state = 295; this._errHandler.sync(this); switch (this._input.LA(1)) { case JQLParser.BEFORE: case JQLParser.AFTER: case JQLParser.ON: { this.state = 292; this.jqlDatePredicateOperator(); } break; case JQLParser.DURING: { this.state = 293; this.jqlDateRangePredicateOperator(); } break; case JQLParser.BY: { this.state = 294; this.jqlUserPredicateOperator(); } break; default: throw new NoViableAltException(this); } this.state = 297; this.jqlPredicateOperand(); } } 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) jqlChangedPredicate() { let _localctx = new JqlChangedPredicateContext(this._ctx, this.state); this.enterRule(_localctx, 66, JQLParser.RULE_jqlChangedPredicate); try { this.enterOuterAlt(_localctx, 1); { this.state = 303; this._errHandler.sync(this); switch (this._input.LA(1)) { case JQLParser.BEFORE: case JQLParser.AFTER: case JQLParser.ON: { this.state = 299; this.jqlDatePredicateOperator(); } break; case JQLParser.DURING: { this.state = 300; this.jqlDateRangePredicateOperator(); } break; case JQLParser.BY: { this.state = 301; this.jqlUserPredicateOperator(); } break; case JQLParser.FROM: case JQLParser.TO: { this.state = 302; this.jqlValuePredicateOperator(); } break; default: throw new NoViableAltException(this); } this.state = 305; this.jqlPredicateOperand(); } } 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) jqlDatePredicateOperator() { let _localctx = new JqlDatePredicateOperatorContext(this._ctx, this.state); this.enterRule(_localctx, 68, JQLParser.RULE_jqlDatePredicateOperator); let _la; try { this.enterOuterAlt(_localctx, 1); { this.state = 307; _la = this._input.LA(1); if (!((_la & ~0x1f) === 0 && (1 << _la & (1 << JQLParser.BEFORE | 1 << JQLParser.AFTER | 1 << JQLParser.ON)) !== 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) jqlDateRangePredicateOperator() { let _localctx = new JqlDateRangePredicateOperatorContext(this._ctx, this.state); this.enterRule(_localctx, 70, JQLParser.RULE_jqlDateRangePredicateOperator); try { this.enterOuterAlt(_localctx, 1); { this.state = 309; this.match(JQLParser.DURING); } } 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) jqlUserPredicateOperator() { let _localctx = new JqlUserPredicateOperatorContext(this._ctx, this.state); this.enterRule(_localctx, 72, JQLParser.RULE_jqlUserPredicateOperator); try { this.enterOuterAlt(_localctx, 1); { this.state = 311; this.match(JQLParser.BY); } } 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) jqlValuePredicateOperator() { let _localctx = new JqlValuePredicateOperatorContext(this._ctx, this.state); this.enterRule(_localctx, 74, JQLParser.RULE_jqlValuePredicateOperator); let _la; try { this.enterOuterAlt(_localctx, 1); { this.state = 313; _la = this._input.LA(1); if (!(_la === JQLParser.FROM || _la === JQLParser.TO)) { 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) jqlPredicateOperand() { let _localctx = new JqlPredicateOperandContext(this._ctx, this.state); this.enterRule(_localctx, 76, JQLParser.RULE_jqlPredicateOperand); try { this.enterOuterAlt(_localctx, 1); { this.state = 315; this.jqlOperand(); } } 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) jqlOrderBy() { let _localctx = new JqlOrderByContext(this._ctx, this.state); this.enterRule(_localctx, 78, JQLParser.RULE_jqlOrderBy); let _la; try { this.enterOuterAlt(_localctx, 1); { this.state = 317; this.match(JQLParser.ORDER); this.state = 318; this.match(JQLParser.BY); this.state = 319; this.jqlSearchSort(); this.state = 324; this._errHandler.sync(this); _la = this._input.LA(1); while (_la === JQLParser.COMMA) { { { this.state = 320; this.match(JQLParser.COMMA); this.state = 321; this.jqlSearchSort(); } } this.state = 326; 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) jqlSearchSort() { let _localctx = new JqlSearchSortContext(this._ctx, this.state); this.enterRule(_localctx, 80, JQLParser.RULE_jqlSearchSort); let _la; try { this.enterOuterAlt(_localctx