@maniascript/api
Version:
Maniascript API generator
1,173 lines • 69.4 kB
JavaScript
import * as antlr from "antlr4ng";
import { Token } from "antlr4ng";
import { DocParserVisitor } from "./DocParserVisitor.js";
export class DocParser extends antlr.Parser {
static SINGLE_LINE_COMMENT = 1;
static MULTI_LINES_DOC_COMMENT = 2;
static MULTI_LINES_COMMENT = 3;
static ARRAY_IGNORE = 4;
static TEMPLATE_IGNORE = 5;
static KEYWORD_STRUCT = 6;
static KEYWORD_CLASS = 7;
static KEYWORD_PUBLIC = 8;
static KEYWORD_ENUM = 9;
static KEYWORD_CONST = 10;
static KEYWORD_ARRAY = 11;
static KEYWORD_RESERVED = 12;
static KEYWORD_UNUSED = 13;
static KEYWORD_NAMESPACE = 14;
static TYPE_BOOLEAN = 15;
static TYPE_IDENT = 16;
static TYPE_INT2 = 17;
static TYPE_INT3 = 18;
static TYPE_INTEGER = 19;
static TYPE_REAL = 20;
static TYPE_TEXT = 21;
static TYPE_VEC2 = 22;
static TYPE_VEC3 = 23;
static TYPE_VOID = 24;
static OPERATOR_COLON = 25;
static OPERATOR_DOUBLECOLON = 26;
static OPERATOR_COMMA = 27;
static OPERATOR_ASSIGN = 28;
static OPERATOR_SEMICOLON = 29;
static OPERATOR_OPEN_BRACE = 30;
static OPERATOR_CLOSE_BRACE = 31;
static OPERATOR_OPEN_ANGLE = 32;
static OPERATOR_CLOSE_ANGLE = 33;
static OPERATOR_OPEN_PAREN = 34;
static OPERATOR_CLOSE_PAREN = 35;
static OPERATOR_OPEN_BRACKET = 36;
static OPERATOR_CLOSE_BRACKET = 37;
static OPERATOR_POINTER = 38;
static LITERAL_REAL = 39;
static IDENTIFIER = 40;
static WHITESPACE = 41;
static LINE_TERMINATOR = 42;
static RULE_program = 0;
static RULE_typeDeclaration = 1;
static RULE_classDeclaration = 2;
static RULE_namespaceDeclaration = 3;
static RULE_memberDeclarationList = 4;
static RULE_variableDeclaration = 5;
static RULE_functionDeclaration = 6;
static RULE_functionParameterList = 7;
static RULE_functionParameter = 8;
static RULE_enumDeclaration = 9;
static RULE_enumValueList = 10;
static RULE_enumValue = 11;
static RULE_type = 12;
static RULE_typeArray = 13;
static RULE_typeArrayValue = 14;
static RULE_typeClass = 15;
static RULE_typeEnum = 16;
static RULE_typeLiteral = 17;
static literalNames = [
null, null, null, null, null, null, "'struct'", "'class'", "'public'",
"'enum'", "'const'", "'Array'", "'(reserved)'", "'*unused*'", "'namespace'",
"'Boolean'", "'Ident'", "'Int2'", "'Int3'", "'Integer'", "'Real'",
"'Text'", "'Vec2'", "'Vec3'", "'Void'", "':'", "'::'", "','", "'='",
"';'", "'{'", "'}'", "'<'", "'>'", "'('", "')'", "'['", "']'", "'*'"
];
static symbolicNames = [
null, "SINGLE_LINE_COMMENT", "MULTI_LINES_DOC_COMMENT", "MULTI_LINES_COMMENT",
"ARRAY_IGNORE", "TEMPLATE_IGNORE", "KEYWORD_STRUCT", "KEYWORD_CLASS",
"KEYWORD_PUBLIC", "KEYWORD_ENUM", "KEYWORD_CONST", "KEYWORD_ARRAY",
"KEYWORD_RESERVED", "KEYWORD_UNUSED", "KEYWORD_NAMESPACE", "TYPE_BOOLEAN",
"TYPE_IDENT", "TYPE_INT2", "TYPE_INT3", "TYPE_INTEGER", "TYPE_REAL",
"TYPE_TEXT", "TYPE_VEC2", "TYPE_VEC3", "TYPE_VOID", "OPERATOR_COLON",
"OPERATOR_DOUBLECOLON", "OPERATOR_COMMA", "OPERATOR_ASSIGN", "OPERATOR_SEMICOLON",
"OPERATOR_OPEN_BRACE", "OPERATOR_CLOSE_BRACE", "OPERATOR_OPEN_ANGLE",
"OPERATOR_CLOSE_ANGLE", "OPERATOR_OPEN_PAREN", "OPERATOR_CLOSE_PAREN",
"OPERATOR_OPEN_BRACKET", "OPERATOR_CLOSE_BRACKET", "OPERATOR_POINTER",
"LITERAL_REAL", "IDENTIFIER", "WHITESPACE", "LINE_TERMINATOR"
];
static ruleNames = [
"program", "typeDeclaration", "classDeclaration", "namespaceDeclaration",
"memberDeclarationList", "variableDeclaration", "functionDeclaration",
"functionParameterList", "functionParameter", "enumDeclaration",
"enumValueList", "enumValue", "type", "typeArray", "typeArrayValue",
"typeClass", "typeEnum", "typeLiteral",
];
get grammarFileName() { return "DocParser.g4"; }
get literalNames() { return DocParser.literalNames; }
get symbolicNames() { return DocParser.symbolicNames; }
get ruleNames() { return DocParser.ruleNames; }
get serializedATN() { return DocParser._serializedATN; }
createFailedPredicateException(predicate, message) {
return new antlr.FailedPredicateException(this, predicate, message);
}
constructor(input) {
super(input);
this.interpreter = new antlr.ParserATNSimulator(this, DocParser._ATN, DocParser.decisionsToDFA, new antlr.PredictionContextCache());
}
program() {
let localContext = new ProgramContext(this.context, this.state);
this.enterRule(localContext, 0, DocParser.RULE_program);
let _la;
try {
this.enterOuterAlt(localContext, 1);
{
this.state = 41;
this.errorHandler.sync(this);
_la = this.tokenStream.LA(1);
while ((((_la) & ~0x1F) === 0 && ((1 << _la) & 16576) !== 0)) {
{
this.state = 39;
this.errorHandler.sync(this);
switch (this.interpreter.adaptivePredict(this.tokenStream, 0, this.context)) {
case 1:
{
this.state = 36;
this.typeDeclaration();
}
break;
case 2:
{
this.state = 37;
this.classDeclaration();
}
break;
case 3:
{
this.state = 38;
this.namespaceDeclaration();
}
break;
}
}
this.state = 43;
this.errorHandler.sync(this);
_la = this.tokenStream.LA(1);
}
this.state = 44;
this.match(DocParser.EOF);
}
}
catch (re) {
if (re instanceof antlr.RecognitionException) {
this.errorHandler.reportError(this, re);
this.errorHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localContext;
}
typeDeclaration() {
let localContext = new TypeDeclarationContext(this.context, this.state);
this.enterRule(localContext, 2, DocParser.RULE_typeDeclaration);
let _la;
try {
this.enterOuterAlt(localContext, 1);
{
this.state = 46;
_la = this.tokenStream.LA(1);
if (!(_la === 6 || _la === 7)) {
this.errorHandler.recoverInline(this);
}
else {
this.errorHandler.reportMatch(this);
this.consume();
}
this.state = 47;
this.typeLiteral();
this.state = 48;
this.match(DocParser.OPERATOR_OPEN_BRACE);
this.state = 50;
this.errorHandler.sync(this);
_la = this.tokenStream.LA(1);
if (((((_la - 9)) & ~0x1F) === 0 && ((1 << (_la - 9)) & 2147549127) !== 0)) {
{
this.state = 49;
localContext._content = this.memberDeclarationList();
}
}
this.state = 52;
this.match(DocParser.OPERATOR_CLOSE_BRACE);
this.state = 53;
this.match(DocParser.OPERATOR_SEMICOLON);
}
}
catch (re) {
if (re instanceof antlr.RecognitionException) {
this.errorHandler.reportError(this, re);
this.errorHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localContext;
}
classDeclaration() {
let localContext = new ClassDeclarationContext(this.context, this.state);
this.enterRule(localContext, 4, DocParser.RULE_classDeclaration);
let _la;
try {
this.state = 83;
this.errorHandler.sync(this);
switch (this.tokenStream.LA(1)) {
case DocParser.KEYWORD_CLASS:
this.enterOuterAlt(localContext, 1);
{
this.state = 55;
this.match(DocParser.KEYWORD_CLASS);
this.state = 56;
localContext._name = this.match(DocParser.IDENTIFIER);
this.state = 60;
this.errorHandler.sync(this);
_la = this.tokenStream.LA(1);
if (_la === 25) {
{
this.state = 57;
this.match(DocParser.OPERATOR_COLON);
this.state = 58;
this.match(DocParser.KEYWORD_PUBLIC);
this.state = 59;
localContext._parent = this.match(DocParser.IDENTIFIER);
}
}
this.state = 62;
this.match(DocParser.OPERATOR_OPEN_BRACE);
this.state = 63;
this.match(DocParser.KEYWORD_PUBLIC);
this.state = 64;
this.match(DocParser.OPERATOR_COLON);
this.state = 66;
this.errorHandler.sync(this);
_la = this.tokenStream.LA(1);
if (((((_la - 9)) & ~0x1F) === 0 && ((1 << (_la - 9)) & 2147549127) !== 0)) {
{
this.state = 65;
localContext._content = this.memberDeclarationList();
}
}
this.state = 68;
this.match(DocParser.OPERATOR_CLOSE_BRACE);
this.state = 69;
this.match(DocParser.OPERATOR_SEMICOLON);
}
break;
case DocParser.KEYWORD_STRUCT:
this.enterOuterAlt(localContext, 2);
{
this.state = 70;
this.match(DocParser.KEYWORD_STRUCT);
this.state = 71;
localContext._name = this.match(DocParser.IDENTIFIER);
this.state = 75;
this.errorHandler.sync(this);
_la = this.tokenStream.LA(1);
if (_la === 25) {
{
this.state = 72;
this.match(DocParser.OPERATOR_COLON);
this.state = 73;
this.match(DocParser.KEYWORD_PUBLIC);
this.state = 74;
localContext._parent = this.match(DocParser.IDENTIFIER);
}
}
this.state = 77;
this.match(DocParser.OPERATOR_OPEN_BRACE);
this.state = 79;
this.errorHandler.sync(this);
_la = this.tokenStream.LA(1);
if (((((_la - 9)) & ~0x1F) === 0 && ((1 << (_la - 9)) & 2147549127) !== 0)) {
{
this.state = 78;
localContext._content = this.memberDeclarationList();
}
}
this.state = 81;
this.match(DocParser.OPERATOR_CLOSE_BRACE);
this.state = 82;
this.match(DocParser.OPERATOR_SEMICOLON);
}
break;
default:
throw new antlr.NoViableAltException(this);
}
}
catch (re) {
if (re instanceof antlr.RecognitionException) {
this.errorHandler.reportError(this, re);
this.errorHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localContext;
}
namespaceDeclaration() {
let localContext = new NamespaceDeclarationContext(this.context, this.state);
this.enterRule(localContext, 6, DocParser.RULE_namespaceDeclaration);
let _la;
try {
this.enterOuterAlt(localContext, 1);
{
this.state = 85;
this.match(DocParser.KEYWORD_NAMESPACE);
this.state = 86;
localContext._name = this.match(DocParser.IDENTIFIER);
this.state = 87;
this.match(DocParser.OPERATOR_OPEN_BRACE);
this.state = 89;
this.errorHandler.sync(this);
_la = this.tokenStream.LA(1);
if (((((_la - 9)) & ~0x1F) === 0 && ((1 << (_la - 9)) & 2147549127) !== 0)) {
{
this.state = 88;
localContext._content = this.memberDeclarationList();
}
}
this.state = 91;
this.match(DocParser.OPERATOR_CLOSE_BRACE);
this.state = 92;
this.match(DocParser.OPERATOR_SEMICOLON);
}
}
catch (re) {
if (re instanceof antlr.RecognitionException) {
this.errorHandler.reportError(this, re);
this.errorHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localContext;
}
memberDeclarationList() {
let localContext = new MemberDeclarationListContext(this.context, this.state);
this.enterRule(localContext, 8, DocParser.RULE_memberDeclarationList);
let _la;
try {
this.enterOuterAlt(localContext, 1);
{
this.state = 97;
this.errorHandler.sync(this);
_la = this.tokenStream.LA(1);
do {
{
this.state = 97;
this.errorHandler.sync(this);
switch (this.interpreter.adaptivePredict(this.tokenStream, 9, this.context)) {
case 1:
{
this.state = 94;
this.variableDeclaration();
}
break;
case 2:
{
this.state = 95;
this.functionDeclaration();
}
break;
case 3:
{
this.state = 96;
this.enumDeclaration();
}
break;
}
}
this.state = 99;
this.errorHandler.sync(this);
_la = this.tokenStream.LA(1);
} while (((((_la - 9)) & ~0x1F) === 0 && ((1 << (_la - 9)) & 2147549127) !== 0));
}
}
catch (re) {
if (re instanceof antlr.RecognitionException) {
this.errorHandler.reportError(this, re);
this.errorHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localContext;
}
variableDeclaration() {
let localContext = new VariableDeclarationContext(this.context, this.state);
this.enterRule(localContext, 10, DocParser.RULE_variableDeclaration);
let _la;
try {
this.state = 123;
this.errorHandler.sync(this);
switch (this.interpreter.adaptivePredict(this.tokenStream, 15, this.context)) {
case 1:
this.enterOuterAlt(localContext, 1);
{
this.state = 102;
this.errorHandler.sync(this);
switch (this.interpreter.adaptivePredict(this.tokenStream, 11, this.context)) {
case 1:
{
this.state = 101;
localContext._isConst = this.match(DocParser.KEYWORD_CONST);
}
break;
}
this.state = 104;
localContext._variableType = this.type_();
this.state = 105;
localContext._name = this.match(DocParser.IDENTIFIER);
this.state = 108;
this.errorHandler.sync(this);
_la = this.tokenStream.LA(1);
if (_la === 28) {
{
this.state = 106;
this.match(DocParser.OPERATOR_ASSIGN);
this.state = 107;
this.match(DocParser.LITERAL_REAL);
}
}
this.state = 110;
this.match(DocParser.OPERATOR_SEMICOLON);
}
break;
case 2:
this.enterOuterAlt(localContext, 2);
{
this.state = 113;
this.errorHandler.sync(this);
switch (this.interpreter.adaptivePredict(this.tokenStream, 13, this.context)) {
case 1:
{
this.state = 112;
localContext._isConst = this.match(DocParser.KEYWORD_CONST);
}
break;
}
this.state = 115;
localContext._variableType = this.type_();
this.state = 116;
localContext._name = this.match(DocParser.TYPE_TEXT);
this.state = 119;
this.errorHandler.sync(this);
_la = this.tokenStream.LA(1);
if (_la === 28) {
{
this.state = 117;
this.match(DocParser.OPERATOR_ASSIGN);
this.state = 118;
this.match(DocParser.LITERAL_REAL);
}
}
this.state = 121;
this.match(DocParser.OPERATOR_SEMICOLON);
}
break;
}
}
catch (re) {
if (re instanceof antlr.RecognitionException) {
this.errorHandler.reportError(this, re);
this.errorHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localContext;
}
functionDeclaration() {
let localContext = new FunctionDeclarationContext(this.context, this.state);
this.enterRule(localContext, 12, DocParser.RULE_functionDeclaration);
let _la;
try {
this.enterOuterAlt(localContext, 1);
{
this.state = 125;
localContext._functionType = this.type_();
this.state = 126;
localContext._name = this.match(DocParser.IDENTIFIER);
this.state = 127;
this.match(DocParser.OPERATOR_OPEN_PAREN);
this.state = 129;
this.errorHandler.sync(this);
_la = this.tokenStream.LA(1);
if (((((_la - 10)) & ~0x1F) === 0 && ((1 << (_la - 10)) & 1073774563) !== 0)) {
{
this.state = 128;
localContext._parameters = this.functionParameterList();
}
}
this.state = 131;
this.match(DocParser.OPERATOR_CLOSE_PAREN);
this.state = 132;
this.match(DocParser.OPERATOR_SEMICOLON);
}
}
catch (re) {
if (re instanceof antlr.RecognitionException) {
this.errorHandler.reportError(this, re);
this.errorHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localContext;
}
functionParameterList() {
let localContext = new FunctionParameterListContext(this.context, this.state);
this.enterRule(localContext, 14, DocParser.RULE_functionParameterList);
let _la;
try {
this.enterOuterAlt(localContext, 1);
{
this.state = 134;
localContext._functionParameter = this.functionParameter();
localContext._parameters.push(localContext._functionParameter);
this.state = 139;
this.errorHandler.sync(this);
_la = this.tokenStream.LA(1);
while (_la === 27) {
{
{
this.state = 135;
this.match(DocParser.OPERATOR_COMMA);
this.state = 136;
localContext._functionParameter = this.functionParameter();
localContext._parameters.push(localContext._functionParameter);
}
}
this.state = 141;
this.errorHandler.sync(this);
_la = this.tokenStream.LA(1);
}
}
}
catch (re) {
if (re instanceof antlr.RecognitionException) {
this.errorHandler.reportError(this, re);
this.errorHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localContext;
}
functionParameter() {
let localContext = new FunctionParameterContext(this.context, this.state);
this.enterRule(localContext, 16, DocParser.RULE_functionParameter);
try {
this.state = 152;
this.errorHandler.sync(this);
switch (this.interpreter.adaptivePredict(this.tokenStream, 18, this.context)) {
case 1:
this.enterOuterAlt(localContext, 1);
{
this.state = 142;
localContext._parameterType = this.type_();
this.state = 143;
localContext._name = this.match(DocParser.IDENTIFIER);
}
break;
case 2:
this.enterOuterAlt(localContext, 2);
{
this.state = 145;
localContext._parameterType = this.type_();
this.state = 146;
localContext._name = this.match(DocParser.TYPE_TEXT);
}
break;
case 3:
this.enterOuterAlt(localContext, 3);
{
this.state = 148;
localContext._parameterType = this.type_();
this.state = 149;
this.match(DocParser.IDENTIFIER);
this.state = 150;
localContext._name = this.match(DocParser.IDENTIFIER);
}
break;
}
}
catch (re) {
if (re instanceof antlr.RecognitionException) {
this.errorHandler.reportError(this, re);
this.errorHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localContext;
}
enumDeclaration() {
let localContext = new EnumDeclarationContext(this.context, this.state);
this.enterRule(localContext, 18, DocParser.RULE_enumDeclaration);
try {
this.enterOuterAlt(localContext, 1);
{
this.state = 154;
this.match(DocParser.KEYWORD_ENUM);
this.state = 155;
localContext._name = this.match(DocParser.IDENTIFIER);
this.state = 156;
this.match(DocParser.OPERATOR_OPEN_BRACE);
this.state = 157;
this.enumValueList();
this.state = 158;
this.match(DocParser.OPERATOR_CLOSE_BRACE);
this.state = 159;
this.match(DocParser.OPERATOR_SEMICOLON);
}
}
catch (re) {
if (re instanceof antlr.RecognitionException) {
this.errorHandler.reportError(this, re);
this.errorHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localContext;
}
enumValueList() {
let localContext = new EnumValueListContext(this.context, this.state);
this.enterRule(localContext, 20, DocParser.RULE_enumValueList);
let _la;
try {
let alternative;
this.enterOuterAlt(localContext, 1);
{
this.state = 161;
localContext._enumValue = this.enumValue();
localContext._values.push(localContext._enumValue);
this.state = 166;
this.errorHandler.sync(this);
alternative = this.interpreter.adaptivePredict(this.tokenStream, 19, this.context);
while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) {
if (alternative === 1) {
{
{
this.state = 162;
this.match(DocParser.OPERATOR_COMMA);
this.state = 163;
localContext._enumValue = this.enumValue();
localContext._values.push(localContext._enumValue);
}
}
}
this.state = 168;
this.errorHandler.sync(this);
alternative = this.interpreter.adaptivePredict(this.tokenStream, 19, this.context);
}
this.state = 170;
this.errorHandler.sync(this);
_la = this.tokenStream.LA(1);
if (_la === 27) {
{
this.state = 169;
this.match(DocParser.OPERATOR_COMMA);
}
}
}
}
catch (re) {
if (re instanceof antlr.RecognitionException) {
this.errorHandler.reportError(this, re);
this.errorHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localContext;
}
enumValue() {
let localContext = new EnumValueContext(this.context, this.state);
this.enterRule(localContext, 22, DocParser.RULE_enumValue);
try {
this.state = 178;
this.errorHandler.sync(this);
switch (this.tokenStream.LA(1)) {
case DocParser.IDENTIFIER:
this.enterOuterAlt(localContext, 1);
{
this.state = 173;
this.errorHandler.sync(this);
switch (this.interpreter.adaptivePredict(this.tokenStream, 21, this.context)) {
case 1:
{
this.state = 172;
this.match(DocParser.IDENTIFIER);
}
break;
}
this.state = 175;
localContext._name = this.match(DocParser.IDENTIFIER);
}
break;
case DocParser.KEYWORD_RESERVED:
this.enterOuterAlt(localContext, 2);
{
this.state = 176;
this.match(DocParser.KEYWORD_RESERVED);
}
break;
case DocParser.KEYWORD_UNUSED:
this.enterOuterAlt(localContext, 3);
{
this.state = 177;
this.match(DocParser.KEYWORD_UNUSED);
}
break;
default:
throw new antlr.NoViableAltException(this);
}
}
catch (re) {
if (re instanceof antlr.RecognitionException) {
this.errorHandler.reportError(this, re);
this.errorHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localContext;
}
type_() {
let localContext = new TypeContext(this.context, this.state);
this.enterRule(localContext, 24, DocParser.RULE_type);
try {
this.state = 207;
this.errorHandler.sync(this);
switch (this.interpreter.adaptivePredict(this.tokenStream, 23, this.context)) {
case 1:
this.enterOuterAlt(localContext, 1);
{
this.state = 180;
this.typeLiteral();
}
break;
case 2:
this.enterOuterAlt(localContext, 2);
{
this.state = 181;
this.typeLiteral();
this.state = 182;
localContext._isValueConst = this.match(DocParser.KEYWORD_CONST);
}
break;
case 3:
this.enterOuterAlt(localContext, 3);
{
this.state = 184;
localContext._isValueConst = this.match(DocParser.KEYWORD_CONST);
this.state = 185;
this.typeLiteral();
}
break;
case 4:
this.enterOuterAlt(localContext, 4);
{
this.state = 186;
this.typeClass();
}
break;
case 5:
this.enterOuterAlt(localContext, 5);
{
this.state = 187;
this.typeClass();
this.state = 188;
localContext._isPointer = this.match(DocParser.OPERATOR_POINTER);
}
break;
case 6:
this.enterOuterAlt(localContext, 6);
{
this.state = 190;
this.typeClass();
this.state = 191;
localContext._isValueConst = this.match(DocParser.KEYWORD_CONST);
}
break;
case 7:
this.enterOuterAlt(localContext, 7);
{
this.state = 193;
this.typeClass();
this.state = 194;
localContext._isPointer = this.match(DocParser.OPERATOR_POINTER);
this.state = 195;
localContext._isValueConst = this.match(DocParser.KEYWORD_CONST);
}
break;
case 8:
this.enterOuterAlt(localContext, 8);
{
this.state = 197;
this.typeClass();
this.state = 198;
localContext._isPointerConst = this.match(DocParser.KEYWORD_CONST);
this.state = 199;
localContext._isPointer = this.match(DocParser.OPERATOR_POINTER);
this.state = 200;
localContext._isValueConst = this.match(DocParser.KEYWORD_CONST);
}
break;
case 9:
this.enterOuterAlt(localContext, 9);
{
this.state = 202;
this.typeEnum();
}
break;
case 10:
this.enterOuterAlt(localContext, 10);
{
this.state = 203;
this.typeEnum();
this.state = 204;
localContext._isValueConst = this.match(DocParser.KEYWORD_CONST);
}
break;
case 11:
this.enterOuterAlt(localContext, 11);
{
this.state = 206;
this.typeArray();
}
break;
}
}
catch (re) {
if (re instanceof antlr.RecognitionException) {
this.errorHandler.reportError(this, re);
this.errorHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localContext;
}
typeArray() {
let localContext = new TypeArrayContext(this.context, this.state);
this.enterRule(localContext, 26, DocParser.RULE_typeArray);
let _la;
try {
this.state = 221;
this.errorHandler.sync(this);
switch (this.tokenStream.LA(1)) {
case DocParser.KEYWORD_ARRAY:
this.enterOuterAlt(localContext, 1);
{
this.state = 209;
this.match(DocParser.KEYWORD_ARRAY);
this.state = 210;
this.match(DocParser.OPERATOR_OPEN_ANGLE);
this.state = 211;
this.type_();
this.state = 212;
this.match(DocParser.OPERATOR_CLOSE_ANGLE);
}
break;
case DocParser.TYPE_BOOLEAN:
case DocParser.TYPE_IDENT:
case DocParser.TYPE_INT2:
case DocParser.TYPE_INT3:
case DocParser.TYPE_INTEGER:
case DocParser.TYPE_REAL:
case DocParser.TYPE_TEXT:
case DocParser.TYPE_VEC2:
case DocParser.TYPE_VEC3:
case DocParser.TYPE_VOID:
case DocParser.IDENTIFIER:
this.enterOuterAlt(localContext, 2);
{
this.state = 214;
this.typeArrayValue();
this.state = 215;
this.match(DocParser.OPERATOR_OPEN_BRACKET);
this.state = 217;
this.errorHandler.sync(this);
_la = this.tokenStream.LA(1);
if (_la === 24) {
{
this.state = 216;
this.match(DocParser.TYPE_VOID);
}
}
this.state = 219;
this.match(DocParser.OPERATOR_CLOSE_BRACKET);
}
break;
default:
throw new antlr.NoViableAltException(this);
}
}
catch (re) {
if (re instanceof antlr.RecognitionException) {
this.errorHandler.reportError(this, re);
this.errorHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localContext;
}
typeArrayValue() {
let localContext = new TypeArrayValueContext(this.context, this.state);
this.enterRule(localContext, 28, DocParser.RULE_typeArrayValue);
try {
this.state = 226;
this.errorHandler.sync(this);
switch (this.interpreter.adaptivePredict(this.tokenStream, 26, this.context)) {
case 1:
this.enterOuterAlt(localContext, 1);
{
this.state = 223;
this.typeLiteral();
}
break;
case 2:
this.enterOuterAlt(localContext, 2);
{
this.state = 224;
this.typeClass();
}
break;
case 3:
this.enterOuterAlt(localContext, 3);
{
this.state = 225;
this.typeEnum();
}
break;
}
}
catch (re) {
if (re instanceof antlr.RecognitionException) {
this.errorHandler.reportError(this, re);
this.errorHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localContext;
}
typeClass() {
let localContext = new TypeClassContext(this.context, this.state);
this.enterRule(localContext, 30, DocParser.RULE_typeClass);
try {
this.enterOuterAlt(localContext, 1);
{
this.state = 228;
this.match(DocParser.IDENTIFIER);
}
}
catch (re) {
if (re instanceof antlr.RecognitionException) {
this.errorHandler.reportError(this, re);
this.errorHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localContext;
}
typeEnum() {
let localContext = new TypeEnumContext(this.context, this.state);
this.enterRule(localContext, 32, DocParser.RULE_typeEnum);
try {
this.enterOuterAlt(localContext, 1);
{
this.state = 230;
this.match(DocParser.IDENTIFIER);
this.state = 231;
this.match(DocParser.OPERATOR_DOUBLECOLON);
this.state = 232;
this.match(DocParser.IDENTIFIER);
}
}
catch (re) {
if (re instanceof antlr.RecognitionException) {
this.errorHandler.reportError(this, re);
this.errorHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localContext;
}
typeLiteral() {
let localContext = new TypeLiteralContext(this.context, this.state);
this.enterRule(localContext, 34, DocParser.RULE_typeLiteral);
let _la;
try {
this.enterOuterAlt(localContext, 1);
{
this.state = 234;
_la = this.tokenStream.LA(1);
if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & 33521664) !== 0))) {
this.errorHandler.recoverInline(this);
}
else {
this.errorHandler.reportMatch(this);
this.consume();
}
}
}
catch (re) {
if (re instanceof antlr.RecognitionException) {
this.errorHandler.reportError(this, re);
this.errorHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localContext;
}
static _serializedATN = [
4, 1, 42, 237, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7,
6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13,
2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 1, 0, 1, 0, 1, 0, 5, 0, 40, 8, 0, 10,
0, 12, 0, 43, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 51, 8, 1, 1, 1, 1, 1, 1, 1, 1, 2,
1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 61, 8, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 67, 8, 2, 1, 2, 1, 2, 1,
2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 76, 8, 2, 1, 2, 1, 2, 3, 2, 80, 8, 2, 1, 2, 1, 2, 3, 2, 84, 8,
2, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 90, 8, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 4, 4, 98, 8, 4,
11, 4, 12, 4, 99, 1, 5, 3, 5, 103, 8, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 109, 8, 5, 1, 5, 1, 5,
1, 5, 3, 5, 114, 8, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 120, 8, 5, 1, 5, 1, 5, 3, 5, 124, 8, 5,
1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 130, 8, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 5, 7, 138, 8, 7,
10, 7, 12, 7, 141, 9, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 153,
8, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 5, 10, 165, 8, 10, 10,
10, 12, 10, 168, 9, 10, 1, 10, 3, 10, 171, 8, 10, 1, 11, 3, 11, 174, 8, 11, 1, 11, 1, 11,
1, 11, 3, 11, 179, 8, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12,
1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12,
1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 208, 8, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13,
1, 13, 1, 13, 1, 13, 3, 13, 218, 8, 13, 1, 13, 1, 13, 3, 13, 222, 8, 13, 1, 14, 1, 14, 1,
14, 3, 14, 227, 8, 14, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 0,
0, 18, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 0, 2, 1, 0, 6,
7, 1, 0, 15, 24, 259, 0, 41, 1, 0, 0, 0, 2, 46, 1, 0, 0, 0, 4, 83, 1, 0, 0, 0, 6, 85, 1, 0,
0, 0, 8, 97, 1, 0, 0, 0, 10, 123, 1, 0, 0, 0, 12, 125, 1, 0, 0, 0, 14, 134, 1, 0, 0, 0, 16,
152, 1, 0, 0, 0, 18, 154, 1, 0, 0, 0, 20, 161, 1, 0, 0, 0, 22, 178, 1, 0, 0, 0, 24, 207,
1, 0, 0, 0, 26, 221, 1, 0, 0, 0, 28, 226, 1, 0, 0, 0, 30, 228, 1, 0, 0, 0, 32, 230, 1, 0,
0, 0, 34, 234, 1, 0, 0, 0, 36, 40, 3, 2, 1, 0, 37, 40, 3, 4, 2, 0, 38, 40, 3, 6, 3, 0, 39,
36, 1, 0, 0, 0, 39, 37, 1, 0, 0, 0, 39, 38, 1, 0, 0, 0, 40, 43, 1, 0, 0, 0, 41, 39, 1, 0, 0,
0, 41, 42, 1, 0, 0, 0, 42, 44, 1, 0, 0, 0, 43, 41, 1, 0, 0, 0, 44, 45, 5, 0, 0, 1, 45, 1, 1,
0, 0, 0, 46, 47, 7, 0, 0, 0, 47, 48, 3, 34, 17, 0, 48, 50, 5, 30, 0, 0, 49, 51, 3, 8, 4, 0,
50, 49, 1, 0, 0, 0, 50, 51, 1, 0, 0, 0, 51, 52, 1, 0, 0, 0, 52, 53, 5, 31, 0, 0, 53, 54, 5,
29, 0, 0, 54, 3, 1, 0, 0, 0, 55, 56, 5, 7, 0, 0, 56, 60, 5, 40, 0, 0, 57, 58, 5, 25, 0, 0,
58, 59, 5, 8, 0, 0, 59, 61, 5, 40, 0, 0, 60, 57, 1, 0, 0, 0, 60, 61, 1, 0, 0, 0, 61, 62, 1,
0, 0, 0, 62, 63, 5, 30, 0, 0, 63, 64, 5, 8, 0, 0, 64, 66, 5, 25, 0, 0, 65, 67, 3, 8, 4, 0,
66, 65, 1, 0, 0, 0, 66, 67, 1, 0, 0, 0, 67, 68, 1, 0, 0, 0, 68, 69, 5, 31, 0, 0, 69, 84, 5,
29, 0, 0, 70, 71, 5, 6, 0, 0, 71, 75, 5, 40, 0, 0, 72, 73, 5, 25, 0, 0, 73, 74, 5, 8, 0, 0,
74, 76, 5, 40, 0, 0, 75, 72, 1, 0, 0, 0, 75, 76, 1, 0, 0, 0, 76, 77, 1, 0, 0, 0, 77, 79, 5,
30, 0, 0, 78, 80, 3, 8, 4, 0, 79, 78, 1, 0, 0, 0, 79, 80, 1, 0, 0, 0, 80, 81, 1, 0, 0, 0, 81,
82, 5, 31, 0, 0, 82, 84, 5, 29, 0, 0, 83, 55, 1, 0, 0, 0, 83, 70, 1, 0, 0, 0, 84, 5, 1, 0,
0, 0, 85, 86, 5, 14, 0, 0, 86, 87, 5, 40, 0, 0, 87, 89, 5, 30, 0, 0, 88, 90, 3, 8, 4, 0, 89,
88, 1, 0, 0, 0, 89, 90, 1, 0, 0, 0, 90, 91, 1, 0, 0, 0, 91, 92, 5, 31, 0, 0, 92, 93, 5, 29,
0, 0, 93, 7, 1, 0, 0, 0, 94, 98, 3, 10, 5, 0, 95, 98, 3, 12, 6, 0, 96, 98, 3, 18, 9, 0, 97,
94, 1, 0, 0, 0, 97, 95, 1, 0, 0, 0, 97, 96, 1, 0, 0, 0, 98, 99, 1, 0, 0, 0, 99, 97, 1, 0, 0,
0, 99, 100, 1, 0, 0, 0, 100, 9, 1, 0, 0, 0, 101, 103, 5, 10, 0, 0, 102, 101, 1, 0, 0, 0,
102, 103, 1, 0, 0, 0, 103, 104, 1, 0, 0, 0, 104, 105, 3, 24, 12, 0, 105, 108, 5, 40, 0,
0, 106, 107, 5, 28, 0, 0, 107, 109, 5, 39, 0, 0, 108, 106, 1, 0, 0, 0, 108, 109, 1, 0,
0, 0, 109, 110, 1, 0, 0, 0, 110, 111, 5, 29, 0, 0, 111, 124, 1, 0, 0, 0, 112, 114, 5, 10,
0, 0, 113, 112, 1, 0, 0, 0, 113, 114, 1, 0, 0, 0, 114, 115, 1, 0, 0, 0, 115, 116, 3, 24,
12, 0, 116, 119, 5, 21, 0, 0, 117, 118, 5, 28, 0, 0, 118, 120, 5, 39, 0, 0, 119, 117,
1, 0, 0, 0, 119, 120, 1, 0, 0, 0, 120, 121, 1, 0, 0, 0, 121, 122, 5, 29, 0, 0, 122, 124,
1, 0, 0, 0, 123, 102, 1, 0, 0, 0, 123, 113, 1, 0, 0, 0, 124, 11, 1, 0, 0, 0, 125, 126, 3,
24, 12, 0, 126, 127, 5, 40, 0, 0, 127, 129, 5, 34, 0, 0, 128, 130, 3, 14, 7, 0, 129, 128,
1, 0, 0, 0, 129, 130, 1, 0, 0, 0, 130, 131, 1, 0, 0, 0, 131, 132, 5, 35, 0, 0, 132, 133,
5, 29, 0, 0, 133, 13, 1, 0, 0, 0, 134, 139, 3, 16, 8, 0, 135, 136, 5, 27, 0, 0, 136, 138,
3, 16, 8, 0, 137, 135, 1, 0, 0, 0, 138, 141, 1, 0, 0, 0, 139, 137, 1, 0, 0, 0, 139, 140,
1, 0, 0, 0, 140, 15, 1, 0, 0, 0, 141, 139, 1, 0, 0, 0, 142, 143, 3, 24, 12, 0, 143, 144,
5, 40, 0, 0, 144, 153, 1, 0, 0, 0, 145, 146, 3, 24, 12, 0, 146, 147, 5, 21, 0, 0, 147,
153, 1, 0, 0, 0, 148, 149, 3, 24, 12, 0, 149, 150, 5, 40, 0, 0, 150, 151, 5, 40, 0, 0,
151, 153, 1, 0, 0, 0, 152, 142, 1, 0, 0, 0, 152, 145, 1, 0, 0, 0, 152, 148, 1, 0, 0, 0,
153, 17, 1, 0, 0, 0, 154, 155, 5, 9, 0, 0, 155, 156, 5, 40, 0, 0, 156, 157, 5, 30, 0, 0,
157, 158, 3, 20, 10, 0, 158, 159, 5, 31, 0, 0, 159, 160, 5, 29, 0, 0, 160, 19, 1, 0, 0,
0, 161, 166, 3, 22, 11, 0, 162, 163, 5, 27, 0, 0, 163, 165, 3, 22, 11, 0, 164, 162, 1,
0, 0, 0, 165, 168, 1, 0, 0, 0, 166, 164, 1, 0, 0, 0, 166, 167, 1, 0, 0, 0, 167, 170, 1,
0, 0, 0, 168, 166, 1, 0, 0, 0, 169, 171, 5, 27, 0, 0, 170, 169, 1, 0, 0, 0, 170, 171, 1,
0, 0, 0, 171, 21, 1, 0, 0, 0, 172, 174, 5, 40, 0, 0, 173, 172, 1, 0, 0, 0, 173, 174, 1,
0, 0, 0, 174, 175, 1, 0, 0, 0, 175, 179, 5, 40, 0, 0, 176, 179, 5, 12, 0, 0, 177, 179,
5, 13, 0, 0, 178, 173, 1, 0, 0, 0, 178, 176, 1, 0, 0, 0, 178, 177, 1, 0, 0, 0, 179, 23,
1, 0, 0, 0, 180, 208, 3, 34, 17, 0, 181, 182, 3, 34, 17, 0, 182, 183, 5, 10, 0, 0, 183,
208, 1, 0, 0, 0, 184, 185, 5, 10, 0, 0, 185, 208, 3, 34, 17, 0, 186, 208, 3, 30, 15, 0,
187, 188, 3, 30, 15, 0, 188, 189, 5, 38, 0, 0, 189, 208, 1, 0, 0, 0, 190, 191, 3, 30,
15, 0, 191, 192, 5, 10, 0, 0, 192, 208, 1, 0, 0, 0, 193, 194, 3, 30, 15, 0, 194, 195,
5, 38, 0, 0, 195, 196, 5, 10, 0, 0, 196, 208, 1, 0, 0, 0, 197, 198, 3, 30, 15, 0, 198,
199, 5, 10, 0, 0, 199, 200, 5, 38, 0, 0, 200, 201, 5, 10, 0, 0, 201, 208, 1, 0, 0, 0, 202,
208, 3, 32, 16, 0, 203, 204, 3, 32, 16, 0, 204, 205, 5, 10, 0, 0, 205, 208, 1, 0, 0, 0,
206, 208, 3, 26, 13, 0, 207, 180, 1, 0, 0, 0, 207, 181, 1, 0, 0, 0, 207, 184, 1, 0, 0,
0, 207, 186, 1, 0, 0, 0, 207, 187, 1, 0, 0, 0, 207, 190, 1, 0, 0, 0, 207, 193, 1, 0, 0,
0, 207, 197, 1, 0, 0, 0, 207, 202, 1, 0, 0, 0, 207, 203, 1, 0, 0, 0, 207, 206, 1, 0, 0,
0, 208, 25, 1, 0, 0, 0, 209, 210, 5, 11, 0, 0, 210, 21