# Generated from Dynabuffers.g4 by ANTLR 4.7.2
# encoding: utf-8
import sys
from io import StringIO

from antlr4 import *
from typing.io import TextIO


def serializedATN():
    with StringIO() as buf:
        buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3\36")
        buf.write("q\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b")
        buf.write("\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\3\2\3\2\3\2\7\2")
        buf.write("\34\n\2\f\2\16\2\37\13\2\3\3\3\3\3\3\3\3\6\3%\n\3\r\3")
        buf.write("\16\3&\3\3\3\3\3\4\3\4\3\4\5\4.\n\4\3\4\3\4\6\4\62\n\4")
        buf.write("\r\4\16\4\63\3\4\3\4\3\5\3\5\3\5\3\5\6\5<\n\5\r\5\16\5")
        buf.write("=\3\5\3\5\3\6\7\6C\n\6\f\6\16\6F\13\6\3\6\3\6\3\6\3\6")
        buf.write("\5\6L\n\6\3\6\5\6O\n\6\3\6\3\6\5\6S\n\6\3\7\3\7\3\b\3")
        buf.write("\b\3\b\3\b\3\t\3\t\6\t]\n\t\r\t\16\t^\3\t\3\t\3\n\3\n")
        buf.write("\3\n\3\n\3\13\3\13\3\13\3\13\3\13\3\13\5\13m\n\13\3\f")
        buf.write("\3\f\3\f\2\2\r\2\4\6\b\n\f\16\20\22\24\26\2\5\4\2\n\20")
        buf.write("\30\30\3\2\24\25\3\2\30\33\2r\2\35\3\2\2\2\4 \3\2\2\2")
        buf.write("\6*\3\2\2\2\b\67\3\2\2\2\nD\3\2\2\2\fT\3\2\2\2\16V\3\2")
        buf.write("\2\2\20Z\3\2\2\2\22b\3\2\2\2\24f\3\2\2\2\26n\3\2\2\2\30")
        buf.write("\34\5\4\3\2\31\34\5\6\4\2\32\34\5\b\5\2\33\30\3\2\2\2")
        buf.write("\33\31\3\2\2\2\33\32\3\2\2\2\34\37\3\2\2\2\35\33\3\2\2")
        buf.write("\2\35\36\3\2\2\2\36\3\3\2\2\2\37\35\3\2\2\2 !\7\3\2\2")
        buf.write("!\"\7\30\2\2\"$\7\4\2\2#%\7\30\2\2$#\3\2\2\2%&\3\2\2\2")
        buf.write("&$\3\2\2\2&\'\3\2\2\2\'(\3\2\2\2()\7\5\2\2)\5\3\2\2\2")
        buf.write("*+\7\6\2\2+-\7\30\2\2,.\5\20\t\2-,\3\2\2\2-.\3\2\2\2.")
        buf.write("/\3\2\2\2/\61\7\4\2\2\60\62\5\n\6\2\61\60\3\2\2\2\62\63")
        buf.write("\3\2\2\2\63\61\3\2\2\2\63\64\3\2\2\2\64\65\3\2\2\2\65")
        buf.write("\66\7\5\2\2\66\7\3\2\2\2\678\7\7\2\289\7\30\2\29;\7\4")
        buf.write("\2\2:<\7\30\2\2;:\3\2\2\2<=\3\2\2\2=;\3\2\2\2=>\3\2\2")
        buf.write("\2>?\3\2\2\2?@\7\5\2\2@\t\3\2\2\2AC\5\24\13\2BA\3\2\2")
        buf.write("\2CF\3\2\2\2DB\3\2\2\2DE\3\2\2\2EG\3\2\2\2FD\3\2\2\2G")
        buf.write("H\7\30\2\2HK\7\b\2\2IL\5\f\7\2JL\5\16\b\2KI\3\2\2\2KJ")
        buf.write("\3\2\2\2LN\3\2\2\2MO\5\22\n\2NM\3\2\2\2NO\3\2\2\2OR\3")
        buf.write("\2\2\2PQ\7\t\2\2QS\5\26\f\2RP\3\2\2\2RS\3\2\2\2S\13\3")
        buf.write("\2\2\2TU\t\2\2\2U\r\3\2\2\2VW\7\21\2\2WX\5\f\7\2XY\7\22")
        buf.write("\2\2Y\17\3\2\2\2Z\\\7\23\2\2[]\t\3\2\2\\[\3\2\2\2]^\3")
        buf.write("\2\2\2^\\\3\2\2\2^_\3\2\2\2_`\3\2\2\2`a\7\26\2\2a\21\3")
        buf.write("\2\2\2bc\7\23\2\2cd\7\25\2\2de\7\26\2\2e\23\3\2\2\2fg")
        buf.write("\7\27\2\2gl\7\30\2\2hi\7\23\2\2ij\5\26\f\2jk\7\26\2\2")
        buf.write("km\3\2\2\2lh\3\2\2\2lm\3\2\2\2m\25\3\2\2\2no\t\4\2\2o")
        buf.write("\27\3\2\2\2\16\33\35&-\63=DKNR^l")
        return buf.getvalue()


class DynabuffersParser ( Parser ):

    grammarFileName = "Dynabuffers.g4"

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

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

    sharedContextCache = PredictionContextCache()

    literalNames = [ "<INVALID>", "'enum'", "'{'", "'}'", "'class'", "'union'",
                     "':'", "'='", "'string'", "'short'", "'boolean'", "'byte'",
                     "'float'", "'long'", "'int'", "'['", "']'", "'('",
                     "'primary'", "'deprecated'", "')'", "'@'", "<INVALID>",
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>",
                     "<INVALID>", "';'" ]

    symbolicNames = [ "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>",
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>",
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>",
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>",
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>",
                      "<INVALID>", "<INVALID>", "IDENTIFIER", "STRING",
                      "NUMBER", "BOOLEAN", "WHITESPACE", "LINE_COMMENT",
                      "SEMICOLON" ]

    RULE_compilation = 0
    RULE_enumType = 1
    RULE_classType = 2
    RULE_unionType = 3
    RULE_fieldType = 4
    RULE_dataType = 5
    RULE_arrayType = 6
    RULE_classOptions = 7
    RULE_fieldOptions = 8
    RULE_annotation = 9
    RULE_value = 10

    ruleNames =  [ "compilation", "enumType", "classType", "unionType",
                   "fieldType", "dataType", "arrayType", "classOptions",
                   "fieldOptions", "annotation", "value" ]

    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
    IDENTIFIER=22
    STRING=23
    NUMBER=24
    BOOLEAN=25
    WHITESPACE=26
    LINE_COMMENT=27
    SEMICOLON=28

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




    class CompilationContext(ParserRuleContext):

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

        def enumType(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(DynabuffersParser.EnumTypeContext)
            else:
                return self.getTypedRuleContext(DynabuffersParser.EnumTypeContext,i)


        def classType(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(DynabuffersParser.ClassTypeContext)
            else:
                return self.getTypedRuleContext(DynabuffersParser.ClassTypeContext,i)


        def unionType(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(DynabuffersParser.UnionTypeContext)
            else:
                return self.getTypedRuleContext(DynabuffersParser.UnionTypeContext,i)


        def getRuleIndex(self):
            return DynabuffersParser.RULE_compilation

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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitCompilation" ):
                return visitor.visitCompilation(self)
            else:
                return visitor.visitChildren(self)




    def compilation(self):

        localctx = DynabuffersParser.CompilationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 0, self.RULE_compilation)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 27
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << DynabuffersParser.T__0) | (1 << DynabuffersParser.T__3) | (1 << DynabuffersParser.T__4))) != 0):
                self.state = 25
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [DynabuffersParser.T__0]:
                    self.state = 22
                    self.enumType()
                    pass
                elif token in [DynabuffersParser.T__3]:
                    self.state = 23
                    self.classType()
                    pass
                elif token in [DynabuffersParser.T__4]:
                    self.state = 24
                    self.unionType()
                    pass
                else:
                    raise NoViableAltException(self)

                self.state = 29
                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 EnumTypeContext(ParserRuleContext):

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

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

        def getRuleIndex(self):
            return DynabuffersParser.RULE_enumType

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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitEnumType" ):
                return visitor.visitEnumType(self)
            else:
                return visitor.visitChildren(self)




    def enumType(self):

        localctx = DynabuffersParser.EnumTypeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 2, self.RULE_enumType)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 30
            self.match(DynabuffersParser.T__0)
            self.state = 31
            self.match(DynabuffersParser.IDENTIFIER)
            self.state = 32
            self.match(DynabuffersParser.T__1)
            self.state = 34
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 33
                self.match(DynabuffersParser.IDENTIFIER)
                self.state = 36
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not (_la==DynabuffersParser.IDENTIFIER):
                    break

            self.state = 38
            self.match(DynabuffersParser.T__2)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ClassTypeContext(ParserRuleContext):

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

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

        def classOptions(self):
            return self.getTypedRuleContext(DynabuffersParser.ClassOptionsContext,0)


        def fieldType(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(DynabuffersParser.FieldTypeContext)
            else:
                return self.getTypedRuleContext(DynabuffersParser.FieldTypeContext,i)


        def getRuleIndex(self):
            return DynabuffersParser.RULE_classType

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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitClassType" ):
                return visitor.visitClassType(self)
            else:
                return visitor.visitChildren(self)




    def classType(self):

        localctx = DynabuffersParser.ClassTypeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 4, self.RULE_classType)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 40
            self.match(DynabuffersParser.T__3)
            self.state = 41
            self.match(DynabuffersParser.IDENTIFIER)
            self.state = 43
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==DynabuffersParser.T__16:
                self.state = 42
                self.classOptions()


            self.state = 45
            self.match(DynabuffersParser.T__1)
            self.state = 47
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 46
                self.fieldType()
                self.state = 49
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not (_la==DynabuffersParser.T__20 or _la==DynabuffersParser.IDENTIFIER):
                    break

            self.state = 51
            self.match(DynabuffersParser.T__2)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class UnionTypeContext(ParserRuleContext):

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

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

        def getRuleIndex(self):
            return DynabuffersParser.RULE_unionType

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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitUnionType" ):
                return visitor.visitUnionType(self)
            else:
                return visitor.visitChildren(self)




    def unionType(self):

        localctx = DynabuffersParser.UnionTypeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 6, self.RULE_unionType)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 53
            self.match(DynabuffersParser.T__4)
            self.state = 54
            self.match(DynabuffersParser.IDENTIFIER)
            self.state = 55
            self.match(DynabuffersParser.T__1)
            self.state = 57
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 56
                self.match(DynabuffersParser.IDENTIFIER)
                self.state = 59
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not (_la==DynabuffersParser.IDENTIFIER):
                    break

            self.state = 61
            self.match(DynabuffersParser.T__2)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class FieldTypeContext(ParserRuleContext):

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

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

        def dataType(self):
            return self.getTypedRuleContext(DynabuffersParser.DataTypeContext,0)


        def arrayType(self):
            return self.getTypedRuleContext(DynabuffersParser.ArrayTypeContext,0)


        def annotation(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(DynabuffersParser.AnnotationContext)
            else:
                return self.getTypedRuleContext(DynabuffersParser.AnnotationContext,i)


        def fieldOptions(self):
            return self.getTypedRuleContext(DynabuffersParser.FieldOptionsContext,0)


        def value(self):
            return self.getTypedRuleContext(DynabuffersParser.ValueContext,0)


        def getRuleIndex(self):
            return DynabuffersParser.RULE_fieldType

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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitFieldType" ):
                return visitor.visitFieldType(self)
            else:
                return visitor.visitChildren(self)




    def fieldType(self):

        localctx = DynabuffersParser.FieldTypeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 8, self.RULE_fieldType)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 66
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==DynabuffersParser.T__20:
                self.state = 63
                self.annotation()
                self.state = 68
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 69
            self.match(DynabuffersParser.IDENTIFIER)
            self.state = 70
            self.match(DynabuffersParser.T__5)
            self.state = 73
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [DynabuffersParser.T__7, DynabuffersParser.T__8, DynabuffersParser.T__9, DynabuffersParser.T__10, DynabuffersParser.T__11, DynabuffersParser.T__12, DynabuffersParser.T__13, DynabuffersParser.IDENTIFIER]:
                self.state = 71
                self.dataType()
                pass
            elif token in [DynabuffersParser.T__14]:
                self.state = 72
                self.arrayType()
                pass
            else:
                raise NoViableAltException(self)

            self.state = 76
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==DynabuffersParser.T__16:
                self.state = 75
                self.fieldOptions()


            self.state = 80
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==DynabuffersParser.T__6:
                self.state = 78
                self.match(DynabuffersParser.T__6)
                self.state = 79
                self.value()


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


    class DataTypeContext(ParserRuleContext):

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

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

        def getRuleIndex(self):
            return DynabuffersParser.RULE_dataType

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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitDataType" ):
                return visitor.visitDataType(self)
            else:
                return visitor.visitChildren(self)




    def dataType(self):

        localctx = DynabuffersParser.DataTypeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 10, self.RULE_dataType)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 82
            _la = self._input.LA(1)
            if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << DynabuffersParser.T__7) | (1 << DynabuffersParser.T__8) | (1 << DynabuffersParser.T__9) | (1 << DynabuffersParser.T__10) | (1 << DynabuffersParser.T__11) | (1 << DynabuffersParser.T__12) | (1 << DynabuffersParser.T__13) | (1 << DynabuffersParser.IDENTIFIER))) != 0)):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ArrayTypeContext(ParserRuleContext):

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

        def dataType(self):
            return self.getTypedRuleContext(DynabuffersParser.DataTypeContext,0)


        def getRuleIndex(self):
            return DynabuffersParser.RULE_arrayType

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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitArrayType" ):
                return visitor.visitArrayType(self)
            else:
                return visitor.visitChildren(self)




    def arrayType(self):

        localctx = DynabuffersParser.ArrayTypeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 12, self.RULE_arrayType)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 84
            self.match(DynabuffersParser.T__14)
            self.state = 85
            self.dataType()
            self.state = 86
            self.match(DynabuffersParser.T__15)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ClassOptionsContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return DynabuffersParser.RULE_classOptions

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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitClassOptions" ):
                return visitor.visitClassOptions(self)
            else:
                return visitor.visitChildren(self)




    def classOptions(self):

        localctx = DynabuffersParser.ClassOptionsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 14, self.RULE_classOptions)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 88
            self.match(DynabuffersParser.T__16)
            self.state = 90
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 89
                _la = self._input.LA(1)
                if not(_la==DynabuffersParser.T__17 or _la==DynabuffersParser.T__18):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 92
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not (_la==DynabuffersParser.T__17 or _la==DynabuffersParser.T__18):
                    break

            self.state = 94
            self.match(DynabuffersParser.T__19)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class FieldOptionsContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return DynabuffersParser.RULE_fieldOptions

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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitFieldOptions" ):
                return visitor.visitFieldOptions(self)
            else:
                return visitor.visitChildren(self)




    def fieldOptions(self):

        localctx = DynabuffersParser.FieldOptionsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 16, self.RULE_fieldOptions)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 96
            self.match(DynabuffersParser.T__16)
            self.state = 97
            self.match(DynabuffersParser.T__18)
            self.state = 98
            self.match(DynabuffersParser.T__19)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class AnnotationContext(ParserRuleContext):

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

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

        def value(self):
            return self.getTypedRuleContext(DynabuffersParser.ValueContext,0)


        def getRuleIndex(self):
            return DynabuffersParser.RULE_annotation

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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitAnnotation" ):
                return visitor.visitAnnotation(self)
            else:
                return visitor.visitChildren(self)




    def annotation(self):

        localctx = DynabuffersParser.AnnotationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 18, self.RULE_annotation)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 100
            self.match(DynabuffersParser.T__20)
            self.state = 101
            self.match(DynabuffersParser.IDENTIFIER)
            self.state = 106
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==DynabuffersParser.T__16:
                self.state = 102
                self.match(DynabuffersParser.T__16)
                self.state = 103
                self.value()
                self.state = 104
                self.match(DynabuffersParser.T__19)


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


    class ValueContext(ParserRuleContext):

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

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

        def NUMBER(self):
            return self.getToken(DynabuffersParser.NUMBER, 0)

        def BOOLEAN(self):
            return self.getToken(DynabuffersParser.BOOLEAN, 0)

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

        def getRuleIndex(self):
            return DynabuffersParser.RULE_value

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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitValue" ):
                return visitor.visitValue(self)
            else:
                return visitor.visitChildren(self)




    def value(self):

        localctx = DynabuffersParser.ValueContext(self, self._ctx, self.state)
        self.enterRule(localctx, 20, self.RULE_value)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 108
            _la = self._input.LA(1)
            if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << DynabuffersParser.IDENTIFIER) | (1 << DynabuffersParser.STRING) | (1 << DynabuffersParser.NUMBER) | (1 << DynabuffersParser.BOOLEAN))) != 0)):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx





