UNPKG

xdoc-parser

Version:
2,037 lines (1,918 loc) 241 kB
// Generated from XDocSyntaxParser.g4 by ANTLR 4.6-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 { XDocSyntaxParserListener } from './XDocSyntaxParserListener'; import { XDocSyntaxParserVisitor } from './XDocSyntaxParserVisitor'; export class XDocSyntaxParser extends Parser { public static readonly NumberLiteral=1; public static readonly IntegerLiteral=2; public static readonly FloatingPointLiteral=3; public static readonly BooleanLiteral=4; public static readonly CharacterLiteral=5; public static readonly StringLiteral=6; public static readonly NullLiteral=7; public static readonly EXTENDS=8; public static readonly ID=9; public static readonly NEWLINE=10; public static readonly SPACE=11; public static readonly TEXT_CONTENT=12; public static readonly AT=13; public static readonly PLUS=14; public static readonly MINUS=15; public static readonly STAR=16; public static readonly FORWARD_SLASH=17; public static readonly COLON=18; public static readonly PERIOD=19; public static readonly COMMA=20; public static readonly EQUAL=21; public static readonly QUESTION=22; public static readonly AMP=23; public static readonly PIPE=24; public static readonly ARROW=25; public static readonly EXCLAMATION=26; public static readonly INLINE_TAG_START=27; public static readonly BRACE_OPEN=28; public static readonly BRACE_CLOSE=29; public static readonly PAREN_OPEN=30; public static readonly PAREN_CLOSE=31; public static readonly BRACKET_OPEN=32; public static readonly BRACKET_CLOSE=33; public static readonly LESSTHAN=34; public static readonly GREATERTHAN=35; public static readonly RULE_documentation = 0; public static readonly RULE_body = 1; public static readonly RULE_whitespace = 2; public static readonly RULE_annotations = 3; public static readonly RULE_tag = 4; public static readonly RULE_tagName = 5; public static readonly RULE_tagIdentifier = 6; public static readonly RULE_propertyTagIdentifier = 7; public static readonly RULE_optionalTagIdentifier = 8; public static readonly RULE_optionalTagOrIdentifier = 9; public static readonly RULE_identifier = 10; public static readonly RULE_optionalIdentifier = 11; public static readonly RULE_type = 12; public static readonly RULE_lambdaType = 13; public static readonly RULE_formalParameterSequence = 14; public static readonly RULE_parameter = 15; public static readonly RULE_tupleType = 16; public static readonly RULE_tupleTypeSequence = 17; public static readonly RULE_primaryType = 18; public static readonly RULE_identifierOrKeyword = 19; public static readonly RULE_keyword = 20; public static readonly RULE_parenthesizedType = 21; public static readonly RULE_unaryType = 22; public static readonly RULE_objectType = 23; public static readonly RULE_objectPairSequenceType = 24; public static readonly RULE_objectPairType = 25; public static readonly RULE_arrayType = 26; public static readonly RULE_notArrayType = 27; public static readonly RULE_propertyIdentifier = 28; public static readonly RULE_optionalIdentifierOrIdentifier = 29; public static readonly RULE_expression = 30; public static readonly RULE_unaryExpression = 31; public static readonly RULE_arrayExpression = 32; public static readonly RULE_objectExpression = 33; public static readonly RULE_objectPairSequenceExpression = 34; public static readonly RULE_objectPairExpression = 35; public static readonly RULE_lambdaExpression = 36; public static readonly RULE_literalExpression = 37; public static readonly RULE_parenthesizedExpression = 38; public static readonly RULE_description = 39; public static readonly RULE_descriptionLine = 40; public static readonly RULE_descriptionLineStart = 41; public static readonly RULE_descriptionText = 42; public static readonly RULE_descriptionLineElement = 43; public static readonly RULE_descriptionLineText = 44; public static readonly RULE_inlineTag = 45; public static readonly RULE_inlineTagName = 46; public static readonly RULE_inlineTagBody = 47; public static readonly RULE_braceExpression = 48; public static readonly RULE_braceBody = 49; public static readonly RULE_braceText = 50; public static readonly ruleNames: string[] = [ "documentation", "body", "whitespace", "annotations", "tag", "tagName", "tagIdentifier", "propertyTagIdentifier", "optionalTagIdentifier", "optionalTagOrIdentifier", "identifier", "optionalIdentifier", "type", "lambdaType", "formalParameterSequence", "parameter", "tupleType", "tupleTypeSequence", "primaryType", "identifierOrKeyword", "keyword", "parenthesizedType", "unaryType", "objectType", "objectPairSequenceType", "objectPairType", "arrayType", "notArrayType", "propertyIdentifier", "optionalIdentifierOrIdentifier", "expression", "unaryExpression", "arrayExpression", "objectExpression", "objectPairSequenceExpression", "objectPairExpression", "lambdaExpression", "literalExpression", "parenthesizedExpression", "description", "descriptionLine", "descriptionLineStart", "descriptionText", "descriptionLineElement", "descriptionLineText", "inlineTag", "inlineTagName", "inlineTagBody", "braceExpression", "braceBody", "braceText" ]; private static readonly _LITERAL_NAMES: (string | undefined)[] = [ undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, "'extends'", undefined, undefined, undefined, undefined, "'@'", "'+'", "'-'", "'*'", "'/'", "':'", "'.'", "','", "'='", "'?'", "'&'", "'|'", undefined, "'!'", "'{@'", "'{'", "'}'", "'('", "')'", "'['", "']'", "'<'", "'>'" ]; private static readonly _SYMBOLIC_NAMES: (string | undefined)[] = [ undefined, "NumberLiteral", "IntegerLiteral", "FloatingPointLiteral", "BooleanLiteral", "CharacterLiteral", "StringLiteral", "NullLiteral", "EXTENDS", "ID", "NEWLINE", "SPACE", "TEXT_CONTENT", "AT", "PLUS", "MINUS", "STAR", "FORWARD_SLASH", "COLON", "PERIOD", "COMMA", "EQUAL", "QUESTION", "AMP", "PIPE", "ARROW", "EXCLAMATION", "INLINE_TAG_START", "BRACE_OPEN", "BRACE_CLOSE", "PAREN_OPEN", "PAREN_CLOSE", "BRACKET_OPEN", "BRACKET_CLOSE", "LESSTHAN", "GREATERTHAN" ]; public static readonly VOCABULARY: Vocabulary = new VocabularyImpl(XDocSyntaxParser._LITERAL_NAMES, XDocSyntaxParser._SYMBOLIC_NAMES, []); @Override @NotNull public get vocabulary(): Vocabulary { return XDocSyntaxParser.VOCABULARY; } @Override public get grammarFileName(): string { return "XDocSyntaxParser.g4"; } @Override public get ruleNames(): string[] { return XDocSyntaxParser.ruleNames; } @Override public get serializedATN(): string { return XDocSyntaxParser._serializedATN; } constructor(input: TokenStream) { super(input); this._interp = new ParserATNSimulator(XDocSyntaxParser._ATN, this); } public documentation(): DocumentationContext { let _localctx: DocumentationContext = new DocumentationContext(this._ctx, this.state); this.enterRule(_localctx, 0, XDocSyntaxParser.RULE_documentation); let _la: number; try { this.state = 109; this._errHandler.sync(this); switch (this._input.LA(1)) { case XDocSyntaxParser.EOF: this.enterOuterAlt(_localctx, 1); { this.state = 102; this.match(XDocSyntaxParser.EOF); } break; case XDocSyntaxParser.NEWLINE: case XDocSyntaxParser.SPACE: case XDocSyntaxParser.AT: this.enterOuterAlt(_localctx, 2); { this.state = 103; this.body(); this.state = 105; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.NEWLINE) { { this.state = 104; this.match(XDocSyntaxParser.NEWLINE); } } this.state = 107; this.match(XDocSyntaxParser.EOF); } 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; } public body(): BodyContext { let _localctx: BodyContext = new BodyContext(this._ctx, this.state); this.enterRule(_localctx, 2, XDocSyntaxParser.RULE_body); let _la: number; try { this.enterOuterAlt(_localctx, 1); { this.state = 114; this._errHandler.sync(this); _la = this._input.LA(1); while (_la===XDocSyntaxParser.NEWLINE || _la===XDocSyntaxParser.SPACE) { { { this.state = 111; this.whitespace(); } } this.state = 116; this._errHandler.sync(this); _la = this._input.LA(1); } this.state = 117; this.annotations(); } } 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 whitespace(): WhitespaceContext { let _localctx: WhitespaceContext = new WhitespaceContext(this._ctx, this.state); this.enterRule(_localctx, 4, XDocSyntaxParser.RULE_whitespace); let _la: number; try { this.enterOuterAlt(_localctx, 1); { this.state = 119; _la = this._input.LA(1); if ( !(_la===XDocSyntaxParser.NEWLINE || _la===XDocSyntaxParser.SPACE) ) { 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; } public annotations(): AnnotationsContext { let _localctx: AnnotationsContext = new AnnotationsContext(this._ctx, this.state); this.enterRule(_localctx, 6, XDocSyntaxParser.RULE_annotations); try { let _alt: number; this.enterOuterAlt(_localctx, 1); { this.state = 121; this.tag(); this.state = 126; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input,3,this._ctx); while ( _alt!==2 && _alt!==ATN.INVALID_ALT_NUMBER ) { if ( _alt===1 ) { { { this.state = 122; this.match(XDocSyntaxParser.NEWLINE); this.state = 123; this.tag(); } } } this.state = 128; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input,3,this._ctx); } } } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); this._errHandler.recover(this, re); } else { throw re; } } finally { this.exitRule(); } return _localctx; } public tag(): TagContext { let _localctx: TagContext = new TagContext(this._ctx, this.state); this.enterRule(_localctx, 8, XDocSyntaxParser.RULE_tag); let _la: number; try { this.state = 288; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input,29,this._ctx) ) { case 1: this.enterOuterAlt(_localctx, 1); { this.state = 129; this.tagName(); } break; case 2: this.enterOuterAlt(_localctx, 2); { this.state = 130; this.tagName(); this.state = 131; this.match(XDocSyntaxParser.SPACE); this.state = 133; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.NEWLINE) { { this.state = 132; this.match(XDocSyntaxParser.NEWLINE); } } this.state = 135; this.match(XDocSyntaxParser.MINUS); this.state = 136; this.match(XDocSyntaxParser.SPACE); this.state = 137; this.description(); } break; case 3: this.enterOuterAlt(_localctx, 3); { this.state = 139; this.tagName(); this.state = 140; this.match(XDocSyntaxParser.SPACE); this.state = 141; this.tagIdentifier(); } break; case 4: this.enterOuterAlt(_localctx, 4); { this.state = 143; this.tagName(); this.state = 144; this.match(XDocSyntaxParser.SPACE); this.state = 145; this.tagIdentifier(); this.state = 147; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.SPACE) { { this.state = 146; this.match(XDocSyntaxParser.SPACE); } } this.state = 149; this.match(XDocSyntaxParser.EQUAL); this.state = 151; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.SPACE) { { this.state = 150; this.match(XDocSyntaxParser.SPACE); } } this.state = 153; this.expression(0); } break; case 5: this.enterOuterAlt(_localctx, 5); { this.state = 155; this.tagName(); this.state = 156; this.match(XDocSyntaxParser.SPACE); this.state = 157; this.tagIdentifier(); this.state = 158; this.match(XDocSyntaxParser.SPACE); this.state = 160; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.NEWLINE) { { this.state = 159; this.match(XDocSyntaxParser.NEWLINE); } } this.state = 162; this.match(XDocSyntaxParser.MINUS); this.state = 163; this.match(XDocSyntaxParser.SPACE); this.state = 164; this.description(); } break; case 6: this.enterOuterAlt(_localctx, 6); { this.state = 166; this.tagName(); this.state = 167; this.match(XDocSyntaxParser.SPACE); this.state = 168; this.tagIdentifier(); this.state = 169; this.match(XDocSyntaxParser.SPACE); this.state = 170; this.match(XDocSyntaxParser.EQUAL); this.state = 172; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.SPACE) { { this.state = 171; this.match(XDocSyntaxParser.SPACE); } } this.state = 174; this.expression(0); this.state = 175; this.match(XDocSyntaxParser.SPACE); this.state = 177; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.NEWLINE) { { this.state = 176; this.match(XDocSyntaxParser.NEWLINE); } } this.state = 179; this.match(XDocSyntaxParser.MINUS); this.state = 180; this.match(XDocSyntaxParser.SPACE); this.state = 181; this.description(); } break; case 7: this.enterOuterAlt(_localctx, 7); { this.state = 183; this.tagName(); this.state = 184; this.match(XDocSyntaxParser.SPACE); this.state = 185; this.tagIdentifier(); this.state = 187; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.SPACE) { { this.state = 186; this.match(XDocSyntaxParser.SPACE); } } this.state = 189; this.match(XDocSyntaxParser.COLON); this.state = 191; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.SPACE) { { this.state = 190; this.match(XDocSyntaxParser.SPACE); } } this.state = 193; this.type(0); } break; case 8: this.enterOuterAlt(_localctx, 8); { this.state = 195; this.tagName(); this.state = 196; this.match(XDocSyntaxParser.SPACE); this.state = 197; this.tagIdentifier(); this.state = 199; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.SPACE) { { this.state = 198; this.match(XDocSyntaxParser.SPACE); } } this.state = 201; this.match(XDocSyntaxParser.COLON); this.state = 203; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.SPACE) { { this.state = 202; this.match(XDocSyntaxParser.SPACE); } } this.state = 205; this.type(0); this.state = 207; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.SPACE) { { this.state = 206; this.match(XDocSyntaxParser.SPACE); } } this.state = 209; this.match(XDocSyntaxParser.EQUAL); this.state = 211; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.SPACE) { { this.state = 210; this.match(XDocSyntaxParser.SPACE); } } this.state = 213; this.expression(0); } break; case 9: this.enterOuterAlt(_localctx, 9); { this.state = 215; this.tagName(); this.state = 216; this.match(XDocSyntaxParser.SPACE); this.state = 217; this.tagIdentifier(); this.state = 219; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.SPACE) { { this.state = 218; this.match(XDocSyntaxParser.SPACE); } } this.state = 221; this.match(XDocSyntaxParser.COLON); this.state = 223; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.SPACE) { { this.state = 222; this.match(XDocSyntaxParser.SPACE); } } this.state = 225; this.type(0); this.state = 226; this.match(XDocSyntaxParser.SPACE); this.state = 228; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.NEWLINE) { { this.state = 227; this.match(XDocSyntaxParser.NEWLINE); } } this.state = 230; this.match(XDocSyntaxParser.MINUS); this.state = 231; this.match(XDocSyntaxParser.SPACE); this.state = 232; this.description(); } break; case 10: this.enterOuterAlt(_localctx, 10); { this.state = 234; this.tagName(); this.state = 235; this.match(XDocSyntaxParser.SPACE); this.state = 236; this.tagIdentifier(); this.state = 238; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.SPACE) { { this.state = 237; this.match(XDocSyntaxParser.SPACE); } } this.state = 240; this.match(XDocSyntaxParser.COLON); this.state = 242; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.SPACE) { { this.state = 241; this.match(XDocSyntaxParser.SPACE); } } this.state = 244; this.type(0); this.state = 246; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.SPACE) { { this.state = 245; this.match(XDocSyntaxParser.SPACE); } } this.state = 248; this.match(XDocSyntaxParser.EQUAL); this.state = 250; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.SPACE) { { this.state = 249; this.match(XDocSyntaxParser.SPACE); } } this.state = 252; this.expression(0); this.state = 253; this.match(XDocSyntaxParser.SPACE); this.state = 255; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.NEWLINE) { { this.state = 254; this.match(XDocSyntaxParser.NEWLINE); } } this.state = 257; this.match(XDocSyntaxParser.MINUS); this.state = 258; this.match(XDocSyntaxParser.SPACE); this.state = 259; this.description(); } break; case 11: this.enterOuterAlt(_localctx, 11); { this.state = 261; this.tagName(); this.state = 263; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.SPACE) { { this.state = 262; this.match(XDocSyntaxParser.SPACE); } } this.state = 265; this.match(XDocSyntaxParser.COLON); this.state = 267; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.SPACE) { { this.state = 266; this.match(XDocSyntaxParser.SPACE); } } this.state = 269; this.type(0); } break; case 12: this.enterOuterAlt(_localctx, 12); { this.state = 271; this.tagName(); this.state = 273; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.SPACE) { { this.state = 272; this.match(XDocSyntaxParser.SPACE); } } this.state = 275; this.match(XDocSyntaxParser.COLON); this.state = 277; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.SPACE) { { this.state = 276; this.match(XDocSyntaxParser.SPACE); } } this.state = 279; this.type(0); this.state = 280; this.match(XDocSyntaxParser.SPACE); this.state = 282; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.NEWLINE) { { this.state = 281; this.match(XDocSyntaxParser.NEWLINE); } } this.state = 284; this.match(XDocSyntaxParser.MINUS); this.state = 285; this.match(XDocSyntaxParser.SPACE); this.state = 286; this.description(); } 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; } public tagName(): TagNameContext { let _localctx: TagNameContext = new TagNameContext(this._ctx, this.state); this.enterRule(_localctx, 10, XDocSyntaxParser.RULE_tagName); try { this.enterOuterAlt(_localctx, 1); { this.state = 290; this.match(XDocSyntaxParser.AT); this.state = 291; this.identifier(); } } 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 tagIdentifier(): TagIdentifierContext { let _localctx: TagIdentifierContext = new TagIdentifierContext(this._ctx, this.state); this.enterRule(_localctx, 12, XDocSyntaxParser.RULE_tagIdentifier); try { this.state = 296; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input,30,this._ctx) ) { case 1: this.enterOuterAlt(_localctx, 1); { this.state = 293; this.propertyTagIdentifier(); } break; case 2: this.enterOuterAlt(_localctx, 2); { this.state = 294; this.optionalTagIdentifier(); } break; case 3: this.enterOuterAlt(_localctx, 3); { this.state = 295; this.identifier(); } 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; } public propertyTagIdentifier(): PropertyTagIdentifierContext { let _localctx: PropertyTagIdentifierContext = new PropertyTagIdentifierContext(this._ctx, this.state); this.enterRule(_localctx, 14, XDocSyntaxParser.RULE_propertyTagIdentifier); let _la: number; try { this.state = 312; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input,33,this._ctx) ) { case 1: this.enterOuterAlt(_localctx, 1); { this.state = 298; this.optionalTagIdentifier(); this.state = 301; this._errHandler.sync(this); _la = this._input.LA(1); do { { { this.state = 299; this.match(XDocSyntaxParser.PERIOD); this.state = 300; this.optionalTagOrIdentifier(); } } this.state = 303; this._errHandler.sync(this); _la = this._input.LA(1); } while ( _la===XDocSyntaxParser.PERIOD ); } break; case 2: this.enterOuterAlt(_localctx, 2); { this.state = 305; this.identifier(); this.state = 308; this._errHandler.sync(this); _la = this._input.LA(1); do { { { this.state = 306; this.match(XDocSyntaxParser.PERIOD); this.state = 307; this.optionalTagOrIdentifier(); } } this.state = 310; this._errHandler.sync(this); _la = this._input.LA(1); } while ( _la===XDocSyntaxParser.PERIOD ); } 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; } public optionalTagIdentifier(): OptionalTagIdentifierContext { let _localctx: OptionalTagIdentifierContext = new OptionalTagIdentifierContext(this._ctx, this.state); this.enterRule(_localctx, 16, XDocSyntaxParser.RULE_optionalTagIdentifier); try { this.enterOuterAlt(_localctx, 1); { this.state = 314; this.optionalIdentifier(); } } 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 optionalTagOrIdentifier(): OptionalTagOrIdentifierContext { let _localctx: OptionalTagOrIdentifierContext = new OptionalTagOrIdentifierContext(this._ctx, this.state); this.enterRule(_localctx, 18, XDocSyntaxParser.RULE_optionalTagOrIdentifier); try { this.state = 318; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input,34,this._ctx) ) { case 1: this.enterOuterAlt(_localctx, 1); { this.state = 316; this.optionalTagIdentifier(); } break; case 2: this.enterOuterAlt(_localctx, 2); { this.state = 317; this.identifier(); } 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; } public identifier(): IdentifierContext { let _localctx: IdentifierContext = new IdentifierContext(this._ctx, this.state); this.enterRule(_localctx, 20, XDocSyntaxParser.RULE_identifier); try { this.enterOuterAlt(_localctx, 1); { this.state = 320; this.match(XDocSyntaxParser.ID); } } 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 optionalIdentifier(): OptionalIdentifierContext { let _localctx: OptionalIdentifierContext = new OptionalIdentifierContext(this._ctx, this.state); this.enterRule(_localctx, 22, XDocSyntaxParser.RULE_optionalIdentifier); try { this.enterOuterAlt(_localctx, 1); { this.state = 322; this.identifier(); this.state = 323; this.match(XDocSyntaxParser.QUESTION); } } 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 type(): TypeContext; public type(_p: number): TypeContext; public type(_p?: number): TypeContext { if (_p === undefined) { _p = 0; } let _parentctx: ParserRuleContext = this._ctx; let _parentState: number = this.state; let _localctx: TypeContext = new TypeContext(this._ctx, _parentState); let _prevctx: TypeContext = _localctx; let _startState: number = 24; this.enterRecursionRule(_localctx, 24, XDocSyntaxParser.RULE_type, _p); let _la: number; try { let _alt: number; this.enterOuterAlt(_localctx, 1); { this.state = 333; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input,35,this._ctx) ) { case 1: { this.state = 326; this.lambdaType(); } break; case 2: { this.state = 327; this.tupleType(); } break; case 3: { this.state = 328; this.primaryType(); } break; case 4: { this.state = 329; this.parenthesizedType(); } break; case 5: { this.state = 330; this.unaryType(); } break; case 6: { this.state = 331; this.objectType(); } break; case 7: { this.state = 332; this.arrayType(); } break; } this._ctx._stop = this._input.tryLT(-1); this.state = 358; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input,42,this._ctx); while ( _alt!==2 && _alt!==ATN.INVALID_ALT_NUMBER ) { if ( _alt===1 ) { if ( this._parseListeners!=null ) this.triggerExitRuleEvent(); _prevctx = _localctx; { { _localctx = new TypeContext(_parentctx, _parentState); this.pushNewRecursionContext(_localctx, _startState, XDocSyntaxParser.RULE_type); this.state = 335; if (!(this.precpred(this._ctx, 8))) throw new FailedPredicateException(this, "this.precpred(this._ctx, 8)"); this.state = 337; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input,36,this._ctx) ) { case 1: { this.state = 336; this.match(XDocSyntaxParser.SPACE); } break; } this.state = 340; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.NEWLINE) { { this.state = 339; this.match(XDocSyntaxParser.NEWLINE); } } this.state = 343; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.SPACE) { { this.state = 342; this.match(XDocSyntaxParser.SPACE); } } this.state = 345; _la = this._input.LA(1); if ( !(_la===XDocSyntaxParser.AMP || _la===XDocSyntaxParser.PIPE) ) { this._errHandler.recoverInline(this); } else { if (this._input.LA(1) === Token.EOF) { this.matchedEOF = true; } this._errHandler.reportMatch(this); this.consume(); } this.state = 347; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input,39,this._ctx) ) { case 1: { this.state = 346; this.match(XDocSyntaxParser.SPACE); } break; } this.state = 350; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.NEWLINE) { { this.state = 349; this.match(XDocSyntaxParser.NEWLINE); } } this.state = 353; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.SPACE) { { this.state = 352; this.match(XDocSyntaxParser.SPACE); } } this.state = 355; this.type(9); } } } this.state = 360; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input,42,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; } public lambdaType(): LambdaTypeContext { let _localctx: LambdaTypeContext = new LambdaTypeContext(this._ctx, this.state); this.enterRule(_localctx, 26, XDocSyntaxParser.RULE_lambdaType); let _la: number; try { this.state = 431; this._errHandler.sync(this); switch (this._input.LA(1)) { case XDocSyntaxParser.PAREN_OPEN: this.enterOuterAlt(_localctx, 1); { this.state = 361; this.match(XDocSyntaxParser.PAREN_OPEN); this.state = 363; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input,43,this._ctx) ) { case 1: { this.state = 362; this.match(XDocSyntaxParser.SPACE); } break; } this.state = 366; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input,44,this._ctx) ) { case 1: { this.state = 365; this.match(XDocSyntaxParser.NEWLINE); } break; } this.state = 369; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input,45,this._ctx) ) { case 1: { this.state = 368; this.match(XDocSyntaxParser.SPACE); } break; } this.state = 372; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.ID) { { this.state = 371; this.formalParameterSequence(); } } this.state = 375; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input,47,this._ctx) ) { case 1: { this.state = 374; this.match(XDocSyntaxParser.SPACE); } break; } this.state = 378; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.NEWLINE) { { this.state = 377; this.match(XDocSyntaxParser.NEWLINE); } } this.state = 381; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.SPACE) { { this.state = 380; this.match(XDocSyntaxParser.SPACE); } } this.state = 383; this.match(XDocSyntaxParser.PAREN_CLOSE); this.state = 385; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input,50,this._ctx) ) { case 1: { this.state = 384; this.match(XDocSyntaxParser.SPACE); } break; } this.state = 388; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.NEWLINE) { { this.state = 387; this.match(XDocSyntaxParser.NEWLINE); } } this.state = 391; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.SPACE) { { this.state = 390; this.match(XDocSyntaxParser.SPACE); } } this.state = 393; this.match(XDocSyntaxParser.ARROW); this.state = 395; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input,53,this._ctx) ) { case 1: { this.state = 394; this.match(XDocSyntaxParser.SPACE); } break; } this.state = 398; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.NEWLINE) { { this.state = 397; this.match(XDocSyntaxParser.NEWLINE); } } this.state = 401; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.SPACE) { { this.state = 400; this.match(XDocSyntaxParser.SPACE); } } this.state = 403; this.type(0); this.state = 405; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input,56,this._ctx) ) { case 1: { this.state = 404; this.match(XDocSyntaxParser.QUESTION); } break; } } break; case XDocSyntaxParser.ID: this.enterOuterAlt(_localctx, 2); { this.state = 407; this.parameter(); this.state = 409; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input,57,this._ctx) ) { case 1: { this.state = 408; this.match(XDocSyntaxParser.SPACE); } break; } this.state = 412; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.NEWLINE) { { this.state = 411; this.match(XDocSyntaxParser.NEWLINE); } } this.state = 415; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.SPACE) { { this.state = 414; this.match(XDocSyntaxParser.SPACE); } } this.state = 417; this.match(XDocSyntaxParser.ARROW); this.state = 419; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input,60,this._ctx) ) { case 1: { this.state = 418; this.match(XDocSyntaxParser.SPACE); } break; } this.state = 422; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.NEWLINE) { { this.state = 421; this.match(XDocSyntaxParser.NEWLINE); } } this.state = 425; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.SPACE) { { this.state = 424; this.match(XDocSyntaxParser.SPACE); } } this.state = 427; this.type(0); this.state = 429; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input,63,this._ctx) ) { case 1: { this.state = 428; this.match(XDocSyntaxParser.QUESTION); } break; } } 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; } public formalParameterSequence(): FormalParameterSequenceContext { let _localctx: FormalParameterSequenceContext = new FormalParameterSequenceContext(this._ctx, this.state); this.enterRule(_localctx, 28, XDocSyntaxParser.RULE_formalParameterSequence); let _la: number; try { this.enterOuterAlt(_localctx, 1); { this.state = 433; this.parameter(); this.state = 444; this._errHandler.sync(this); _la = this._input.LA(1); while (_la===XDocSyntaxParser.COMMA) { { { this.state = 434; this.match(XDocSyntaxParser.COMMA); this.state = 436; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.NEWLINE) { { this.state = 435; this.match(XDocSyntaxParser.NEWLINE); } } this.state = 439; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.SPACE) { { this.state = 438; this.match(XDocSyntaxParser.SPACE); } } this.state = 441; this.parameter(); } } this.state = 446; 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; } public parameter(): ParameterContext { let _localctx: ParameterContext = new ParameterContext(this._ctx, this.state); this.enterRule(_localctx, 30, XDocSyntaxParser.RULE_parameter); let _la: number; try { this.enterOuterAlt(_localctx, 1); { this.state = 447; this.identifier(); this.state = 456; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input,70,this._ctx) ) { case 1: { this.state = 449; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.SPACE) { { this.state = 448; this.match(XDocSyntaxParser.SPACE); } } this.state = 451; this.match(XDocSyntaxParser.COLON); this.state = 453; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.SPACE) { { this.state = 452; this.match(XDocSyntaxParser.SPACE); } } this.state = 455; this.type(0); } 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; } public tupleType(): TupleTypeContext { let _localctx: TupleTypeContext = new TupleTypeContext(this._ctx, this.state); this.enterRule(_localctx, 32, XDocSyntaxParser.RULE_tupleType); let _la: number; try { this.enterOuterAlt(_localctx, 1); { this.state = 459; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.ID) { { this.state = 458; this.identifier(); } } this.state = 461; this.match(XDocSyntaxParser.LESSTHAN); this.state = 463; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.SPACE) { { this.state = 462; this.match(XDocSyntaxParser.SPACE); } } this.state = 465; this.tupleTypeSequence(); this.state = 467; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.SPACE) { { this.state = 466; this.match(XDocSyntaxParser.SPACE); } } this.state = 469; this.match(XDocSyntaxParser.GREATERTHAN); } } 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 tupleTypeSequence(): TupleTypeSequenceContext { let _localctx: TupleTypeSequenceContext = new TupleTypeSequenceContext(this._ctx, this.state); this.enterRule(_localctx, 34, XDocSyntaxParser.RULE_tupleTypeSequence); let _la: number; try { let _alt: number; this.state = 551; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input,92,this._ctx) ) { case 1: this.enterOuterAlt(_localctx, 1); { this.state = 471; this.primaryType(); this.state = 473; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input,74,this._ctx) ) { case 1: { this.state = 472; this.match(XDocSyntaxParser.SPACE); } break; } this.state = 482; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input,76,this._ctx); while ( _alt!==2 && _alt!==ATN.INVALID_ALT_NUMBER ) { if ( _alt===1 ) { { { this.state = 475; this.match(XDocSyntaxParser.COMMA); this.state = 477; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.SPACE) { { this.state = 476; this.match(XDocSyntaxParser.SPACE); } } this.state = 479; this.tupleTypeSequence(); } } } this.state = 484; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input,76,this._ctx); } } break; case 2: this.enterOuterAlt(_localctx, 2); { this.state = 485; this.primaryType(); this.state = 487; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.SPACE) { { this.state = 486; this.match(XDocSyntaxParser.SPACE); } } this.state = 489; this.match(XDocSyntaxParser.EXTENDS); this.state = 491; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.SPACE) { { this.state = 490; this.match(XDocSyntaxParser.SPACE); } } this.state = 493; this.primaryType(); this.state = 495; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input,79,this._ctx) ) { case 1: { this.state = 494; this.match(XDocSyntaxParser.SPACE); } break; } this.state = 504; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input,81,this._ctx); while ( _alt!==2 && _alt!==ATN.INVALID_ALT_NUMBER ) { if ( _alt===1 ) { { { this.state = 497; this.match(XDocSyntaxParser.COMMA); this.state = 499; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.SPACE) { { this.state = 498; this.match(XDocSyntaxParser.SPACE); } } this.state = 501; this.tupleTypeSequence(); } } } this.state = 506; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input,81,this._ctx); } } break; case 3: this.enterOuterAlt(_localctx, 3); { this.state = 507; this.primaryType(); this.state = 509; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.SPACE) { { this.state = 508; this.match(XDocSyntaxParser.SPACE); } } this.state = 511; this.match(XDocSyntaxParser.AMP); this.state = 513; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.SPACE) { { this.state = 512; this.match(XDocSyntaxParser.SPACE); } } this.state = 515; this.primaryType(); this.state = 517; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input,84,this._ctx) ) { case 1: { this.state = 516; this.match(XDocSyntaxParser.SPACE); } break; } this.state = 526; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input,86,this._ctx); while ( _alt!==2 && _alt!==ATN.INVALID_ALT_NUMBER ) { if ( _alt===1 ) { { { this.state = 519; this.match(XDocSyntaxParser.COMMA); this.state = 521; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.SPACE) { { this.state = 520; this.match(XDocSyntaxParser.SPACE); } } this.state = 523; this.tupleTypeSequence(); } } } this.state = 528; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input,86,this._ctx); } } break; case 4: this.enterOuterAlt(_localctx, 4); { this.state = 529; this.primaryType(); this.state = 531; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.SPACE) { { this.state = 530; this.match(XDocSyntaxParser.SPACE); } } this.state = 533; this.match(XDocSyntaxParser.PIPE); this.state = 535; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.SPACE) { { this.state = 534; this.match(XDocSyntaxParser.SPACE); } } this.state = 537; this.primaryType(); this.state = 539; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input,89,this._ctx) ) { case 1: { this.state = 538; this.match(XDocSyntaxParser.SPACE); } break; } this.state = 548; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input,91,this._ctx); while ( _alt!==2 && _alt!==ATN.INVALID_ALT_NUMBER ) { if ( _alt===1 ) { { { this.state = 541; this.match(XDocSyntaxParser.COMMA); this.state = 543; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===XDocSyntaxParser.SPACE) { { this.state = 542; this.match(XDocSyntaxParser.SPACE); } } this.state = 545; this.tupleTypeSequence(); } } } this.state = 550; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input,91,this._ctx); } } break; } } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); this._errHandler.recover(this, re); } else { throw re; } } finally { this.exitRule(); } return _localctx; } public primaryType(): PrimaryTypeContext { let _localctx: PrimaryTypeContext = new PrimaryTypeContext(this._ctx, this.state); this.enterRule(_localctx, 36, XDocSyntaxParser.RULE_primaryType); try { this.state = 556; this._errHandler.sync(this); switch ( this.interpreter.adaptivePredict(this._input,93,this._ctx) ) { case 1: this.enterOuterAlt(_localctx, 1); { this.state = 553; this.optionalIdentifier(); } break; case 2: this.enterOuterAlt(_localctx, 2); { this.state = 554; this.propertyIdentifier(); } break; case 3: this.enterOuterAlt(_localctx, 3); { this.state = 555; this.identifierOrKeyword(); } break; } } catch (re) { if (re instanceof RecognitionEx