// Generated from ./grammar/v1/RelativeDateFormat.g4 by ANTLR 4.7.3-SNAPSHOT import { ATN } from "antlr4ts/atn/ATN"; import { ATNDeserializer } from "antlr4ts/atn/ATNDeserializer"; import { FailedPredicateException } from "antlr4ts/FailedPredicateException"; import { NotNull } from "antlr4ts/Decorators"; import { NoViableAltException } from "antlr4ts/NoViableAltException"; import { Override } from "antlr4ts/Decorators"; import { Parser } from "antlr4ts/Parser"; import { ParserRuleContext } from "antlr4ts/ParserRuleContext"; import { ParserATNSimulator } from "antlr4ts/atn/ParserATNSimulator"; import { ParseTreeListener } from "antlr4ts/tree/ParseTreeListener"; import { ParseTreeVisitor } from "antlr4ts/tree/ParseTreeVisitor"; import { RecognitionException } from "antlr4ts/RecognitionException"; import { RuleContext } from "antlr4ts/RuleContext"; //import { RuleVersion } from "antlr4ts/RuleVersion"; import { TerminalNode } from "antlr4ts/tree/TerminalNode"; import { Token } from "antlr4ts/Token"; import { TokenStream } from "antlr4ts/TokenStream"; import { Vocabulary } from "antlr4ts/Vocabulary"; import { VocabularyImpl } from "antlr4ts/VocabularyImpl"; import * as Utils from "antlr4ts/misc/Utils"; import { RelativeDateFormatListener } from "./RelativeDateFormatListener"; import { RelativeDateFormatVisitor } from "./RelativeDateFormatVisitor"; export class RelativeDateFormatParser extends Parser { public static readonly NOW = 1; public static readonly SECONDS = 2; public static readonly MINUTES = 3; public static readonly HOURS = 4; public static readonly DAYS = 5; public static readonly WEEKS = 6; public static readonly MONTHS = 7; public static readonly QUARTERS = 8; public static readonly YEARS = 9; public static readonly RANGE = 10; public static readonly TRAIL = 11; public static readonly PERIOD = 12; public static readonly OP_MIN = 13; public static readonly OP_ADD = 14; public static readonly NUMBER = 15; public static readonly SEPERATOR = 16; public static readonly WS = 17; public static readonly RULE_directive = 0; public static readonly RULE_relativeExpression = 1; public static readonly RULE_resolvableExpression = 2; public static readonly RULE_staticExpression = 3; public static readonly RULE_staticPeriod = 4; public static readonly RULE_relativePeriod = 5; public static readonly RULE_unaryExpr = 6; public static readonly RULE_staticIdentifier = 7; public static readonly RULE_relativeIdentifier = 8; public static readonly RULE_handler = 9; public static readonly RULE_timestamp = 10; // tslint:disable:no-trailing-whitespace public static readonly ruleNames: string[] = [ "directive", "relativeExpression", "resolvableExpression", "staticExpression", "staticPeriod", "relativePeriod", "unaryExpr", "staticIdentifier", "relativeIdentifier", "handler", "timestamp", ]; private static readonly _LITERAL_NAMES: Array = [ undefined, "'now'", "'s'", "'m'", "'h'", "'d'", "'w'", "'M'", "'Q'", "'Y'", "'range'", "'trail'", "'period'", "'-'", "'+'", undefined, "'$'", ]; private static readonly _SYMBOLIC_NAMES: Array = [ undefined, "NOW", "SECONDS", "MINUTES", "HOURS", "DAYS", "WEEKS", "MONTHS", "QUARTERS", "YEARS", "RANGE", "TRAIL", "PERIOD", "OP_MIN", "OP_ADD", "NUMBER", "SEPERATOR", "WS", ]; public static readonly VOCABULARY: Vocabulary = new VocabularyImpl(RelativeDateFormatParser._LITERAL_NAMES, RelativeDateFormatParser._SYMBOLIC_NAMES, []); // @Override // @NotNull public get vocabulary(): Vocabulary { return RelativeDateFormatParser.VOCABULARY; } // tslint:enable:no-trailing-whitespace // @Override public get grammarFileName(): string { return "RelativeDateFormat.g4"; } // @Override public get ruleNames(): string[] { return RelativeDateFormatParser.ruleNames; } // @Override public get serializedATN(): string { return RelativeDateFormatParser._serializedATN; } constructor(input: TokenStream) { super(input); this._interp = new ParserATNSimulator(RelativeDateFormatParser._ATN, this); } // @RuleVersion(0) public directive(): DirectiveContext { let _localctx: DirectiveContext = new DirectiveContext(this._ctx, this.state); this.enterRule(_localctx, 0, RelativeDateFormatParser.RULE_directive); let _la: number; try { this.state = 50; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input, 1, this._ctx) ) { case 1: _localctx = new RangeDirectiveContext(_localctx); this.enterOuterAlt(_localctx, 1); { this.state = 22; this.match(RelativeDateFormatParser.SEPERATOR); this.state = 23; this.match(RelativeDateFormatParser.RANGE); this.state = 24; this.match(RelativeDateFormatParser.SEPERATOR); this.state = 25; (_localctx as RangeDirectiveContext)._begin = this.resolvableExpression(); this.state = 26; this.match(RelativeDateFormatParser.SEPERATOR); this.state = 27; (_localctx as RangeDirectiveContext)._end = this.resolvableExpression(); this.state = 28; this.match(RelativeDateFormatParser.SEPERATOR); } break; case 2: _localctx = new TrailDirectiveContext(_localctx); this.enterOuterAlt(_localctx, 2); { this.state = 30; this.match(RelativeDateFormatParser.SEPERATOR); this.state = 31; this.match(RelativeDateFormatParser.TRAIL); this.state = 32; this.match(RelativeDateFormatParser.SEPERATOR); this.state = 33; (_localctx as TrailDirectiveContext)._end = this.resolvableExpression(); this.state = 34; this.match(RelativeDateFormatParser.SEPERATOR); { this.state = 35; (_localctx as TrailDirectiveContext)._period = this.relativeExpression(); } this.state = 36; this.match(RelativeDateFormatParser.SEPERATOR); } break; case 3: _localctx = new PeriodDirectiveContext(_localctx); this.enterOuterAlt(_localctx, 3); { this.state = 38; this.match(RelativeDateFormatParser.SEPERATOR); this.state = 39; this.match(RelativeDateFormatParser.PERIOD); this.state = 40; this.match(RelativeDateFormatParser.SEPERATOR); this.state = 41; (_localctx as PeriodDirectiveContext)._begin = this.resolvableExpression(); this.state = 42; this.match(RelativeDateFormatParser.SEPERATOR); { this.state = 43; (_localctx as PeriodDirectiveContext)._period = this.relativeExpression(); } this.state = 44; this.match(RelativeDateFormatParser.SEPERATOR); this.state = 48; this._errHandler.sync(this); _la = this._input.LA(1); if ((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << RelativeDateFormatParser.NOW) | (1 << RelativeDateFormatParser.OP_MIN) | (1 << RelativeDateFormatParser.OP_ADD) | (1 << RelativeDateFormatParser.NUMBER))) !== 0)) { { this.state = 45; (_localctx as PeriodDirectiveContext)._ref = this.resolvableExpression(); this.state = 46; this.match(RelativeDateFormatParser.SEPERATOR); } } } 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 relativeExpression(): RelativeExpressionContext { let _localctx: RelativeExpressionContext = new RelativeExpressionContext(this._ctx, this.state); this.enterRule(_localctx, 2, RelativeDateFormatParser.RULE_relativeExpression); try { this.enterOuterAlt(_localctx, 1); { this.state = 54; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input, 2, this._ctx) ) { case 1: { this.state = 52; this.resolvableExpression(); } break; case 2: { this.state = 53; this.relativePeriod(); } 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 resolvableExpression(): ResolvableExpressionContext { let _localctx: ResolvableExpressionContext = new ResolvableExpressionContext(this._ctx, this.state); this.enterRule(_localctx, 4, RelativeDateFormatParser.RULE_resolvableExpression); let _la: number; try { this.enterOuterAlt(_localctx, 1); { this.state = 58; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input, 3, this._ctx) ) { case 1: { this.state = 56; this.staticPeriod(); } break; case 2: { this.state = 57; this.staticExpression(0); } break; } this.state = 61; this._errHandler.sync(this); _la = this._input.LA(1); if ((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << RelativeDateFormatParser.OP_MIN) | (1 << RelativeDateFormatParser.OP_ADD) | (1 << RelativeDateFormatParser.NUMBER))) !== 0)) { { this.state = 60; _localctx._rel = this.relativePeriod(); } } } } 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; } public staticExpression(): StaticExpressionContext; public staticExpression(_p: number): StaticExpressionContext; // @RuleVersion(0) public staticExpression(_p?: number): StaticExpressionContext { if (_p === undefined) { _p = 0; } let _parentctx: ParserRuleContext = this._ctx; let _parentState: number = this.state; let _localctx: StaticExpressionContext = new StaticExpressionContext(this._ctx, _parentState); let _prevctx: StaticExpressionContext = _localctx; let _startState: number = 6; this.enterRecursionRule(_localctx, 6, RelativeDateFormatParser.RULE_staticExpression, _p); try { let _alt: number; this.enterOuterAlt(_localctx, 1); { { this.state = 66; this._errHandler.sync(this); switch (this._input.LA(1)) { case RelativeDateFormatParser.NUMBER: { this.state = 64; this.timestamp(); } break; case RelativeDateFormatParser.NOW: { this.state = 65; this.match(RelativeDateFormatParser.NOW); } break; default: throw new NoViableAltException(this); } } this._ctx._stop = this._input.tryLT(-1); this.state = 76; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 7, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { if (_alt === 1) { if (this._parseListeners != null) { this.triggerExitRuleEvent(); } _prevctx = _localctx; { { _localctx = new StaticExpressionContext(_parentctx, _parentState); _localctx._first = _prevctx; this.pushNewRecursionContext(_localctx, _startState, RelativeDateFormatParser.RULE_staticExpression); this.state = 68; if (!(this.precpred(this._ctx, 1))) { throw new FailedPredicateException(this, "this.precpred(this._ctx, 1)"); } this.state = 70; this._errHandler.sync(this); _alt = 1; do { switch (_alt) { case 1: { { this.state = 69; _localctx._staticPeriod = this.staticPeriod(); _localctx._then.push(_localctx._staticPeriod); } } break; default: throw new NoViableAltException(this); } this.state = 72; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 6, this._ctx); } while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER); } } } this.state = 78; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 7, this._ctx); } } } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); this._errHandler.recover(this, re); } else { throw re; } } finally { this.unrollRecursionContexts(_parentctx); } return _localctx; } // @RuleVersion(0) public staticPeriod(): StaticPeriodContext { let _localctx: StaticPeriodContext = new StaticPeriodContext(this._ctx, this.state); this.enterRule(_localctx, 8, RelativeDateFormatParser.RULE_staticPeriod); try { this.state = 84; this._errHandler.sync(this); switch (this._input.LA(1)) { case RelativeDateFormatParser.OP_MIN: case RelativeDateFormatParser.OP_ADD: this.enterOuterAlt(_localctx, 1); { this.state = 79; this.unaryExpr(); this.state = 80; this.staticIdentifier(); } break; case RelativeDateFormatParser.NUMBER: this.enterOuterAlt(_localctx, 2); { this.state = 82; this.match(RelativeDateFormatParser.NUMBER); this.state = 83; this.staticIdentifier(); } 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 relativePeriod(): RelativePeriodContext { let _localctx: RelativePeriodContext = new RelativePeriodContext(this._ctx, this.state); this.enterRule(_localctx, 10, RelativeDateFormatParser.RULE_relativePeriod); try { this.state = 91; this._errHandler.sync(this); switch (this._input.LA(1)) { case RelativeDateFormatParser.OP_MIN: case RelativeDateFormatParser.OP_ADD: this.enterOuterAlt(_localctx, 1); { this.state = 86; this.unaryExpr(); this.state = 87; this.relativeIdentifier(); } break; case RelativeDateFormatParser.NUMBER: this.enterOuterAlt(_localctx, 2); { this.state = 89; this.match(RelativeDateFormatParser.NUMBER); this.state = 90; this.relativeIdentifier(); } 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 unaryExpr(): UnaryExprContext { let _localctx: UnaryExprContext = new UnaryExprContext(this._ctx, this.state); this.enterRule(_localctx, 12, RelativeDateFormatParser.RULE_unaryExpr); try { this.state = 97; this._errHandler.sync(this); switch (this._input.LA(1)) { case RelativeDateFormatParser.OP_ADD: _localctx = new PosUnaryExprContext(_localctx); this.enterOuterAlt(_localctx, 1); { this.state = 93; this.match(RelativeDateFormatParser.OP_ADD); this.state = 94; this.match(RelativeDateFormatParser.NUMBER); } break; case RelativeDateFormatParser.OP_MIN: _localctx = new NegUnaryExprContext(_localctx); this.enterOuterAlt(_localctx, 2); { this.state = 95; this.match(RelativeDateFormatParser.OP_MIN); this.state = 96; this.match(RelativeDateFormatParser.NUMBER); } 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 staticIdentifier(): StaticIdentifierContext { let _localctx: StaticIdentifierContext = new StaticIdentifierContext(this._ctx, this.state); this.enterRule(_localctx, 14, RelativeDateFormatParser.RULE_staticIdentifier); let _la: number; try { this.enterOuterAlt(_localctx, 1); { this.state = 99; _la = this._input.LA(1); if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << RelativeDateFormatParser.SECONDS) | (1 << RelativeDateFormatParser.MINUTES) | (1 << RelativeDateFormatParser.HOURS) | (1 << RelativeDateFormatParser.DAYS) | (1 << RelativeDateFormatParser.WEEKS))) !== 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 relativeIdentifier(): RelativeIdentifierContext { let _localctx: RelativeIdentifierContext = new RelativeIdentifierContext(this._ctx, this.state); this.enterRule(_localctx, 16, RelativeDateFormatParser.RULE_relativeIdentifier); let _la: number; try { this.enterOuterAlt(_localctx, 1); { this.state = 101; _la = this._input.LA(1); if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << RelativeDateFormatParser.MONTHS) | (1 << RelativeDateFormatParser.QUARTERS) | (1 << RelativeDateFormatParser.YEARS))) !== 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 handler(): HandlerContext { let _localctx: HandlerContext = new HandlerContext(this._ctx, this.state); this.enterRule(_localctx, 18, RelativeDateFormatParser.RULE_handler); let _la: number; try { this.enterOuterAlt(_localctx, 1); { this.state = 103; _la = this._input.LA(1); if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << RelativeDateFormatParser.RANGE) | (1 << RelativeDateFormatParser.TRAIL) | (1 << RelativeDateFormatParser.PERIOD))) !== 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 timestamp(): TimestampContext { let _localctx: TimestampContext = new TimestampContext(this._ctx, this.state); this.enterRule(_localctx, 20, RelativeDateFormatParser.RULE_timestamp); try { let _alt: number; this.enterOuterAlt(_localctx, 1); { this.state = 106; this._errHandler.sync(this); _alt = 1; do { switch (_alt) { case 1: { { this.state = 105; this.match(RelativeDateFormatParser.NUMBER); } } break; default: throw new NoViableAltException(this); } this.state = 108; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 11, this._ctx); } while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER); } } 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; } public sempred(_localctx: RuleContext, ruleIndex: number, predIndex: number): boolean { switch (ruleIndex) { case 3: return this.staticExpression_sempred(_localctx as StaticExpressionContext, predIndex); } return true; } private staticExpression_sempred(_localctx: StaticExpressionContext, predIndex: number): boolean { switch (predIndex) { case 0: return this.precpred(this._ctx, 1); } return true; } public static readonly _serializedATN: string = "\x03\uC91D\uCABA\u058D\uAFBA\u4F53\u0607\uEA8B\uC241\x03\x13q\x04\x02" + "\t\x02\x04\x03\t\x03\x04\x04\t\x04\x04\x05\t\x05\x04\x06\t\x06\x04\x07" + "\t\x07\x04\b\t\b\x04\t\t\t\x04\n\t\n\x04\v\t\v\x04\f\t\f\x03\x02\x03\x02" + "\x03\x02\x03\x02\x03\x02\x03\x02\x03\x02\x03\x02\x03\x02\x03\x02\x03\x02" + "\x03\x02\x03\x02\x03\x02\x03\x02\x03\x02\x03\x02\x03\x02\x03\x02\x03\x02" + "\x03\x02\x03\x02\x03\x02\x03\x02\x03\x02\x03\x02\x05\x023\n\x02\x05\x02" + "5\n\x02\x03\x03\x03\x03\x05\x039\n\x03\x03\x04\x03\x04\x05\x04=\n\x04" + "\x03\x04\x05\x04@\n\x04\x03\x05\x03\x05\x03\x05\x05\x05E\n\x05\x03\x05" + "\x03\x05\x06\x05I\n\x05\r\x05\x0E\x05J\x07\x05M\n\x05\f\x05\x0E\x05P\v" + "\x05\x03\x06\x03\x06\x03\x06\x03\x06\x03\x06\x05\x06W\n\x06\x03\x07\x03" + "\x07\x03\x07\x03\x07\x03\x07\x05\x07^\n\x07\x03\b\x03\b\x03\b\x03\b\x05" + "\bd\n\b\x03\t\x03\t\x03\n\x03\n\x03\v\x03\v\x03\f\x06\fm\n\f\r\f\x0E\f" + "n\x03\f\x02\x02\x03\b\r\x02\x02\x04\x02\x06\x02\b\x02\n\x02\f\x02\x0E" + "\x02\x10\x02\x12\x02\x14\x02\x16\x02\x02\x05\x03\x02\x04\b\x03\x02\t\v" + "\x03\x02\f\x0E\x02r\x024\x03\x02\x02\x02\x048\x03\x02\x02\x02\x06<\x03" + "\x02\x02\x02\bA\x03\x02\x02\x02\nV\x03\x02\x02\x02\f]\x03\x02\x02\x02" + "\x0Ec\x03\x02\x02\x02\x10e\x03\x02\x02\x02\x12g\x03\x02\x02\x02\x14i\x03" + "\x02\x02\x02\x16l\x03\x02\x02\x02\x18\x19\x07\x12\x02\x02\x19\x1A\x07" + "\f\x02\x02\x1A\x1B\x07\x12\x02\x02\x1B\x1C\x05\x06\x04\x02\x1C\x1D\x07" + "\x12\x02\x02\x1D\x1E\x05\x06\x04\x02\x1E\x1F\x07\x12\x02\x02\x1F5\x03" + "\x02\x02\x02 !\x07\x12\x02\x02!\"\x07\r\x02\x02\"#\x07\x12\x02\x02#$\x05" + "\x06\x04\x02$%\x07\x12\x02\x02%&\x05\x04\x03\x02&\'\x07\x12\x02\x02\'" + "5\x03\x02\x02\x02()\x07\x12\x02\x02)*\x07\x0E\x02\x02*+\x07\x12\x02\x02" + "+,\x05\x06\x04\x02,-\x07\x12\x02\x02-.\x05\x04\x03\x02.2\x07\x12\x02\x02" + "/0\x05\x06\x04\x0201\x07\x12\x02\x0213\x03\x02\x02\x022/\x03\x02\x02\x02" + "23\x03\x02\x02\x0235\x03\x02\x02\x024\x18\x03\x02\x02\x024 \x03\x02\x02" + "\x024(\x03\x02\x02\x025\x03\x03\x02\x02\x0269\x05\x06\x04\x0279\x05\f" + "\x07\x0286\x03\x02\x02\x0287\x03\x02\x02\x029\x05\x03\x02\x02\x02:=\x05" + "\n\x06\x02;=\x05\b\x05\x02<:\x03\x02\x02\x02<;\x03\x02\x02\x02=?\x03\x02" + "\x02\x02>@\x05\f\x07\x02?>\x03\x02\x02\x02?@\x03\x02\x02\x02@\x07\x03" + "\x02\x02\x02AD\b\x05\x01\x02BE\x05\x16\f\x02CE\x07\x03\x02\x02DB\x03\x02" + "\x02\x02DC\x03\x02\x02\x02EN\x03\x02\x02\x02FH\f\x03\x02\x02GI\x05\n\x06" + "\x02HG\x03\x02\x02\x02IJ\x03\x02\x02\x02JH\x03\x02\x02\x02JK\x03\x02\x02" + "\x02KM\x03\x02\x02\x02LF\x03\x02\x02\x02MP\x03\x02\x02\x02NL\x03\x02\x02" + "\x02NO\x03\x02\x02\x02O\t\x03\x02\x02\x02PN\x03\x02\x02\x02QR\x05\x0E" + "\b\x02RS\x05\x10\t\x02SW\x03\x02\x02\x02TU\x07\x11\x02\x02UW\x05\x10\t" + "\x02VQ\x03\x02\x02\x02VT\x03\x02\x02\x02W\v\x03\x02\x02\x02XY\x05\x0E" + "\b\x02YZ\x05\x12\n\x02Z^\x03\x02\x02\x02[\\\x07\x11\x02\x02\\^\x05\x12" + "\n\x02]X\x03\x02\x02\x02][\x03\x02\x02\x02^\r\x03\x02\x02\x02_`\x07\x10" + "\x02\x02`d\x07\x11\x02\x02ab\x07\x0F\x02\x02bd\x07\x11\x02\x02c_\x03\x02" + "\x02\x02ca\x03\x02\x02\x02d\x0F\x03\x02\x02\x02ef\t\x02\x02\x02f\x11\x03" + "\x02\x02\x02gh\t\x03\x02\x02h\x13\x03\x02\x02\x02ij\t\x04\x02\x02j\x15" + "\x03\x02\x02\x02km\x07\x11\x02\x02lk\x03\x02\x02\x02mn\x03\x02\x02\x02" + "nl\x03\x02\x02\x02no\x03\x02\x02\x02o\x17\x03\x02\x02\x02\x0E248(visitor: RelativeDateFormatVisitor): Result { if (visitor.visitRangeDirective) { return visitor.visitRangeDirective(this); } else { return visitor.visitChildren(this); } } } export class TrailDirectiveContext extends DirectiveContext { public _end: ResolvableExpressionContext; public _period: RelativeExpressionContext; public SEPERATOR(): TerminalNode[]; public SEPERATOR(i: number): TerminalNode; public SEPERATOR(i?: number): TerminalNode | TerminalNode[] { if (i === undefined) { return this.getTokens(RelativeDateFormatParser.SEPERATOR); } else { return this.getToken(RelativeDateFormatParser.SEPERATOR, i); } } public TRAIL(): TerminalNode { return this.getToken(RelativeDateFormatParser.TRAIL, 0); } public resolvableExpression(): ResolvableExpressionContext { return this.getRuleContext(0, ResolvableExpressionContext); } public relativeExpression(): RelativeExpressionContext | undefined { return this.tryGetRuleContext(0, RelativeExpressionContext); } constructor(ctx: DirectiveContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } // @Override public enterRule(listener: RelativeDateFormatListener): void { if (listener.enterTrailDirective) { listener.enterTrailDirective(this); } } // @Override public exitRule(listener: RelativeDateFormatListener): void { if (listener.exitTrailDirective) { listener.exitTrailDirective(this); } } // @Override public accept(visitor: RelativeDateFormatVisitor): Result { if (visitor.visitTrailDirective) { return visitor.visitTrailDirective(this); } else { return visitor.visitChildren(this); } } } export class PeriodDirectiveContext extends DirectiveContext { public _begin: ResolvableExpressionContext; public _period: RelativeExpressionContext; public _ref: ResolvableExpressionContext; public SEPERATOR(): TerminalNode[]; public SEPERATOR(i: number): TerminalNode; public SEPERATOR(i?: number): TerminalNode | TerminalNode[] { if (i === undefined) { return this.getTokens(RelativeDateFormatParser.SEPERATOR); } else { return this.getToken(RelativeDateFormatParser.SEPERATOR, i); } } public PERIOD(): TerminalNode { return this.getToken(RelativeDateFormatParser.PERIOD, 0); } public resolvableExpression(): ResolvableExpressionContext[]; public resolvableExpression(i: number): ResolvableExpressionContext; public resolvableExpression(i?: number): ResolvableExpressionContext | ResolvableExpressionContext[] { if (i === undefined) { return this.getRuleContexts(ResolvableExpressionContext); } else { return this.getRuleContext(i, ResolvableExpressionContext); } } public relativeExpression(): RelativeExpressionContext | undefined { return this.tryGetRuleContext(0, RelativeExpressionContext); } constructor(ctx: DirectiveContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } // @Override public enterRule(listener: RelativeDateFormatListener): void { if (listener.enterPeriodDirective) { listener.enterPeriodDirective(this); } } // @Override public exitRule(listener: RelativeDateFormatListener): void { if (listener.exitPeriodDirective) { listener.exitPeriodDirective(this); } } // @Override public accept(visitor: RelativeDateFormatVisitor): Result { if (visitor.visitPeriodDirective) { return visitor.visitPeriodDirective(this); } else { return visitor.visitChildren(this); } } } export class RelativeExpressionContext extends ParserRuleContext { public resolvableExpression(): ResolvableExpressionContext | undefined { return this.tryGetRuleContext(0, ResolvableExpressionContext); } public relativePeriod(): RelativePeriodContext | undefined { return this.tryGetRuleContext(0, RelativePeriodContext); } constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override public get ruleIndex(): number { return RelativeDateFormatParser.RULE_relativeExpression; } // @Override public enterRule(listener: RelativeDateFormatListener): void { if (listener.enterRelativeExpression) { listener.enterRelativeExpression(this); } } // @Override public exitRule(listener: RelativeDateFormatListener): void { if (listener.exitRelativeExpression) { listener.exitRelativeExpression(this); } } // @Override public accept(visitor: RelativeDateFormatVisitor): Result { if (visitor.visitRelativeExpression) { return visitor.visitRelativeExpression(this); } else { return visitor.visitChildren(this); } } } export class ResolvableExpressionContext extends ParserRuleContext { public _rel: RelativePeriodContext; public staticPeriod(): StaticPeriodContext | undefined { return this.tryGetRuleContext(0, StaticPeriodContext); } public staticExpression(): StaticExpressionContext | undefined { return this.tryGetRuleContext(0, StaticExpressionContext); } public relativePeriod(): RelativePeriodContext | undefined { return this.tryGetRuleContext(0, RelativePeriodContext); } constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override public get ruleIndex(): number { return RelativeDateFormatParser.RULE_resolvableExpression; } // @Override public enterRule(listener: RelativeDateFormatListener): void { if (listener.enterResolvableExpression) { listener.enterResolvableExpression(this); } } // @Override public exitRule(listener: RelativeDateFormatListener): void { if (listener.exitResolvableExpression) { listener.exitResolvableExpression(this); } } // @Override public accept(visitor: RelativeDateFormatVisitor): Result { if (visitor.visitResolvableExpression) { return visitor.visitResolvableExpression(this); } else { return visitor.visitChildren(this); } } } export class StaticExpressionContext extends ParserRuleContext { public _first: StaticExpressionContext; public _staticPeriod: StaticPeriodContext; public _then: StaticPeriodContext[] = []; public timestamp(): TimestampContext | undefined { return this.tryGetRuleContext(0, TimestampContext); } public NOW(): TerminalNode | undefined { return this.tryGetToken(RelativeDateFormatParser.NOW, 0); } public staticExpression(): StaticExpressionContext | undefined { return this.tryGetRuleContext(0, StaticExpressionContext); } public staticPeriod(): StaticPeriodContext[]; public staticPeriod(i: number): StaticPeriodContext; public staticPeriod(i?: number): StaticPeriodContext | StaticPeriodContext[] { if (i === undefined) { return this.getRuleContexts(StaticPeriodContext); } else { return this.getRuleContext(i, StaticPeriodContext); } } constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override public get ruleIndex(): number { return RelativeDateFormatParser.RULE_staticExpression; } // @Override public enterRule(listener: RelativeDateFormatListener): void { if (listener.enterStaticExpression) { listener.enterStaticExpression(this); } } // @Override public exitRule(listener: RelativeDateFormatListener): void { if (listener.exitStaticExpression) { listener.exitStaticExpression(this); } } // @Override public accept(visitor: RelativeDateFormatVisitor): Result { if (visitor.visitStaticExpression) { return visitor.visitStaticExpression(this); } else { return visitor.visitChildren(this); } } } export class StaticPeriodContext extends ParserRuleContext { public unaryExpr(): UnaryExprContext | undefined { return this.tryGetRuleContext(0, UnaryExprContext); } public staticIdentifier(): StaticIdentifierContext { return this.getRuleContext(0, StaticIdentifierContext); } public NUMBER(): TerminalNode | undefined { return this.tryGetToken(RelativeDateFormatParser.NUMBER, 0); } constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override public get ruleIndex(): number { return RelativeDateFormatParser.RULE_staticPeriod; } // @Override public enterRule(listener: RelativeDateFormatListener): void { if (listener.enterStaticPeriod) { listener.enterStaticPeriod(this); } } // @Override public exitRule(listener: RelativeDateFormatListener): void { if (listener.exitStaticPeriod) { listener.exitStaticPeriod(this); } } // @Override public accept(visitor: RelativeDateFormatVisitor): Result { if (visitor.visitStaticPeriod) { return visitor.visitStaticPeriod(this); } else { return visitor.visitChildren(this); } } } export class RelativePeriodContext extends ParserRuleContext { public unaryExpr(): UnaryExprContext | undefined { return this.tryGetRuleContext(0, UnaryExprContext); } public relativeIdentifier(): RelativeIdentifierContext { return this.getRuleContext(0, RelativeIdentifierContext); } public NUMBER(): TerminalNode | undefined { return this.tryGetToken(RelativeDateFormatParser.NUMBER, 0); } constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override public get ruleIndex(): number { return RelativeDateFormatParser.RULE_relativePeriod; } // @Override public enterRule(listener: RelativeDateFormatListener): void { if (listener.enterRelativePeriod) { listener.enterRelativePeriod(this); } } // @Override public exitRule(listener: RelativeDateFormatListener): void { if (listener.exitRelativePeriod) { listener.exitRelativePeriod(this); } } // @Override public accept(visitor: RelativeDateFormatVisitor): Result { if (visitor.visitRelativePeriod) { return visitor.visitRelativePeriod(this); } else { return visitor.visitChildren(this); } } } export class UnaryExprContext extends ParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override public get ruleIndex(): number { return RelativeDateFormatParser.RULE_unaryExpr; } public copyFrom(ctx: UnaryExprContext): void { super.copyFrom(ctx); } } export class PosUnaryExprContext extends UnaryExprContext { public OP_ADD(): TerminalNode { return this.getToken(RelativeDateFormatParser.OP_ADD, 0); } public NUMBER(): TerminalNode { return this.getToken(RelativeDateFormatParser.NUMBER, 0); } constructor(ctx: UnaryExprContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } // @Override public enterRule(listener: RelativeDateFormatListener): void { if (listener.enterPosUnaryExpr) { listener.enterPosUnaryExpr(this); } } // @Override public exitRule(listener: RelativeDateFormatListener): void { if (listener.exitPosUnaryExpr) { listener.exitPosUnaryExpr(this); } } // @Override public accept(visitor: RelativeDateFormatVisitor): Result { if (visitor.visitPosUnaryExpr) { return visitor.visitPosUnaryExpr(this); } else { return visitor.visitChildren(this); } } } export class NegUnaryExprContext extends UnaryExprContext { public OP_MIN(): TerminalNode { return this.getToken(RelativeDateFormatParser.OP_MIN, 0); } public NUMBER(): TerminalNode { return this.getToken(RelativeDateFormatParser.NUMBER, 0); } constructor(ctx: UnaryExprContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } // @Override public enterRule(listener: RelativeDateFormatListener): void { if (listener.enterNegUnaryExpr) { listener.enterNegUnaryExpr(this); } } // @Override public exitRule(listener: RelativeDateFormatListener): void { if (listener.exitNegUnaryExpr) { listener.exitNegUnaryExpr(this); } } // @Override public accept(visitor: RelativeDateFormatVisitor): Result { if (visitor.visitNegUnaryExpr) { return visitor.visitNegUnaryExpr(this); } else { return visitor.visitChildren(this); } } } export class StaticIdentifierContext extends ParserRuleContext { public SECONDS(): TerminalNode | undefined { return this.tryGetToken(RelativeDateFormatParser.SECONDS, 0); } public MINUTES(): TerminalNode | undefined { return this.tryGetToken(RelativeDateFormatParser.MINUTES, 0); } public HOURS(): TerminalNode | undefined { return this.tryGetToken(RelativeDateFormatParser.HOURS, 0); } public DAYS(): TerminalNode | undefined { return this.tryGetToken(RelativeDateFormatParser.DAYS, 0); } public WEEKS(): TerminalNode | undefined { return this.tryGetToken(RelativeDateFormatParser.WEEKS, 0); } constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override public get ruleIndex(): number { return RelativeDateFormatParser.RULE_staticIdentifier; } // @Override public enterRule(listener: RelativeDateFormatListener): void { if (listener.enterStaticIdentifier) { listener.enterStaticIdentifier(this); } } // @Override public exitRule(listener: RelativeDateFormatListener): void { if (listener.exitStaticIdentifier) { listener.exitStaticIdentifier(this); } } // @Override public accept(visitor: RelativeDateFormatVisitor): Result { if (visitor.visitStaticIdentifier) { return visitor.visitStaticIdentifier(this); } else { return visitor.visitChildren(this); } } } export class RelativeIdentifierContext extends ParserRuleContext { public MONTHS(): TerminalNode | undefined { return this.tryGetToken(RelativeDateFormatParser.MONTHS, 0); } public QUARTERS(): TerminalNode | undefined { return this.tryGetToken(RelativeDateFormatParser.QUARTERS, 0); } public YEARS(): TerminalNode | undefined { return this.tryGetToken(RelativeDateFormatParser.YEARS, 0); } constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override public get ruleIndex(): number { return RelativeDateFormatParser.RULE_relativeIdentifier; } // @Override public enterRule(listener: RelativeDateFormatListener): void { if (listener.enterRelativeIdentifier) { listener.enterRelativeIdentifier(this); } } // @Override public exitRule(listener: RelativeDateFormatListener): void { if (listener.exitRelativeIdentifier) { listener.exitRelativeIdentifier(this); } } // @Override public accept(visitor: RelativeDateFormatVisitor): Result { if (visitor.visitRelativeIdentifier) { return visitor.visitRelativeIdentifier(this); } else { return visitor.visitChildren(this); } } } export class HandlerContext extends ParserRuleContext { public RANGE(): TerminalNode | undefined { return this.tryGetToken(RelativeDateFormatParser.RANGE, 0); } public TRAIL(): TerminalNode | undefined { return this.tryGetToken(RelativeDateFormatParser.TRAIL, 0); } public PERIOD(): TerminalNode | undefined { return this.tryGetToken(RelativeDateFormatParser.PERIOD, 0); } constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override public get ruleIndex(): number { return RelativeDateFormatParser.RULE_handler; } // @Override public enterRule(listener: RelativeDateFormatListener): void { if (listener.enterHandler) { listener.enterHandler(this); } } // @Override public exitRule(listener: RelativeDateFormatListener): void { if (listener.exitHandler) { listener.exitHandler(this); } } // @Override public accept(visitor: RelativeDateFormatVisitor): Result { if (visitor.visitHandler) { return visitor.visitHandler(this); } else { return visitor.visitChildren(this); } } } export class TimestampContext extends ParserRuleContext { public NUMBER(): TerminalNode[]; public NUMBER(i: number): TerminalNode; public NUMBER(i?: number): TerminalNode | TerminalNode[] { if (i === undefined) { return this.getTokens(RelativeDateFormatParser.NUMBER); } else { return this.getToken(RelativeDateFormatParser.NUMBER, i); } } constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override public get ruleIndex(): number { return RelativeDateFormatParser.RULE_timestamp; } // @Override public enterRule(listener: RelativeDateFormatListener): void { if (listener.enterTimestamp) { listener.enterTimestamp(this); } } // @Override public exitRule(listener: RelativeDateFormatListener): void { if (listener.exitTimestamp) { listener.exitTimestamp(this); } } // @Override public accept(visitor: RelativeDateFormatVisitor): Result { if (visitor.visitTimestamp) { return visitor.visitTimestamp(this); } else { return visitor.visitChildren(this); } } }