# Generated from T4.g4 by ANTLR 4.10
# encoding: utf-8
from antlr4 import *
from io import StringIO
import sys
if sys.version_info[1] > 5:
	from typing import TextIO
else:
	from typing.io import TextIO

def serializedATN():
    return [
        4,1,41,336,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,2,18,7,18,2,19,7,19,2,20,
        7,20,2,21,7,21,2,22,7,22,2,23,7,23,2,24,7,24,2,25,7,25,2,26,7,26,
        1,0,1,0,5,0,57,8,0,10,0,12,0,60,9,0,1,1,1,1,5,1,64,8,1,10,1,12,1,
        67,9,1,1,2,1,2,1,2,1,2,3,2,73,8,2,1,3,3,3,76,8,3,1,3,5,3,79,8,3,
        10,3,12,3,82,9,3,1,3,1,3,1,3,1,3,3,3,88,8,3,1,4,1,4,1,4,3,4,93,8,
        4,1,5,3,5,96,8,5,1,5,5,5,99,8,5,10,5,12,5,102,9,5,1,5,1,5,1,5,1,
        5,3,5,108,8,5,1,5,1,5,5,5,112,8,5,10,5,12,5,115,9,5,1,5,1,5,3,5,
        119,8,5,1,6,1,6,1,6,3,6,124,8,6,1,7,3,7,127,8,7,1,7,5,7,130,8,7,
        10,7,12,7,133,9,7,1,7,1,7,3,7,137,8,7,1,7,1,7,1,7,5,7,142,8,7,10,
        7,12,7,145,9,7,1,7,1,7,3,7,149,8,7,1,7,3,7,152,8,7,1,8,1,8,1,9,3,
        9,157,8,9,1,9,5,9,160,8,9,10,9,12,9,163,9,9,1,9,1,9,1,9,1,9,5,9,
        169,8,9,10,9,12,9,172,9,9,1,9,1,9,3,9,176,8,9,1,10,3,10,179,8,10,
        1,10,5,10,182,8,10,10,10,12,10,185,9,10,1,10,3,10,188,8,10,1,10,
        1,10,1,10,1,10,3,10,194,8,10,1,10,3,10,197,8,10,1,11,1,11,3,11,201,
        8,11,1,12,1,12,1,12,3,12,206,8,12,1,13,1,13,1,14,1,14,1,14,3,14,
        213,8,14,1,14,3,14,216,8,14,1,15,1,15,1,15,1,15,1,15,3,15,223,8,
        15,1,16,1,16,1,17,1,17,1,17,1,17,1,17,3,17,232,8,17,1,18,1,18,1,
        18,1,18,1,18,1,19,1,19,1,19,1,19,1,19,1,20,1,20,1,20,1,20,1,20,1,
        21,3,21,250,8,21,1,21,5,21,253,8,21,10,21,12,21,256,9,21,1,21,1,
        21,1,21,1,21,5,21,262,8,21,10,21,12,21,265,9,21,1,21,1,21,3,21,269,
        8,21,1,22,3,22,272,8,22,1,22,5,22,275,8,22,10,22,12,22,278,9,22,
        1,22,1,22,1,22,1,22,3,22,284,8,22,1,22,3,22,287,8,22,1,23,3,23,290,
        8,23,1,23,5,23,293,8,23,10,23,12,23,296,9,23,1,23,1,23,1,23,1,23,
        5,23,302,8,23,10,23,12,23,305,9,23,1,23,1,23,3,23,309,8,23,1,24,
        1,24,3,24,313,8,24,1,25,3,25,316,8,25,1,25,5,25,319,8,25,10,25,12,
        25,322,9,25,1,25,1,25,1,25,3,25,327,8,25,1,25,3,25,330,8,25,1,26,
        1,26,3,26,334,8,26,1,26,0,0,27,0,2,4,6,8,10,12,14,16,18,20,22,24,
        26,28,30,32,34,36,38,40,42,44,46,48,50,52,0,0,368,0,54,1,0,0,0,2,
        61,1,0,0,0,4,68,1,0,0,0,6,75,1,0,0,0,8,92,1,0,0,0,10,95,1,0,0,0,
        12,123,1,0,0,0,14,126,1,0,0,0,16,153,1,0,0,0,18,156,1,0,0,0,20,178,
        1,0,0,0,22,200,1,0,0,0,24,202,1,0,0,0,26,207,1,0,0,0,28,209,1,0,
        0,0,30,222,1,0,0,0,32,224,1,0,0,0,34,231,1,0,0,0,36,233,1,0,0,0,
        38,238,1,0,0,0,40,243,1,0,0,0,42,249,1,0,0,0,44,271,1,0,0,0,46,289,
        1,0,0,0,48,312,1,0,0,0,50,315,1,0,0,0,52,333,1,0,0,0,54,58,3,2,1,
        0,55,57,3,8,4,0,56,55,1,0,0,0,57,60,1,0,0,0,58,56,1,0,0,0,58,59,
        1,0,0,0,59,1,1,0,0,0,60,58,1,0,0,0,61,65,3,6,3,0,62,64,3,4,2,0,63,
        62,1,0,0,0,64,67,1,0,0,0,65,63,1,0,0,0,65,66,1,0,0,0,66,3,1,0,0,
        0,67,65,1,0,0,0,68,69,5,1,0,0,69,70,5,36,0,0,70,72,5,37,0,0,71,73,
        5,2,0,0,72,71,1,0,0,0,72,73,1,0,0,0,73,5,1,0,0,0,74,76,5,38,0,0,
        75,74,1,0,0,0,75,76,1,0,0,0,76,80,1,0,0,0,77,79,3,26,13,0,78,77,
        1,0,0,0,79,82,1,0,0,0,80,78,1,0,0,0,80,81,1,0,0,0,81,83,1,0,0,0,
        82,80,1,0,0,0,83,84,5,3,0,0,84,85,5,36,0,0,85,87,5,37,0,0,86,88,
        5,2,0,0,87,86,1,0,0,0,87,88,1,0,0,0,88,7,1,0,0,0,89,93,3,10,5,0,
        90,93,3,42,21,0,91,93,3,46,23,0,92,89,1,0,0,0,92,90,1,0,0,0,92,91,
        1,0,0,0,93,9,1,0,0,0,94,96,5,38,0,0,95,94,1,0,0,0,95,96,1,0,0,0,
        96,100,1,0,0,0,97,99,3,26,13,0,98,97,1,0,0,0,99,102,1,0,0,0,100,
        98,1,0,0,0,100,101,1,0,0,0,101,103,1,0,0,0,102,100,1,0,0,0,103,104,
        5,4,0,0,104,107,5,36,0,0,105,106,5,5,0,0,106,108,5,36,0,0,107,105,
        1,0,0,0,107,108,1,0,0,0,108,109,1,0,0,0,109,113,5,6,0,0,110,112,
        3,12,6,0,111,110,1,0,0,0,112,115,1,0,0,0,113,111,1,0,0,0,113,114,
        1,0,0,0,114,116,1,0,0,0,115,113,1,0,0,0,116,118,5,7,0,0,117,119,
        5,2,0,0,118,117,1,0,0,0,118,119,1,0,0,0,119,11,1,0,0,0,120,124,3,
        14,7,0,121,124,3,20,10,0,122,124,3,18,9,0,123,120,1,0,0,0,123,121,
        1,0,0,0,123,122,1,0,0,0,124,13,1,0,0,0,125,127,5,38,0,0,126,125,
        1,0,0,0,126,127,1,0,0,0,127,131,1,0,0,0,128,130,3,26,13,0,129,128,
        1,0,0,0,130,133,1,0,0,0,131,129,1,0,0,0,131,132,1,0,0,0,132,136,
        1,0,0,0,133,131,1,0,0,0,134,137,3,30,15,0,135,137,5,8,0,0,136,134,
        1,0,0,0,136,135,1,0,0,0,137,138,1,0,0,0,138,139,5,36,0,0,139,143,
        5,9,0,0,140,142,3,24,12,0,141,140,1,0,0,0,142,145,1,0,0,0,143,141,
        1,0,0,0,143,144,1,0,0,0,144,146,1,0,0,0,145,143,1,0,0,0,146,148,
        5,10,0,0,147,149,3,16,8,0,148,147,1,0,0,0,148,149,1,0,0,0,149,151,
        1,0,0,0,150,152,5,2,0,0,151,150,1,0,0,0,151,152,1,0,0,0,152,15,1,
        0,0,0,153,154,5,11,0,0,154,17,1,0,0,0,155,157,5,38,0,0,156,155,1,
        0,0,0,156,157,1,0,0,0,157,161,1,0,0,0,158,160,3,26,13,0,159,158,
        1,0,0,0,160,163,1,0,0,0,161,159,1,0,0,0,161,162,1,0,0,0,162,164,
        1,0,0,0,163,161,1,0,0,0,164,165,5,12,0,0,165,166,5,36,0,0,166,170,
        5,9,0,0,167,169,3,24,12,0,168,167,1,0,0,0,169,172,1,0,0,0,170,168,
        1,0,0,0,170,171,1,0,0,0,171,173,1,0,0,0,172,170,1,0,0,0,173,175,
        5,10,0,0,174,176,5,2,0,0,175,174,1,0,0,0,175,176,1,0,0,0,176,19,
        1,0,0,0,177,179,5,38,0,0,178,177,1,0,0,0,178,179,1,0,0,0,179,183,
        1,0,0,0,180,182,3,26,13,0,181,180,1,0,0,0,182,185,1,0,0,0,183,181,
        1,0,0,0,183,184,1,0,0,0,184,187,1,0,0,0,185,183,1,0,0,0,186,188,
        3,22,11,0,187,186,1,0,0,0,187,188,1,0,0,0,188,189,1,0,0,0,189,190,
        3,30,15,0,190,193,5,36,0,0,191,192,5,13,0,0,192,194,5,29,0,0,193,
        191,1,0,0,0,193,194,1,0,0,0,194,196,1,0,0,0,195,197,5,2,0,0,196,
        195,1,0,0,0,196,197,1,0,0,0,197,21,1,0,0,0,198,201,5,14,0,0,199,
        201,5,11,0,0,200,198,1,0,0,0,200,199,1,0,0,0,201,23,1,0,0,0,202,
        203,3,30,15,0,203,205,5,36,0,0,204,206,5,15,0,0,205,204,1,0,0,0,
        205,206,1,0,0,0,206,25,1,0,0,0,207,208,5,32,0,0,208,27,1,0,0,0,209,
        212,5,36,0,0,210,211,5,13,0,0,211,213,5,36,0,0,212,210,1,0,0,0,212,
        213,1,0,0,0,213,215,1,0,0,0,214,216,5,15,0,0,215,214,1,0,0,0,215,
        216,1,0,0,0,216,29,1,0,0,0,217,223,3,34,17,0,218,223,3,32,16,0,219,
        223,3,36,18,0,220,223,3,38,19,0,221,223,3,40,20,0,222,217,1,0,0,
        0,222,218,1,0,0,0,222,219,1,0,0,0,222,220,1,0,0,0,222,221,1,0,0,
        0,223,31,1,0,0,0,224,225,5,36,0,0,225,33,1,0,0,0,226,232,5,16,0,
        0,227,232,5,17,0,0,228,232,5,18,0,0,229,232,5,19,0,0,230,232,5,20,
        0,0,231,226,1,0,0,0,231,227,1,0,0,0,231,228,1,0,0,0,231,229,1,0,
        0,0,231,230,1,0,0,0,232,35,1,0,0,0,233,234,5,21,0,0,234,235,5,22,
        0,0,235,236,3,30,15,0,236,237,5,23,0,0,237,37,1,0,0,0,238,239,5,
        24,0,0,239,240,5,22,0,0,240,241,3,30,15,0,241,242,5,23,0,0,242,39,
        1,0,0,0,243,244,5,25,0,0,244,245,5,22,0,0,245,246,3,30,15,0,246,
        247,5,23,0,0,247,41,1,0,0,0,248,250,5,38,0,0,249,248,1,0,0,0,249,
        250,1,0,0,0,250,254,1,0,0,0,251,253,3,26,13,0,252,251,1,0,0,0,253,
        256,1,0,0,0,254,252,1,0,0,0,254,255,1,0,0,0,255,257,1,0,0,0,256,
        254,1,0,0,0,257,258,5,26,0,0,258,259,5,36,0,0,259,263,5,6,0,0,260,
        262,3,44,22,0,261,260,1,0,0,0,262,265,1,0,0,0,263,261,1,0,0,0,263,
        264,1,0,0,0,264,266,1,0,0,0,265,263,1,0,0,0,266,268,5,7,0,0,267,
        269,5,2,0,0,268,267,1,0,0,0,268,269,1,0,0,0,269,43,1,0,0,0,270,272,
        5,38,0,0,271,270,1,0,0,0,271,272,1,0,0,0,272,276,1,0,0,0,273,275,
        3,26,13,0,274,273,1,0,0,0,275,278,1,0,0,0,276,274,1,0,0,0,276,277,
        1,0,0,0,277,279,1,0,0,0,278,276,1,0,0,0,279,280,3,30,15,0,280,283,
        5,36,0,0,281,282,5,13,0,0,282,284,5,29,0,0,283,281,1,0,0,0,283,284,
        1,0,0,0,284,286,1,0,0,0,285,287,5,2,0,0,286,285,1,0,0,0,286,287,
        1,0,0,0,287,45,1,0,0,0,288,290,5,38,0,0,289,288,1,0,0,0,289,290,
        1,0,0,0,290,294,1,0,0,0,291,293,3,26,13,0,292,291,1,0,0,0,293,296,
        1,0,0,0,294,292,1,0,0,0,294,295,1,0,0,0,295,297,1,0,0,0,296,294,
        1,0,0,0,297,298,3,48,24,0,298,299,5,36,0,0,299,303,5,6,0,0,300,302,
        3,50,25,0,301,300,1,0,0,0,302,305,1,0,0,0,303,301,1,0,0,0,303,304,
        1,0,0,0,304,306,1,0,0,0,305,303,1,0,0,0,306,308,5,7,0,0,307,309,
        5,2,0,0,308,307,1,0,0,0,308,309,1,0,0,0,309,47,1,0,0,0,310,313,5,
        27,0,0,311,313,5,28,0,0,312,310,1,0,0,0,312,311,1,0,0,0,313,49,1,
        0,0,0,314,316,5,38,0,0,315,314,1,0,0,0,315,316,1,0,0,0,316,320,1,
        0,0,0,317,319,3,26,13,0,318,317,1,0,0,0,319,322,1,0,0,0,320,318,
        1,0,0,0,320,321,1,0,0,0,321,323,1,0,0,0,322,320,1,0,0,0,323,326,
        5,36,0,0,324,325,5,13,0,0,325,327,3,52,26,0,326,324,1,0,0,0,326,
        327,1,0,0,0,327,329,1,0,0,0,328,330,5,15,0,0,329,328,1,0,0,0,329,
        330,1,0,0,0,330,51,1,0,0,0,331,334,5,33,0,0,332,334,5,34,0,0,333,
        331,1,0,0,0,333,332,1,0,0,0,334,53,1,0,0,0,52,58,65,72,75,80,87,
        92,95,100,107,113,118,123,126,131,136,143,148,151,156,161,170,175,
        178,183,187,193,196,200,205,212,215,222,231,249,254,263,268,271,
        276,283,286,289,294,303,308,312,315,320,326,329,333
    ]

class T4Parser ( Parser ):

    grammarFileName = "T4.g4"

    atn = ATNDeserializer().deserialize(serializedATN())

    decisionsToDFA = [ DFA(ds, i) for i, ds in enumerate(atn.decisionToState) ]

    sharedContextCache = PredictionContextCache()

    literalNames = [ "<INVALID>", "'import'", "';'", "'module'", "'interface'", 
                     "'extends'", "'{'", "'}'", "'void'", "'('", "')'", 
                     "'const'", "'signal'", "'='", "'readonly'", "','", 
                     "'bool'", "'int'", "'real'", "'string'", "'var'", "'list'", 
                     "'<'", "'>'", "'map'", "'model'", "'struct'", "'enum'", 
                     "'flag'" ]

    symbolicNames = [ "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "STRING", "DOUBLE_STRING", "SINGLE_STRING", 
                      "TAGLINE", "INTCONSTANT", "HEXCONSTANT", "TAGIDENTIFIER", 
                      "IDENTIFIER", "VERSION", "DOCCOMMENT", "WHITESPACE", 
                      "COMMENT", "MULTICOMM" ]

    RULE_documentSymbol = 0
    RULE_headerSymbol = 1
    RULE_importSymbol = 2
    RULE_moduleSymbol = 3
    RULE_definitionSymbol = 4
    RULE_interfaceSymbol = 5
    RULE_interfaceMemberSymbol = 6
    RULE_operationSymbol = 7
    RULE_operationModifierSymbol = 8
    RULE_signalSymbol = 9
    RULE_propertySymbol = 10
    RULE_propertyModifierSymbol = 11
    RULE_operationParameterSymbol = 12
    RULE_tagSymbol = 13
    RULE_tagAttributeSymbol = 14
    RULE_typeSymbol = 15
    RULE_complexTypeSymbol = 16
    RULE_primitiveTypeSymbol = 17
    RULE_listTypeSymbol = 18
    RULE_mapTypeSymbol = 19
    RULE_modelTypeSymbol = 20
    RULE_structSymbol = 21
    RULE_structFieldSymbol = 22
    RULE_enumSymbol = 23
    RULE_enumTypeSymbol = 24
    RULE_enumMemberSymbol = 25
    RULE_intSymbol = 26

    ruleNames =  [ "documentSymbol", "headerSymbol", "importSymbol", "moduleSymbol", 
                   "definitionSymbol", "interfaceSymbol", "interfaceMemberSymbol", 
                   "operationSymbol", "operationModifierSymbol", "signalSymbol", 
                   "propertySymbol", "propertyModifierSymbol", "operationParameterSymbol", 
                   "tagSymbol", "tagAttributeSymbol", "typeSymbol", "complexTypeSymbol", 
                   "primitiveTypeSymbol", "listTypeSymbol", "mapTypeSymbol", 
                   "modelTypeSymbol", "structSymbol", "structFieldSymbol", 
                   "enumSymbol", "enumTypeSymbol", "enumMemberSymbol", "intSymbol" ]

    EOF = Token.EOF
    T__0=1
    T__1=2
    T__2=3
    T__3=4
    T__4=5
    T__5=6
    T__6=7
    T__7=8
    T__8=9
    T__9=10
    T__10=11
    T__11=12
    T__12=13
    T__13=14
    T__14=15
    T__15=16
    T__16=17
    T__17=18
    T__18=19
    T__19=20
    T__20=21
    T__21=22
    T__22=23
    T__23=24
    T__24=25
    T__25=26
    T__26=27
    T__27=28
    STRING=29
    DOUBLE_STRING=30
    SINGLE_STRING=31
    TAGLINE=32
    INTCONSTANT=33
    HEXCONSTANT=34
    TAGIDENTIFIER=35
    IDENTIFIER=36
    VERSION=37
    DOCCOMMENT=38
    WHITESPACE=39
    COMMENT=40
    MULTICOMM=41

    def __init__(self, input:TokenStream, output:TextIO = sys.stdout):
        super().__init__(input, output)
        self.checkVersion("4.10")
        self._interp = ParserATNSimulator(self, self.atn, self.decisionsToDFA, self.sharedContextCache)
        self._predicates = None




    class DocumentSymbolContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def headerSymbol(self):
            return self.getTypedRuleContext(T4Parser.HeaderSymbolContext,0)


        def definitionSymbol(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(T4Parser.DefinitionSymbolContext)
            else:
                return self.getTypedRuleContext(T4Parser.DefinitionSymbolContext,i)


        def getRuleIndex(self):
            return T4Parser.RULE_documentSymbol

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDocumentSymbol" ):
                listener.enterDocumentSymbol(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDocumentSymbol" ):
                listener.exitDocumentSymbol(self)




    def documentSymbol(self):

        localctx = T4Parser.DocumentSymbolContext(self, self._ctx, self.state)
        self.enterRule(localctx, 0, self.RULE_documentSymbol)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 54
            self.headerSymbol()
            self.state = 58
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << T4Parser.T__3) | (1 << T4Parser.T__25) | (1 << T4Parser.T__26) | (1 << T4Parser.T__27) | (1 << T4Parser.TAGLINE) | (1 << T4Parser.DOCCOMMENT))) != 0):
                self.state = 55
                self.definitionSymbol()
                self.state = 60
                self._errHandler.sync(self)
                _la = self._input.LA(1)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class HeaderSymbolContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def moduleSymbol(self):
            return self.getTypedRuleContext(T4Parser.ModuleSymbolContext,0)


        def importSymbol(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(T4Parser.ImportSymbolContext)
            else:
                return self.getTypedRuleContext(T4Parser.ImportSymbolContext,i)


        def getRuleIndex(self):
            return T4Parser.RULE_headerSymbol

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterHeaderSymbol" ):
                listener.enterHeaderSymbol(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitHeaderSymbol" ):
                listener.exitHeaderSymbol(self)




    def headerSymbol(self):

        localctx = T4Parser.HeaderSymbolContext(self, self._ctx, self.state)
        self.enterRule(localctx, 2, self.RULE_headerSymbol)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 61
            self.moduleSymbol()
            self.state = 65
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==T4Parser.T__0:
                self.state = 62
                self.importSymbol()
                self.state = 67
                self._errHandler.sync(self)
                _la = self._input.LA(1)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ImportSymbolContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser
            self.name = None # Token
            self.version = None # Token

        def IDENTIFIER(self):
            return self.getToken(T4Parser.IDENTIFIER, 0)

        def VERSION(self):
            return self.getToken(T4Parser.VERSION, 0)

        def getRuleIndex(self):
            return T4Parser.RULE_importSymbol

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterImportSymbol" ):
                listener.enterImportSymbol(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitImportSymbol" ):
                listener.exitImportSymbol(self)




    def importSymbol(self):

        localctx = T4Parser.ImportSymbolContext(self, self._ctx, self.state)
        self.enterRule(localctx, 4, self.RULE_importSymbol)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 68
            self.match(T4Parser.T__0)
            self.state = 69
            localctx.name = self.match(T4Parser.IDENTIFIER)
            self.state = 70
            localctx.version = self.match(T4Parser.VERSION)
            self.state = 72
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==T4Parser.T__1:
                self.state = 71
                self.match(T4Parser.T__1)


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ModuleSymbolContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser
            self.comment = None # Token
            self.name = None # Token
            self.version = None # Token

        def IDENTIFIER(self):
            return self.getToken(T4Parser.IDENTIFIER, 0)

        def VERSION(self):
            return self.getToken(T4Parser.VERSION, 0)

        def tagSymbol(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(T4Parser.TagSymbolContext)
            else:
                return self.getTypedRuleContext(T4Parser.TagSymbolContext,i)


        def DOCCOMMENT(self):
            return self.getToken(T4Parser.DOCCOMMENT, 0)

        def getRuleIndex(self):
            return T4Parser.RULE_moduleSymbol

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterModuleSymbol" ):
                listener.enterModuleSymbol(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitModuleSymbol" ):
                listener.exitModuleSymbol(self)




    def moduleSymbol(self):

        localctx = T4Parser.ModuleSymbolContext(self, self._ctx, self.state)
        self.enterRule(localctx, 6, self.RULE_moduleSymbol)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 75
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==T4Parser.DOCCOMMENT:
                self.state = 74
                localctx.comment = self.match(T4Parser.DOCCOMMENT)


            self.state = 80
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==T4Parser.TAGLINE:
                self.state = 77
                self.tagSymbol()
                self.state = 82
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 83
            self.match(T4Parser.T__2)
            self.state = 84
            localctx.name = self.match(T4Parser.IDENTIFIER)
            self.state = 85
            localctx.version = self.match(T4Parser.VERSION)
            self.state = 87
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==T4Parser.T__1:
                self.state = 86
                self.match(T4Parser.T__1)


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class DefinitionSymbolContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def interfaceSymbol(self):
            return self.getTypedRuleContext(T4Parser.InterfaceSymbolContext,0)


        def structSymbol(self):
            return self.getTypedRuleContext(T4Parser.StructSymbolContext,0)


        def enumSymbol(self):
            return self.getTypedRuleContext(T4Parser.EnumSymbolContext,0)


        def getRuleIndex(self):
            return T4Parser.RULE_definitionSymbol

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDefinitionSymbol" ):
                listener.enterDefinitionSymbol(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDefinitionSymbol" ):
                listener.exitDefinitionSymbol(self)




    def definitionSymbol(self):

        localctx = T4Parser.DefinitionSymbolContext(self, self._ctx, self.state)
        self.enterRule(localctx, 8, self.RULE_definitionSymbol)
        try:
            self.state = 92
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,6,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 89
                self.interfaceSymbol()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 90
                self.structSymbol()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 91
                self.enumSymbol()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class InterfaceSymbolContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser
            self.comment = None # Token
            self.name = None # Token
            self.extends = None # Token

        def IDENTIFIER(self, i:int=None):
            if i is None:
                return self.getTokens(T4Parser.IDENTIFIER)
            else:
                return self.getToken(T4Parser.IDENTIFIER, i)

        def tagSymbol(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(T4Parser.TagSymbolContext)
            else:
                return self.getTypedRuleContext(T4Parser.TagSymbolContext,i)


        def interfaceMemberSymbol(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(T4Parser.InterfaceMemberSymbolContext)
            else:
                return self.getTypedRuleContext(T4Parser.InterfaceMemberSymbolContext,i)


        def DOCCOMMENT(self):
            return self.getToken(T4Parser.DOCCOMMENT, 0)

        def getRuleIndex(self):
            return T4Parser.RULE_interfaceSymbol

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterInterfaceSymbol" ):
                listener.enterInterfaceSymbol(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitInterfaceSymbol" ):
                listener.exitInterfaceSymbol(self)




    def interfaceSymbol(self):

        localctx = T4Parser.InterfaceSymbolContext(self, self._ctx, self.state)
        self.enterRule(localctx, 10, self.RULE_interfaceSymbol)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 95
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==T4Parser.DOCCOMMENT:
                self.state = 94
                localctx.comment = self.match(T4Parser.DOCCOMMENT)


            self.state = 100
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==T4Parser.TAGLINE:
                self.state = 97
                self.tagSymbol()
                self.state = 102
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 103
            self.match(T4Parser.T__3)
            self.state = 104
            localctx.name = self.match(T4Parser.IDENTIFIER)
            self.state = 107
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==T4Parser.T__4:
                self.state = 105
                self.match(T4Parser.T__4)
                self.state = 106
                localctx.extends = self.match(T4Parser.IDENTIFIER)


            self.state = 109
            self.match(T4Parser.T__5)
            self.state = 113
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << T4Parser.T__7) | (1 << T4Parser.T__10) | (1 << T4Parser.T__11) | (1 << T4Parser.T__13) | (1 << T4Parser.T__15) | (1 << T4Parser.T__16) | (1 << T4Parser.T__17) | (1 << T4Parser.T__18) | (1 << T4Parser.T__19) | (1 << T4Parser.T__20) | (1 << T4Parser.T__23) | (1 << T4Parser.T__24) | (1 << T4Parser.TAGLINE) | (1 << T4Parser.IDENTIFIER) | (1 << T4Parser.DOCCOMMENT))) != 0):
                self.state = 110
                self.interfaceMemberSymbol()
                self.state = 115
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 116
            self.match(T4Parser.T__6)
            self.state = 118
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==T4Parser.T__1:
                self.state = 117
                self.match(T4Parser.T__1)


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class InterfaceMemberSymbolContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def operationSymbol(self):
            return self.getTypedRuleContext(T4Parser.OperationSymbolContext,0)


        def propertySymbol(self):
            return self.getTypedRuleContext(T4Parser.PropertySymbolContext,0)


        def signalSymbol(self):
            return self.getTypedRuleContext(T4Parser.SignalSymbolContext,0)


        def getRuleIndex(self):
            return T4Parser.RULE_interfaceMemberSymbol

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterInterfaceMemberSymbol" ):
                listener.enterInterfaceMemberSymbol(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitInterfaceMemberSymbol" ):
                listener.exitInterfaceMemberSymbol(self)




    def interfaceMemberSymbol(self):

        localctx = T4Parser.InterfaceMemberSymbolContext(self, self._ctx, self.state)
        self.enterRule(localctx, 12, self.RULE_interfaceMemberSymbol)
        try:
            self.state = 123
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,12,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 120
                self.operationSymbol()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 121
                self.propertySymbol()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 122
                self.signalSymbol()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class OperationSymbolContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser
            self.comment = None # Token
            self.name = None # Token

        def IDENTIFIER(self):
            return self.getToken(T4Parser.IDENTIFIER, 0)

        def typeSymbol(self):
            return self.getTypedRuleContext(T4Parser.TypeSymbolContext,0)


        def tagSymbol(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(T4Parser.TagSymbolContext)
            else:
                return self.getTypedRuleContext(T4Parser.TagSymbolContext,i)


        def operationParameterSymbol(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(T4Parser.OperationParameterSymbolContext)
            else:
                return self.getTypedRuleContext(T4Parser.OperationParameterSymbolContext,i)


        def operationModifierSymbol(self):
            return self.getTypedRuleContext(T4Parser.OperationModifierSymbolContext,0)


        def DOCCOMMENT(self):
            return self.getToken(T4Parser.DOCCOMMENT, 0)

        def getRuleIndex(self):
            return T4Parser.RULE_operationSymbol

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOperationSymbol" ):
                listener.enterOperationSymbol(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOperationSymbol" ):
                listener.exitOperationSymbol(self)




    def operationSymbol(self):

        localctx = T4Parser.OperationSymbolContext(self, self._ctx, self.state)
        self.enterRule(localctx, 14, self.RULE_operationSymbol)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 126
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==T4Parser.DOCCOMMENT:
                self.state = 125
                localctx.comment = self.match(T4Parser.DOCCOMMENT)


            self.state = 131
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==T4Parser.TAGLINE:
                self.state = 128
                self.tagSymbol()
                self.state = 133
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 136
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [T4Parser.T__15, T4Parser.T__16, T4Parser.T__17, T4Parser.T__18, T4Parser.T__19, T4Parser.T__20, T4Parser.T__23, T4Parser.T__24, T4Parser.IDENTIFIER]:
                self.state = 134
                self.typeSymbol()
                pass
            elif token in [T4Parser.T__7]:
                self.state = 135
                self.match(T4Parser.T__7)
                pass
            else:
                raise NoViableAltException(self)

            self.state = 138
            localctx.name = self.match(T4Parser.IDENTIFIER)
            self.state = 139
            self.match(T4Parser.T__8)
            self.state = 143
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << T4Parser.T__15) | (1 << T4Parser.T__16) | (1 << T4Parser.T__17) | (1 << T4Parser.T__18) | (1 << T4Parser.T__19) | (1 << T4Parser.T__20) | (1 << T4Parser.T__23) | (1 << T4Parser.T__24) | (1 << T4Parser.IDENTIFIER))) != 0):
                self.state = 140
                self.operationParameterSymbol()
                self.state = 145
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 146
            self.match(T4Parser.T__9)
            self.state = 148
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,17,self._ctx)
            if la_ == 1:
                self.state = 147
                self.operationModifierSymbol()


            self.state = 151
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==T4Parser.T__1:
                self.state = 150
                self.match(T4Parser.T__1)


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class OperationModifierSymbolContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser
            self.is_const = None # Token


        def getRuleIndex(self):
            return T4Parser.RULE_operationModifierSymbol

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOperationModifierSymbol" ):
                listener.enterOperationModifierSymbol(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOperationModifierSymbol" ):
                listener.exitOperationModifierSymbol(self)




    def operationModifierSymbol(self):

        localctx = T4Parser.OperationModifierSymbolContext(self, self._ctx, self.state)
        self.enterRule(localctx, 16, self.RULE_operationModifierSymbol)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 153
            localctx.is_const = self.match(T4Parser.T__10)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class SignalSymbolContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser
            self.comment = None # Token
            self.name = None # Token

        def IDENTIFIER(self):
            return self.getToken(T4Parser.IDENTIFIER, 0)

        def tagSymbol(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(T4Parser.TagSymbolContext)
            else:
                return self.getTypedRuleContext(T4Parser.TagSymbolContext,i)


        def operationParameterSymbol(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(T4Parser.OperationParameterSymbolContext)
            else:
                return self.getTypedRuleContext(T4Parser.OperationParameterSymbolContext,i)


        def DOCCOMMENT(self):
            return self.getToken(T4Parser.DOCCOMMENT, 0)

        def getRuleIndex(self):
            return T4Parser.RULE_signalSymbol

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterSignalSymbol" ):
                listener.enterSignalSymbol(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitSignalSymbol" ):
                listener.exitSignalSymbol(self)




    def signalSymbol(self):

        localctx = T4Parser.SignalSymbolContext(self, self._ctx, self.state)
        self.enterRule(localctx, 18, self.RULE_signalSymbol)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 156
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==T4Parser.DOCCOMMENT:
                self.state = 155
                localctx.comment = self.match(T4Parser.DOCCOMMENT)


            self.state = 161
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==T4Parser.TAGLINE:
                self.state = 158
                self.tagSymbol()
                self.state = 163
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 164
            self.match(T4Parser.T__11)
            self.state = 165
            localctx.name = self.match(T4Parser.IDENTIFIER)
            self.state = 166
            self.match(T4Parser.T__8)
            self.state = 170
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << T4Parser.T__15) | (1 << T4Parser.T__16) | (1 << T4Parser.T__17) | (1 << T4Parser.T__18) | (1 << T4Parser.T__19) | (1 << T4Parser.T__20) | (1 << T4Parser.T__23) | (1 << T4Parser.T__24) | (1 << T4Parser.IDENTIFIER))) != 0):
                self.state = 167
                self.operationParameterSymbol()
                self.state = 172
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 173
            self.match(T4Parser.T__9)
            self.state = 175
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==T4Parser.T__1:
                self.state = 174
                self.match(T4Parser.T__1)


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class PropertySymbolContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser
            self.comment = None # Token
            self.name = None # Token
            self.value = None # Token

        def typeSymbol(self):
            return self.getTypedRuleContext(T4Parser.TypeSymbolContext,0)


        def IDENTIFIER(self):
            return self.getToken(T4Parser.IDENTIFIER, 0)

        def tagSymbol(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(T4Parser.TagSymbolContext)
            else:
                return self.getTypedRuleContext(T4Parser.TagSymbolContext,i)


        def propertyModifierSymbol(self):
            return self.getTypedRuleContext(T4Parser.PropertyModifierSymbolContext,0)


        def DOCCOMMENT(self):
            return self.getToken(T4Parser.DOCCOMMENT, 0)

        def STRING(self):
            return self.getToken(T4Parser.STRING, 0)

        def getRuleIndex(self):
            return T4Parser.RULE_propertySymbol

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterPropertySymbol" ):
                listener.enterPropertySymbol(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitPropertySymbol" ):
                listener.exitPropertySymbol(self)




    def propertySymbol(self):

        localctx = T4Parser.PropertySymbolContext(self, self._ctx, self.state)
        self.enterRule(localctx, 20, self.RULE_propertySymbol)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 178
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==T4Parser.DOCCOMMENT:
                self.state = 177
                localctx.comment = self.match(T4Parser.DOCCOMMENT)


            self.state = 183
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==T4Parser.TAGLINE:
                self.state = 180
                self.tagSymbol()
                self.state = 185
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 187
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==T4Parser.T__10 or _la==T4Parser.T__13:
                self.state = 186
                self.propertyModifierSymbol()


            self.state = 189
            self.typeSymbol()
            self.state = 190
            localctx.name = self.match(T4Parser.IDENTIFIER)
            self.state = 193
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==T4Parser.T__12:
                self.state = 191
                self.match(T4Parser.T__12)
                self.state = 192
                localctx.value = self.match(T4Parser.STRING)


            self.state = 196
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==T4Parser.T__1:
                self.state = 195
                self.match(T4Parser.T__1)


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class PropertyModifierSymbolContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser
            self.is_readonly = None # Token
            self.is_const = None # Token


        def getRuleIndex(self):
            return T4Parser.RULE_propertyModifierSymbol

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterPropertyModifierSymbol" ):
                listener.enterPropertyModifierSymbol(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitPropertyModifierSymbol" ):
                listener.exitPropertyModifierSymbol(self)




    def propertyModifierSymbol(self):

        localctx = T4Parser.PropertyModifierSymbolContext(self, self._ctx, self.state)
        self.enterRule(localctx, 22, self.RULE_propertyModifierSymbol)
        try:
            self.state = 200
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [T4Parser.T__13]:
                self.enterOuterAlt(localctx, 1)
                self.state = 198
                localctx.is_readonly = self.match(T4Parser.T__13)
                pass
            elif token in [T4Parser.T__10]:
                self.enterOuterAlt(localctx, 2)
                self.state = 199
                localctx.is_const = self.match(T4Parser.T__10)
                pass
            else:
                raise NoViableAltException(self)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class OperationParameterSymbolContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser
            self.name = None # Token

        def typeSymbol(self):
            return self.getTypedRuleContext(T4Parser.TypeSymbolContext,0)


        def IDENTIFIER(self):
            return self.getToken(T4Parser.IDENTIFIER, 0)

        def getRuleIndex(self):
            return T4Parser.RULE_operationParameterSymbol

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOperationParameterSymbol" ):
                listener.enterOperationParameterSymbol(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOperationParameterSymbol" ):
                listener.exitOperationParameterSymbol(self)




    def operationParameterSymbol(self):

        localctx = T4Parser.OperationParameterSymbolContext(self, self._ctx, self.state)
        self.enterRule(localctx, 24, self.RULE_operationParameterSymbol)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 202
            self.typeSymbol()
            self.state = 203
            localctx.name = self.match(T4Parser.IDENTIFIER)
            self.state = 205
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==T4Parser.T__14:
                self.state = 204
                self.match(T4Parser.T__14)


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class TagSymbolContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser
            self.line = None # Token

        def TAGLINE(self):
            return self.getToken(T4Parser.TAGLINE, 0)

        def getRuleIndex(self):
            return T4Parser.RULE_tagSymbol

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTagSymbol" ):
                listener.enterTagSymbol(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTagSymbol" ):
                listener.exitTagSymbol(self)




    def tagSymbol(self):

        localctx = T4Parser.TagSymbolContext(self, self._ctx, self.state)
        self.enterRule(localctx, 26, self.RULE_tagSymbol)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 207
            localctx.line = self.match(T4Parser.TAGLINE)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class TagAttributeSymbolContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser
            self.name = None # Token
            self.value = None # Token

        def IDENTIFIER(self, i:int=None):
            if i is None:
                return self.getTokens(T4Parser.IDENTIFIER)
            else:
                return self.getToken(T4Parser.IDENTIFIER, i)

        def getRuleIndex(self):
            return T4Parser.RULE_tagAttributeSymbol

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTagAttributeSymbol" ):
                listener.enterTagAttributeSymbol(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTagAttributeSymbol" ):
                listener.exitTagAttributeSymbol(self)




    def tagAttributeSymbol(self):

        localctx = T4Parser.TagAttributeSymbolContext(self, self._ctx, self.state)
        self.enterRule(localctx, 28, self.RULE_tagAttributeSymbol)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 209
            localctx.name = self.match(T4Parser.IDENTIFIER)
            self.state = 212
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==T4Parser.T__12:
                self.state = 210
                self.match(T4Parser.T__12)
                self.state = 211
                localctx.value = self.match(T4Parser.IDENTIFIER)


            self.state = 215
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==T4Parser.T__14:
                self.state = 214
                self.match(T4Parser.T__14)


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class TypeSymbolContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def primitiveTypeSymbol(self):
            return self.getTypedRuleContext(T4Parser.PrimitiveTypeSymbolContext,0)


        def complexTypeSymbol(self):
            return self.getTypedRuleContext(T4Parser.ComplexTypeSymbolContext,0)


        def listTypeSymbol(self):
            return self.getTypedRuleContext(T4Parser.ListTypeSymbolContext,0)


        def mapTypeSymbol(self):
            return self.getTypedRuleContext(T4Parser.MapTypeSymbolContext,0)


        def modelTypeSymbol(self):
            return self.getTypedRuleContext(T4Parser.ModelTypeSymbolContext,0)


        def getRuleIndex(self):
            return T4Parser.RULE_typeSymbol

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTypeSymbol" ):
                listener.enterTypeSymbol(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTypeSymbol" ):
                listener.exitTypeSymbol(self)




    def typeSymbol(self):

        localctx = T4Parser.TypeSymbolContext(self, self._ctx, self.state)
        self.enterRule(localctx, 30, self.RULE_typeSymbol)
        try:
            self.state = 222
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [T4Parser.T__15, T4Parser.T__16, T4Parser.T__17, T4Parser.T__18, T4Parser.T__19]:
                self.enterOuterAlt(localctx, 1)
                self.state = 217
                self.primitiveTypeSymbol()
                pass
            elif token in [T4Parser.IDENTIFIER]:
                self.enterOuterAlt(localctx, 2)
                self.state = 218
                self.complexTypeSymbol()
                pass
            elif token in [T4Parser.T__20]:
                self.enterOuterAlt(localctx, 3)
                self.state = 219
                self.listTypeSymbol()
                pass
            elif token in [T4Parser.T__23]:
                self.enterOuterAlt(localctx, 4)
                self.state = 220
                self.mapTypeSymbol()
                pass
            elif token in [T4Parser.T__24]:
                self.enterOuterAlt(localctx, 5)
                self.state = 221
                self.modelTypeSymbol()
                pass
            else:
                raise NoViableAltException(self)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ComplexTypeSymbolContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser
            self.name = None # Token

        def IDENTIFIER(self):
            return self.getToken(T4Parser.IDENTIFIER, 0)

        def getRuleIndex(self):
            return T4Parser.RULE_complexTypeSymbol

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterComplexTypeSymbol" ):
                listener.enterComplexTypeSymbol(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitComplexTypeSymbol" ):
                listener.exitComplexTypeSymbol(self)




    def complexTypeSymbol(self):

        localctx = T4Parser.ComplexTypeSymbolContext(self, self._ctx, self.state)
        self.enterRule(localctx, 32, self.RULE_complexTypeSymbol)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 224
            localctx.name = self.match(T4Parser.IDENTIFIER)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class PrimitiveTypeSymbolContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser
            self.name = None # Token


        def getRuleIndex(self):
            return T4Parser.RULE_primitiveTypeSymbol

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterPrimitiveTypeSymbol" ):
                listener.enterPrimitiveTypeSymbol(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitPrimitiveTypeSymbol" ):
                listener.exitPrimitiveTypeSymbol(self)




    def primitiveTypeSymbol(self):

        localctx = T4Parser.PrimitiveTypeSymbolContext(self, self._ctx, self.state)
        self.enterRule(localctx, 34, self.RULE_primitiveTypeSymbol)
        try:
            self.state = 231
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [T4Parser.T__15]:
                self.enterOuterAlt(localctx, 1)
                self.state = 226
                localctx.name = self.match(T4Parser.T__15)
                pass
            elif token in [T4Parser.T__16]:
                self.enterOuterAlt(localctx, 2)
                self.state = 227
                localctx.name = self.match(T4Parser.T__16)
                pass
            elif token in [T4Parser.T__17]:
                self.enterOuterAlt(localctx, 3)
                self.state = 228
                localctx.name = self.match(T4Parser.T__17)
                pass
            elif token in [T4Parser.T__18]:
                self.enterOuterAlt(localctx, 4)
                self.state = 229
                localctx.name = self.match(T4Parser.T__18)
                pass
            elif token in [T4Parser.T__19]:
                self.enterOuterAlt(localctx, 5)
                self.state = 230
                localctx.name = self.match(T4Parser.T__19)
                pass
            else:
                raise NoViableAltException(self)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ListTypeSymbolContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser
            self.valueType = None # TypeSymbolContext

        def typeSymbol(self):
            return self.getTypedRuleContext(T4Parser.TypeSymbolContext,0)


        def getRuleIndex(self):
            return T4Parser.RULE_listTypeSymbol

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterListTypeSymbol" ):
                listener.enterListTypeSymbol(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitListTypeSymbol" ):
                listener.exitListTypeSymbol(self)




    def listTypeSymbol(self):

        localctx = T4Parser.ListTypeSymbolContext(self, self._ctx, self.state)
        self.enterRule(localctx, 36, self.RULE_listTypeSymbol)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 233
            self.match(T4Parser.T__20)
            self.state = 234
            self.match(T4Parser.T__21)
            self.state = 235
            localctx.valueType = self.typeSymbol()
            self.state = 236
            self.match(T4Parser.T__22)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class MapTypeSymbolContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser
            self.valueType = None # TypeSymbolContext

        def typeSymbol(self):
            return self.getTypedRuleContext(T4Parser.TypeSymbolContext,0)


        def getRuleIndex(self):
            return T4Parser.RULE_mapTypeSymbol

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterMapTypeSymbol" ):
                listener.enterMapTypeSymbol(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitMapTypeSymbol" ):
                listener.exitMapTypeSymbol(self)




    def mapTypeSymbol(self):

        localctx = T4Parser.MapTypeSymbolContext(self, self._ctx, self.state)
        self.enterRule(localctx, 38, self.RULE_mapTypeSymbol)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 238
            self.match(T4Parser.T__23)
            self.state = 239
            self.match(T4Parser.T__21)
            self.state = 240
            localctx.valueType = self.typeSymbol()
            self.state = 241
            self.match(T4Parser.T__22)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ModelTypeSymbolContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser
            self.valueType = None # TypeSymbolContext

        def typeSymbol(self):
            return self.getTypedRuleContext(T4Parser.TypeSymbolContext,0)


        def getRuleIndex(self):
            return T4Parser.RULE_modelTypeSymbol

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterModelTypeSymbol" ):
                listener.enterModelTypeSymbol(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitModelTypeSymbol" ):
                listener.exitModelTypeSymbol(self)




    def modelTypeSymbol(self):

        localctx = T4Parser.ModelTypeSymbolContext(self, self._ctx, self.state)
        self.enterRule(localctx, 40, self.RULE_modelTypeSymbol)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 243
            self.match(T4Parser.T__24)
            self.state = 244
            self.match(T4Parser.T__21)
            self.state = 245
            localctx.valueType = self.typeSymbol()
            self.state = 246
            self.match(T4Parser.T__22)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class StructSymbolContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser
            self.comment = None # Token
            self.name = None # Token

        def IDENTIFIER(self):
            return self.getToken(T4Parser.IDENTIFIER, 0)

        def tagSymbol(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(T4Parser.TagSymbolContext)
            else:
                return self.getTypedRuleContext(T4Parser.TagSymbolContext,i)


        def structFieldSymbol(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(T4Parser.StructFieldSymbolContext)
            else:
                return self.getTypedRuleContext(T4Parser.StructFieldSymbolContext,i)


        def DOCCOMMENT(self):
            return self.getToken(T4Parser.DOCCOMMENT, 0)

        def getRuleIndex(self):
            return T4Parser.RULE_structSymbol

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterStructSymbol" ):
                listener.enterStructSymbol(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitStructSymbol" ):
                listener.exitStructSymbol(self)




    def structSymbol(self):

        localctx = T4Parser.StructSymbolContext(self, self._ctx, self.state)
        self.enterRule(localctx, 42, self.RULE_structSymbol)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 249
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==T4Parser.DOCCOMMENT:
                self.state = 248
                localctx.comment = self.match(T4Parser.DOCCOMMENT)


            self.state = 254
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==T4Parser.TAGLINE:
                self.state = 251
                self.tagSymbol()
                self.state = 256
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 257
            self.match(T4Parser.T__25)
            self.state = 258
            localctx.name = self.match(T4Parser.IDENTIFIER)
            self.state = 259
            self.match(T4Parser.T__5)
            self.state = 263
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << T4Parser.T__15) | (1 << T4Parser.T__16) | (1 << T4Parser.T__17) | (1 << T4Parser.T__18) | (1 << T4Parser.T__19) | (1 << T4Parser.T__20) | (1 << T4Parser.T__23) | (1 << T4Parser.T__24) | (1 << T4Parser.TAGLINE) | (1 << T4Parser.IDENTIFIER) | (1 << T4Parser.DOCCOMMENT))) != 0):
                self.state = 260
                self.structFieldSymbol()
                self.state = 265
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 266
            self.match(T4Parser.T__6)
            self.state = 268
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==T4Parser.T__1:
                self.state = 267
                self.match(T4Parser.T__1)


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class StructFieldSymbolContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser
            self.comment = None # Token
            self.name = None # Token
            self.value = None # Token

        def typeSymbol(self):
            return self.getTypedRuleContext(T4Parser.TypeSymbolContext,0)


        def IDENTIFIER(self):
            return self.getToken(T4Parser.IDENTIFIER, 0)

        def tagSymbol(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(T4Parser.TagSymbolContext)
            else:
                return self.getTypedRuleContext(T4Parser.TagSymbolContext,i)


        def DOCCOMMENT(self):
            return self.getToken(T4Parser.DOCCOMMENT, 0)

        def STRING(self):
            return self.getToken(T4Parser.STRING, 0)

        def getRuleIndex(self):
            return T4Parser.RULE_structFieldSymbol

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterStructFieldSymbol" ):
                listener.enterStructFieldSymbol(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitStructFieldSymbol" ):
                listener.exitStructFieldSymbol(self)




    def structFieldSymbol(self):

        localctx = T4Parser.StructFieldSymbolContext(self, self._ctx, self.state)
        self.enterRule(localctx, 44, self.RULE_structFieldSymbol)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 271
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==T4Parser.DOCCOMMENT:
                self.state = 270
                localctx.comment = self.match(T4Parser.DOCCOMMENT)


            self.state = 276
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==T4Parser.TAGLINE:
                self.state = 273
                self.tagSymbol()
                self.state = 278
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 279
            self.typeSymbol()
            self.state = 280
            localctx.name = self.match(T4Parser.IDENTIFIER)
            self.state = 283
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==T4Parser.T__12:
                self.state = 281
                self.match(T4Parser.T__12)
                self.state = 282
                localctx.value = self.match(T4Parser.STRING)


            self.state = 286
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==T4Parser.T__1:
                self.state = 285
                self.match(T4Parser.T__1)


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class EnumSymbolContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser
            self.comment = None # Token
            self.name = None # Token

        def enumTypeSymbol(self):
            return self.getTypedRuleContext(T4Parser.EnumTypeSymbolContext,0)


        def IDENTIFIER(self):
            return self.getToken(T4Parser.IDENTIFIER, 0)

        def tagSymbol(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(T4Parser.TagSymbolContext)
            else:
                return self.getTypedRuleContext(T4Parser.TagSymbolContext,i)


        def enumMemberSymbol(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(T4Parser.EnumMemberSymbolContext)
            else:
                return self.getTypedRuleContext(T4Parser.EnumMemberSymbolContext,i)


        def DOCCOMMENT(self):
            return self.getToken(T4Parser.DOCCOMMENT, 0)

        def getRuleIndex(self):
            return T4Parser.RULE_enumSymbol

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterEnumSymbol" ):
                listener.enterEnumSymbol(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitEnumSymbol" ):
                listener.exitEnumSymbol(self)




    def enumSymbol(self):

        localctx = T4Parser.EnumSymbolContext(self, self._ctx, self.state)
        self.enterRule(localctx, 46, self.RULE_enumSymbol)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 289
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==T4Parser.DOCCOMMENT:
                self.state = 288
                localctx.comment = self.match(T4Parser.DOCCOMMENT)


            self.state = 294
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==T4Parser.TAGLINE:
                self.state = 291
                self.tagSymbol()
                self.state = 296
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 297
            self.enumTypeSymbol()
            self.state = 298
            localctx.name = self.match(T4Parser.IDENTIFIER)
            self.state = 299
            self.match(T4Parser.T__5)
            self.state = 303
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << T4Parser.TAGLINE) | (1 << T4Parser.IDENTIFIER) | (1 << T4Parser.DOCCOMMENT))) != 0):
                self.state = 300
                self.enumMemberSymbol()
                self.state = 305
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 306
            self.match(T4Parser.T__6)
            self.state = 308
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==T4Parser.T__1:
                self.state = 307
                self.match(T4Parser.T__1)


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class EnumTypeSymbolContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser
            self.isEnum = None # Token
            self.isFlag = None # Token


        def getRuleIndex(self):
            return T4Parser.RULE_enumTypeSymbol

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterEnumTypeSymbol" ):
                listener.enterEnumTypeSymbol(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitEnumTypeSymbol" ):
                listener.exitEnumTypeSymbol(self)




    def enumTypeSymbol(self):

        localctx = T4Parser.EnumTypeSymbolContext(self, self._ctx, self.state)
        self.enterRule(localctx, 48, self.RULE_enumTypeSymbol)
        try:
            self.state = 312
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [T4Parser.T__26]:
                self.enterOuterAlt(localctx, 1)
                self.state = 310
                localctx.isEnum = self.match(T4Parser.T__26)
                pass
            elif token in [T4Parser.T__27]:
                self.enterOuterAlt(localctx, 2)
                self.state = 311
                localctx.isFlag = self.match(T4Parser.T__27)
                pass
            else:
                raise NoViableAltException(self)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class EnumMemberSymbolContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser
            self.comment = None # Token
            self.name = None # Token

        def IDENTIFIER(self):
            return self.getToken(T4Parser.IDENTIFIER, 0)

        def tagSymbol(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(T4Parser.TagSymbolContext)
            else:
                return self.getTypedRuleContext(T4Parser.TagSymbolContext,i)


        def intSymbol(self):
            return self.getTypedRuleContext(T4Parser.IntSymbolContext,0)


        def DOCCOMMENT(self):
            return self.getToken(T4Parser.DOCCOMMENT, 0)

        def getRuleIndex(self):
            return T4Parser.RULE_enumMemberSymbol

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterEnumMemberSymbol" ):
                listener.enterEnumMemberSymbol(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitEnumMemberSymbol" ):
                listener.exitEnumMemberSymbol(self)




    def enumMemberSymbol(self):

        localctx = T4Parser.EnumMemberSymbolContext(self, self._ctx, self.state)
        self.enterRule(localctx, 50, self.RULE_enumMemberSymbol)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 315
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==T4Parser.DOCCOMMENT:
                self.state = 314
                localctx.comment = self.match(T4Parser.DOCCOMMENT)


            self.state = 320
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==T4Parser.TAGLINE:
                self.state = 317
                self.tagSymbol()
                self.state = 322
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 323
            localctx.name = self.match(T4Parser.IDENTIFIER)
            self.state = 326
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==T4Parser.T__12:
                self.state = 324
                self.match(T4Parser.T__12)
                self.state = 325
                self.intSymbol()


            self.state = 329
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==T4Parser.T__14:
                self.state = 328
                self.match(T4Parser.T__14)


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class IntSymbolContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser
            self.value = None # Token

        def INTCONSTANT(self):
            return self.getToken(T4Parser.INTCONSTANT, 0)

        def HEXCONSTANT(self):
            return self.getToken(T4Parser.HEXCONSTANT, 0)

        def getRuleIndex(self):
            return T4Parser.RULE_intSymbol

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterIntSymbol" ):
                listener.enterIntSymbol(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitIntSymbol" ):
                listener.exitIntSymbol(self)




    def intSymbol(self):

        localctx = T4Parser.IntSymbolContext(self, self._ctx, self.state)
        self.enterRule(localctx, 52, self.RULE_intSymbol)
        try:
            self.state = 333
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [T4Parser.INTCONSTANT]:
                self.enterOuterAlt(localctx, 1)
                self.state = 331
                localctx.value = self.match(T4Parser.INTCONSTANT)
                pass
            elif token in [T4Parser.HEXCONSTANT]:
                self.enterOuterAlt(localctx, 2)
                self.state = 332
                localctx.value = self.match(T4Parser.HEXCONSTANT)
                pass
            else:
                raise NoViableAltException(self)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx





