# Generated from UVL.g4 by ANTLR 4.7.2
# encoding: utf-8
from antlr4 import *
from io import StringIO
from typing.io import TextIO
import sys

def serializedATN():
    with StringIO() as buf:
        buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3\37")
        buf.write("\u00cb\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7")
        buf.write("\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r\4\16")
        buf.write("\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22\4\23\t\23")
        buf.write("\3\2\5\2(\n\2\3\2\5\2+\n\2\3\2\3\2\5\2/\n\2\3\2\5\2\62")
        buf.write("\n\2\3\3\3\3\3\3\7\3\67\n\3\f\3\16\3:\13\3\3\4\3\4\3\4")
        buf.write("\3\4\3\4\3\5\3\5\3\5\7\5D\n\5\f\5\16\5G\13\5\3\5\5\5J")
        buf.write("\n\5\3\6\3\6\3\6\7\6O\n\6\f\6\16\6R\13\6\3\6\5\6U\n\6")
        buf.write("\3\7\3\7\5\7Y\n\7\3\7\5\7\\\n\7\3\7\5\7_\n\7\3\b\3\b\7")
        buf.write("\bc\n\b\f\b\16\bf\13\b\3\b\3\b\3\t\3\t\3\t\3\t\3\t\7\t")
        buf.write("o\n\t\f\t\16\tr\13\t\3\t\3\t\5\tv\n\t\3\n\3\n\3\n\3\n")
        buf.write("\3\n\5\n}\n\n\3\13\3\13\3\f\3\f\3\r\3\r\3\16\3\16\3\16")
        buf.write("\3\16\5\16\u0089\n\16\7\16\u008b\n\16\f\16\16\16\u008e")
        buf.write("\13\16\3\16\3\16\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3")
        buf.write("\17\5\17\u009a\n\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17")
        buf.write("\3\17\3\17\3\17\7\17\u00a6\n\17\f\17\16\17\u00a9\13\17")
        buf.write("\3\20\3\20\3\20\3\20\5\20\u00af\n\20\3\21\3\21\3\21\7")
        buf.write("\21\u00b4\n\21\f\21\16\21\u00b7\13\21\3\21\3\21\3\22\3")
        buf.write("\22\3\22\5\22\u00be\n\22\3\22\5\22\u00c1\n\22\3\23\3\23")
        buf.write("\3\23\7\23\u00c6\n\23\f\23\16\23\u00c9\13\23\3\23\2\3")
        buf.write("\34\24\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36 \"$\2\4")
        buf.write("\3\3\37\37\3\2\30\33\2\u00d6\2\'\3\2\2\2\4\63\3\2\2\2")
        buf.write("\6;\3\2\2\2\b@\3\2\2\2\nK\3\2\2\2\fV\3\2\2\2\16d\3\2\2")
        buf.write("\2\20u\3\2\2\2\22w\3\2\2\2\24~\3\2\2\2\26\u0080\3\2\2")
        buf.write("\2\30\u0082\3\2\2\2\32\u0084\3\2\2\2\34\u0099\3\2\2\2")
        buf.write("\36\u00ae\3\2\2\2 \u00b0\3\2\2\2\"\u00ba\3\2\2\2$\u00c2")
        buf.write("\3\2\2\2&(\5\4\3\2\'&\3\2\2\2\'(\3\2\2\2(*\3\2\2\2)+\5")
        buf.write(" \21\2*)\3\2\2\2*+\3\2\2\2+,\3\2\2\2,.\5\6\4\2-/\5\32")
        buf.write("\16\2.-\3\2\2\2./\3\2\2\2/\61\3\2\2\2\60\62\7\2\2\3\61")
        buf.write("\60\3\2\2\2\61\62\3\2\2\2\62\3\3\2\2\2\63\64\7\3\2\2\64")
        buf.write("8\7\30\2\2\65\67\7\34\2\2\66\65\3\2\2\2\67:\3\2\2\28\66")
        buf.write("\3\2\2\289\3\2\2\29\5\3\2\2\2:8\3\2\2\2;<\7\4\2\2<=\7")
        buf.write("\36\2\2=>\5\b\5\2>?\7\37\2\2?\7\3\2\2\2@I\5\f\7\2AE\7")
        buf.write("\36\2\2BD\5\n\6\2CB\3\2\2\2DG\3\2\2\2EC\3\2\2\2EF\3\2")
        buf.write("\2\2FH\3\2\2\2GE\3\2\2\2HJ\t\2\2\2IA\3\2\2\2IJ\3\2\2\2")
        buf.write("J\t\3\2\2\2KT\5\30\r\2LP\7\36\2\2MO\5\b\5\2NM\3\2\2\2")
        buf.write("OR\3\2\2\2PN\3\2\2\2PQ\3\2\2\2QS\3\2\2\2RP\3\2\2\2SU\t")
        buf.write("\2\2\2TL\3\2\2\2TU\3\2\2\2U\13\3\2\2\2VX\5\16\b\2WY\7")
        buf.write("\34\2\2XW\3\2\2\2XY\3\2\2\2Y[\3\2\2\2Z\\\5\20\t\2[Z\3")
        buf.write("\2\2\2[\\\3\2\2\2\\^\3\2\2\2]_\7\34\2\2^]\3\2\2\2^_\3")
        buf.write("\2\2\2_\r\3\2\2\2`a\7\30\2\2ac\7\5\2\2b`\3\2\2\2cf\3\2")
        buf.write("\2\2db\3\2\2\2de\3\2\2\2eg\3\2\2\2fd\3\2\2\2gh\7\30\2")
        buf.write("\2h\17\3\2\2\2iv\7\6\2\2jk\7\7\2\2kp\5\22\n\2lm\7\b\2")
        buf.write("\2mo\5\22\n\2nl\3\2\2\2or\3\2\2\2pn\3\2\2\2pq\3\2\2\2")
        buf.write("qs\3\2\2\2rp\3\2\2\2st\7\t\2\2tv\3\2\2\2ui\3\2\2\2uj\3")
        buf.write("\2\2\2v\21\3\2\2\2w|\5\24\13\2xy\7\n\2\2yz\5\26\f\2z{")
        buf.write("\7\n\2\2{}\3\2\2\2|x\3\2\2\2|}\3\2\2\2}\23\3\2\2\2~\177")
        buf.write("\7\30\2\2\177\25\3\2\2\2\u0080\u0081\t\3\2\2\u0081\27")
        buf.write("\3\2\2\2\u0082\u0083\7\27\2\2\u0083\31\3\2\2\2\u0084\u0085")
        buf.write("\7\13\2\2\u0085\u008c\7\36\2\2\u0086\u0088\5\34\17\2\u0087")
        buf.write("\u0089\7\34\2\2\u0088\u0087\3\2\2\2\u0088\u0089\3\2\2")
        buf.write("\2\u0089\u008b\3\2\2\2\u008a\u0086\3\2\2\2\u008b\u008e")
        buf.write("\3\2\2\2\u008c\u008a\3\2\2\2\u008c\u008d\3\2\2\2\u008d")
        buf.write("\u008f\3\2\2\2\u008e\u008c\3\2\2\2\u008f\u0090\t\2\2\2")
        buf.write("\u0090\33\3\2\2\2\u0091\u0092\b\17\1\2\u0092\u0093\7\f")
        buf.write("\2\2\u0093\u0094\5\34\17\2\u0094\u0095\7\r\2\2\u0095\u009a")
        buf.write("\3\2\2\2\u0096\u0097\7\20\2\2\u0097\u009a\5\34\17\7\u0098")
        buf.write("\u009a\7\30\2\2\u0099\u0091\3\2\2\2\u0099\u0096\3\2\2")
        buf.write("\2\u0099\u0098\3\2\2\2\u009a\u00a7\3\2\2\2\u009b\u009c")
        buf.write("\f\6\2\2\u009c\u009d\7\21\2\2\u009d\u00a6\5\34\17\7\u009e")
        buf.write("\u009f\f\5\2\2\u009f\u00a0\7\22\2\2\u00a0\u00a6\5\34\17")
        buf.write("\6\u00a1\u00a2\f\4\2\2\u00a2\u00a3\5\36\20\2\u00a3\u00a4")
        buf.write("\5\34\17\5\u00a4\u00a6\3\2\2\2\u00a5\u009b\3\2\2\2\u00a5")
        buf.write("\u009e\3\2\2\2\u00a5\u00a1\3\2\2\2\u00a6\u00a9\3\2\2\2")
        buf.write("\u00a7\u00a5\3\2\2\2\u00a7\u00a8\3\2\2\2\u00a8\35\3\2")
        buf.write("\2\2\u00a9\u00a7\3\2\2\2\u00aa\u00af\7\23\2\2\u00ab\u00af")
        buf.write("\7\24\2\2\u00ac\u00af\7\25\2\2\u00ad\u00af\7\26\2\2\u00ae")
        buf.write("\u00aa\3\2\2\2\u00ae\u00ab\3\2\2\2\u00ae\u00ac\3\2\2\2")
        buf.write("\u00ae\u00ad\3\2\2\2\u00af\37\3\2\2\2\u00b0\u00b1\7\16")
        buf.write("\2\2\u00b1\u00b5\7\36\2\2\u00b2\u00b4\5\"\22\2\u00b3\u00b2")
        buf.write("\3\2\2\2\u00b4\u00b7\3\2\2\2\u00b5\u00b3\3\2\2\2\u00b5")
        buf.write("\u00b6\3\2\2\2\u00b6\u00b8\3\2\2\2\u00b7\u00b5\3\2\2\2")
        buf.write("\u00b8\u00b9\7\37\2\2\u00b9!\3\2\2\2\u00ba\u00bd\5$\23")
        buf.write("\2\u00bb\u00bc\7\17\2\2\u00bc\u00be\7\30\2\2\u00bd\u00bb")
        buf.write("\3\2\2\2\u00bd\u00be\3\2\2\2\u00be\u00c0\3\2\2\2\u00bf")
        buf.write("\u00c1\7\34\2\2\u00c0\u00bf\3\2\2\2\u00c0\u00c1\3\2\2")
        buf.write("\2\u00c1#\3\2\2\2\u00c2\u00c7\7\30\2\2\u00c3\u00c4\7\5")
        buf.write("\2\2\u00c4\u00c6\7\30\2\2\u00c5\u00c3\3\2\2\2\u00c6\u00c9")
        buf.write("\3\2\2\2\u00c7\u00c5\3\2\2\2\u00c7\u00c8\3\2\2\2\u00c8")
        buf.write("%\3\2\2\2\u00c9\u00c7\3\2\2\2\34\'*.\618EIPTX[^dpu|\u0088")
        buf.write("\u008c\u0099\u00a5\u00a7\u00ae\u00b5\u00bd\u00c0\u00c7")
        return buf.getvalue()


class UVLParser ( Parser ):

    grammarFileName = "UVL.g4"

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

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

    sharedContextCache = PredictionContextCache()

    literalNames = [ "<INVALID>", "'namespace'", "'features'", "'.'", "'{}'", 
                     "'{'", "','", "'}'", "'\"'", "'constraints'", "'('", 
                     "')'", "'imports'", "'as'", "'!'", "'&'", "'|'", "'<=>'", 
                     "'=>'", "'requires'", "'excludes'" ]

    symbolicNames = [ "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "NOT", "AND", "OR", "EQUIVALENCE", 
                      "IMPLICATION", "REQUIRES", "EXCLUDES", "RELATION_WORD", 
                      "WORD", "BOOLEAN", "NUMBER", "VECTOR", "NL", "WS", 
                      "INDENT", "DEDENT" ]

    RULE_feature_model = 0
    RULE_namespace = 1
    RULE_features = 2
    RULE_child = 3
    RULE_relation = 4
    RULE_feature_spec = 5
    RULE_ref = 6
    RULE_attributes = 7
    RULE_attribute = 8
    RULE_key = 9
    RULE_value = 10
    RULE_relation_spec = 11
    RULE_constraints = 12
    RULE_constraint = 13
    RULE_logical_operator = 14
    RULE_imports = 15
    RULE_imp = 16
    RULE_imp_spec = 17

    ruleNames =  [ "feature_model", "namespace", "features", "child", "relation", 
                   "feature_spec", "ref", "attributes", "attribute", "key", 
                   "value", "relation_spec", "constraints", "constraint", 
                   "logical_operator", "imports", "imp", "imp_spec" ]

    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
    NOT=14
    AND=15
    OR=16
    EQUIVALENCE=17
    IMPLICATION=18
    REQUIRES=19
    EXCLUDES=20
    RELATION_WORD=21
    WORD=22
    BOOLEAN=23
    NUMBER=24
    VECTOR=25
    NL=26
    WS=27
    INDENT=28
    DEDENT=29

    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 Feature_modelContext(ParserRuleContext):

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

        def features(self):
            return self.getTypedRuleContext(UVLParser.FeaturesContext,0)


        def namespace(self):
            return self.getTypedRuleContext(UVLParser.NamespaceContext,0)


        def imports(self):
            return self.getTypedRuleContext(UVLParser.ImportsContext,0)


        def constraints(self):
            return self.getTypedRuleContext(UVLParser.ConstraintsContext,0)


        def EOF(self):
            return self.getToken(UVLParser.EOF, 0)

        def getRuleIndex(self):
            return UVLParser.RULE_feature_model

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

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




    def feature_model(self):

        localctx = UVLParser.Feature_modelContext(self, self._ctx, self.state)
        self.enterRule(localctx, 0, self.RULE_feature_model)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 37
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==UVLParser.T__0:
                self.state = 36
                self.namespace()


            self.state = 40
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==UVLParser.T__11:
                self.state = 39
                self.imports()


            self.state = 42
            self.features()
            self.state = 44
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==UVLParser.T__8:
                self.state = 43
                self.constraints()


            self.state = 47
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,3,self._ctx)
            if la_ == 1:
                self.state = 46
                self.match(UVLParser.EOF)


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

    class NamespaceContext(ParserRuleContext):

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

        def WORD(self):
            return self.getToken(UVLParser.WORD, 0)

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

        def getRuleIndex(self):
            return UVLParser.RULE_namespace

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

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




    def namespace(self):

        localctx = UVLParser.NamespaceContext(self, self._ctx, self.state)
        self.enterRule(localctx, 2, self.RULE_namespace)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 49
            self.match(UVLParser.T__0)
            self.state = 50
            self.match(UVLParser.WORD)
            self.state = 54
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==UVLParser.NL:
                self.state = 51
                self.match(UVLParser.NL)
                self.state = 56
                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 FeaturesContext(ParserRuleContext):

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

        def INDENT(self):
            return self.getToken(UVLParser.INDENT, 0)

        def child(self):
            return self.getTypedRuleContext(UVLParser.ChildContext,0)


        def DEDENT(self):
            return self.getToken(UVLParser.DEDENT, 0)

        def getRuleIndex(self):
            return UVLParser.RULE_features

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

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




    def features(self):

        localctx = UVLParser.FeaturesContext(self, self._ctx, self.state)
        self.enterRule(localctx, 4, self.RULE_features)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 57
            self.match(UVLParser.T__1)
            self.state = 58
            self.match(UVLParser.INDENT)
            self.state = 59
            self.child()
            self.state = 60
            self.match(UVLParser.DEDENT)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class ChildContext(ParserRuleContext):

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

        def feature_spec(self):
            return self.getTypedRuleContext(UVLParser.Feature_specContext,0)


        def INDENT(self):
            return self.getToken(UVLParser.INDENT, 0)

        def DEDENT(self):
            return self.getToken(UVLParser.DEDENT, 0)

        def EOF(self):
            return self.getToken(UVLParser.EOF, 0)

        def relation(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(UVLParser.RelationContext)
            else:
                return self.getTypedRuleContext(UVLParser.RelationContext,i)


        def getRuleIndex(self):
            return UVLParser.RULE_child

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

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




    def child(self):

        localctx = UVLParser.ChildContext(self, self._ctx, self.state)
        self.enterRule(localctx, 6, self.RULE_child)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 62
            self.feature_spec()
            self.state = 71
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==UVLParser.INDENT:
                self.state = 63
                self.match(UVLParser.INDENT)
                self.state = 67
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==UVLParser.RELATION_WORD:
                    self.state = 64
                    self.relation()
                    self.state = 69
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 70
                _la = self._input.LA(1)
                if not(_la==UVLParser.EOF or _la==UVLParser.DEDENT):
                    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 RelationContext(ParserRuleContext):

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

        def relation_spec(self):
            return self.getTypedRuleContext(UVLParser.Relation_specContext,0)


        def INDENT(self):
            return self.getToken(UVLParser.INDENT, 0)

        def DEDENT(self):
            return self.getToken(UVLParser.DEDENT, 0)

        def EOF(self):
            return self.getToken(UVLParser.EOF, 0)

        def child(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(UVLParser.ChildContext)
            else:
                return self.getTypedRuleContext(UVLParser.ChildContext,i)


        def getRuleIndex(self):
            return UVLParser.RULE_relation

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

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




    def relation(self):

        localctx = UVLParser.RelationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 8, self.RULE_relation)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 73
            self.relation_spec()
            self.state = 82
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==UVLParser.INDENT:
                self.state = 74
                self.match(UVLParser.INDENT)
                self.state = 78
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==UVLParser.WORD:
                    self.state = 75
                    self.child()
                    self.state = 80
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 81
                _la = self._input.LA(1)
                if not(_la==UVLParser.EOF or _la==UVLParser.DEDENT):
                    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 Feature_specContext(ParserRuleContext):

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

        def ref(self):
            return self.getTypedRuleContext(UVLParser.RefContext,0)


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

        def attributes(self):
            return self.getTypedRuleContext(UVLParser.AttributesContext,0)


        def getRuleIndex(self):
            return UVLParser.RULE_feature_spec

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

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




    def feature_spec(self):

        localctx = UVLParser.Feature_specContext(self, self._ctx, self.state)
        self.enterRule(localctx, 10, self.RULE_feature_spec)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 84
            self.ref()
            self.state = 86
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,9,self._ctx)
            if la_ == 1:
                self.state = 85
                self.match(UVLParser.NL)


            self.state = 89
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==UVLParser.T__3 or _la==UVLParser.T__4:
                self.state = 88
                self.attributes()


            self.state = 92
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==UVLParser.NL:
                self.state = 91
                self.match(UVLParser.NL)


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

    class RefContext(ParserRuleContext):

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

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

        def getRuleIndex(self):
            return UVLParser.RULE_ref

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

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




    def ref(self):

        localctx = UVLParser.RefContext(self, self._ctx, self.state)
        self.enterRule(localctx, 12, self.RULE_ref)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 98
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,12,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 94
                    self.match(UVLParser.WORD)
                    self.state = 95
                    self.match(UVLParser.T__2) 
                self.state = 100
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,12,self._ctx)

            self.state = 101
            self.match(UVLParser.WORD)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class AttributesContext(ParserRuleContext):

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

        def attribute(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(UVLParser.AttributeContext)
            else:
                return self.getTypedRuleContext(UVLParser.AttributeContext,i)


        def getRuleIndex(self):
            return UVLParser.RULE_attributes

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

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




    def attributes(self):

        localctx = UVLParser.AttributesContext(self, self._ctx, self.state)
        self.enterRule(localctx, 14, self.RULE_attributes)
        self._la = 0 # Token type
        try:
            self.state = 115
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [UVLParser.T__3]:
                self.enterOuterAlt(localctx, 1)
                self.state = 103
                self.match(UVLParser.T__3)
                pass
            elif token in [UVLParser.T__4]:
                self.enterOuterAlt(localctx, 2)
                self.state = 104
                self.match(UVLParser.T__4)
                self.state = 105
                self.attribute()
                self.state = 110
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==UVLParser.T__5:
                    self.state = 106
                    self.match(UVLParser.T__5)
                    self.state = 107
                    self.attribute()
                    self.state = 112
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 113
                self.match(UVLParser.T__6)
                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 AttributeContext(ParserRuleContext):

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

        def key(self):
            return self.getTypedRuleContext(UVLParser.KeyContext,0)


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


        def getRuleIndex(self):
            return UVLParser.RULE_attribute

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

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




    def attribute(self):

        localctx = UVLParser.AttributeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 16, self.RULE_attribute)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 117
            self.key()
            self.state = 122
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==UVLParser.T__7:
                self.state = 118
                self.match(UVLParser.T__7)
                self.state = 119
                self.value()
                self.state = 120
                self.match(UVLParser.T__7)


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

    class KeyContext(ParserRuleContext):

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

        def WORD(self):
            return self.getToken(UVLParser.WORD, 0)

        def getRuleIndex(self):
            return UVLParser.RULE_key

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

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




    def key(self):

        localctx = UVLParser.KeyContext(self, self._ctx, self.state)
        self.enterRule(localctx, 18, self.RULE_key)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 124
            self.match(UVLParser.WORD)
        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 BOOLEAN(self):
            return self.getToken(UVLParser.BOOLEAN, 0)

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

        def WORD(self):
            return self.getToken(UVLParser.WORD, 0)

        def VECTOR(self):
            return self.getToken(UVLParser.VECTOR, 0)

        def getRuleIndex(self):
            return UVLParser.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 value(self):

        localctx = UVLParser.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 = 126
            _la = self._input.LA(1)
            if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << UVLParser.WORD) | (1 << UVLParser.BOOLEAN) | (1 << UVLParser.NUMBER) | (1 << UVLParser.VECTOR))) != 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 Relation_specContext(ParserRuleContext):

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

        def RELATION_WORD(self):
            return self.getToken(UVLParser.RELATION_WORD, 0)

        def getRuleIndex(self):
            return UVLParser.RULE_relation_spec

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

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




    def relation_spec(self):

        localctx = UVLParser.Relation_specContext(self, self._ctx, self.state)
        self.enterRule(localctx, 22, self.RULE_relation_spec)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 128
            self.match(UVLParser.RELATION_WORD)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class ConstraintsContext(ParserRuleContext):

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

        def INDENT(self):
            return self.getToken(UVLParser.INDENT, 0)

        def DEDENT(self):
            return self.getToken(UVLParser.DEDENT, 0)

        def EOF(self):
            return self.getToken(UVLParser.EOF, 0)

        def constraint(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(UVLParser.ConstraintContext)
            else:
                return self.getTypedRuleContext(UVLParser.ConstraintContext,i)


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

        def getRuleIndex(self):
            return UVLParser.RULE_constraints

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

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




    def constraints(self):

        localctx = UVLParser.ConstraintsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 24, self.RULE_constraints)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 130
            self.match(UVLParser.T__8)
            self.state = 131
            self.match(UVLParser.INDENT)
            self.state = 138
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << UVLParser.T__9) | (1 << UVLParser.NOT) | (1 << UVLParser.WORD))) != 0):
                self.state = 132
                self.constraint(0)
                self.state = 134
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==UVLParser.NL:
                    self.state = 133
                    self.match(UVLParser.NL)


                self.state = 140
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 141
            _la = self._input.LA(1)
            if not(_la==UVLParser.EOF or _la==UVLParser.DEDENT):
                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 ConstraintContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return UVLParser.RULE_constraint

     
        def copyFrom(self, ctx:ParserRuleContext):
            super().copyFrom(ctx)


    class AndExpContext(ConstraintContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a UVLParser.ConstraintContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def constraint(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(UVLParser.ConstraintContext)
            else:
                return self.getTypedRuleContext(UVLParser.ConstraintContext,i)

        def AND(self):
            return self.getToken(UVLParser.AND, 0)

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

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


    class ParenthesisExpContext(ConstraintContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a UVLParser.ConstraintContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def constraint(self):
            return self.getTypedRuleContext(UVLParser.ConstraintContext,0)


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

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


    class TermContext(ConstraintContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a UVLParser.ConstraintContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def WORD(self):
            return self.getToken(UVLParser.WORD, 0)

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

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


    class OrExpContext(ConstraintContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a UVLParser.ConstraintContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def constraint(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(UVLParser.ConstraintContext)
            else:
                return self.getTypedRuleContext(UVLParser.ConstraintContext,i)

        def OR(self):
            return self.getToken(UVLParser.OR, 0)

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

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


    class LogicalExpContext(ConstraintContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a UVLParser.ConstraintContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def constraint(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(UVLParser.ConstraintContext)
            else:
                return self.getTypedRuleContext(UVLParser.ConstraintContext,i)

        def logical_operator(self):
            return self.getTypedRuleContext(UVLParser.Logical_operatorContext,0)


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

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


    class NotExpContext(ConstraintContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a UVLParser.ConstraintContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def NOT(self):
            return self.getToken(UVLParser.NOT, 0)
        def constraint(self):
            return self.getTypedRuleContext(UVLParser.ConstraintContext,0)


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

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



    def constraint(self, _p:int=0):
        _parentctx = self._ctx
        _parentState = self.state
        localctx = UVLParser.ConstraintContext(self, self._ctx, _parentState)
        _prevctx = localctx
        _startState = 26
        self.enterRecursionRule(localctx, 26, self.RULE_constraint, _p)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 151
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [UVLParser.T__9]:
                localctx = UVLParser.ParenthesisExpContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx

                self.state = 144
                self.match(UVLParser.T__9)
                self.state = 145
                self.constraint(0)
                self.state = 146
                self.match(UVLParser.T__10)
                pass
            elif token in [UVLParser.NOT]:
                localctx = UVLParser.NotExpContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 148
                self.match(UVLParser.NOT)
                self.state = 149
                self.constraint(5)
                pass
            elif token in [UVLParser.WORD]:
                localctx = UVLParser.TermContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 150
                self.match(UVLParser.WORD)
                pass
            else:
                raise NoViableAltException(self)

            self._ctx.stop = self._input.LT(-1)
            self.state = 165
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,20,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    if self._parseListeners is not None:
                        self.triggerExitRuleEvent()
                    _prevctx = localctx
                    self.state = 163
                    self._errHandler.sync(self)
                    la_ = self._interp.adaptivePredict(self._input,19,self._ctx)
                    if la_ == 1:
                        localctx = UVLParser.AndExpContext(self, UVLParser.ConstraintContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_constraint)
                        self.state = 153
                        if not self.precpred(self._ctx, 4):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 4)")
                        self.state = 154
                        self.match(UVLParser.AND)
                        self.state = 155
                        self.constraint(5)
                        pass

                    elif la_ == 2:
                        localctx = UVLParser.OrExpContext(self, UVLParser.ConstraintContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_constraint)
                        self.state = 156
                        if not self.precpred(self._ctx, 3):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 3)")
                        self.state = 157
                        self.match(UVLParser.OR)
                        self.state = 158
                        self.constraint(4)
                        pass

                    elif la_ == 3:
                        localctx = UVLParser.LogicalExpContext(self, UVLParser.ConstraintContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_constraint)
                        self.state = 159
                        if not self.precpred(self._ctx, 2):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 2)")
                        self.state = 160
                        self.logical_operator()
                        self.state = 161
                        self.constraint(3)
                        pass

             
                self.state = 167
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,20,self._ctx)

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

    class Logical_operatorContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return UVLParser.RULE_logical_operator

     
        def copyFrom(self, ctx:ParserRuleContext):
            super().copyFrom(ctx)



    class RequiresExpContext(Logical_operatorContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a UVLParser.Logical_operatorContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def REQUIRES(self):
            return self.getToken(UVLParser.REQUIRES, 0)

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

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


    class EquivExpContext(Logical_operatorContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a UVLParser.Logical_operatorContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def EQUIVALENCE(self):
            return self.getToken(UVLParser.EQUIVALENCE, 0)

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

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


    class ExcludesExpContext(Logical_operatorContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a UVLParser.Logical_operatorContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def EXCLUDES(self):
            return self.getToken(UVLParser.EXCLUDES, 0)

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

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


    class ImpliesExpContext(Logical_operatorContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a UVLParser.Logical_operatorContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def IMPLICATION(self):
            return self.getToken(UVLParser.IMPLICATION, 0)

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

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



    def logical_operator(self):

        localctx = UVLParser.Logical_operatorContext(self, self._ctx, self.state)
        self.enterRule(localctx, 28, self.RULE_logical_operator)
        try:
            self.state = 172
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [UVLParser.EQUIVALENCE]:
                localctx = UVLParser.EquivExpContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 168
                self.match(UVLParser.EQUIVALENCE)
                pass
            elif token in [UVLParser.IMPLICATION]:
                localctx = UVLParser.ImpliesExpContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 169
                self.match(UVLParser.IMPLICATION)
                pass
            elif token in [UVLParser.REQUIRES]:
                localctx = UVLParser.RequiresExpContext(self, localctx)
                self.enterOuterAlt(localctx, 3)
                self.state = 170
                self.match(UVLParser.REQUIRES)
                pass
            elif token in [UVLParser.EXCLUDES]:
                localctx = UVLParser.ExcludesExpContext(self, localctx)
                self.enterOuterAlt(localctx, 4)
                self.state = 171
                self.match(UVLParser.EXCLUDES)
                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 ImportsContext(ParserRuleContext):

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

        def INDENT(self):
            return self.getToken(UVLParser.INDENT, 0)

        def DEDENT(self):
            return self.getToken(UVLParser.DEDENT, 0)

        def imp(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(UVLParser.ImpContext)
            else:
                return self.getTypedRuleContext(UVLParser.ImpContext,i)


        def getRuleIndex(self):
            return UVLParser.RULE_imports

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

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




    def imports(self):

        localctx = UVLParser.ImportsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 30, self.RULE_imports)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 174
            self.match(UVLParser.T__11)
            self.state = 175
            self.match(UVLParser.INDENT)
            self.state = 179
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==UVLParser.WORD:
                self.state = 176
                self.imp()
                self.state = 181
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 182
            self.match(UVLParser.DEDENT)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class ImpContext(ParserRuleContext):

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

        def imp_spec(self):
            return self.getTypedRuleContext(UVLParser.Imp_specContext,0)


        def WORD(self):
            return self.getToken(UVLParser.WORD, 0)

        def NL(self):
            return self.getToken(UVLParser.NL, 0)

        def getRuleIndex(self):
            return UVLParser.RULE_imp

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

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




    def imp(self):

        localctx = UVLParser.ImpContext(self, self._ctx, self.state)
        self.enterRule(localctx, 32, self.RULE_imp)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 184
            self.imp_spec()
            self.state = 187
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==UVLParser.T__12:
                self.state = 185
                self.match(UVLParser.T__12)
                self.state = 186
                self.match(UVLParser.WORD)


            self.state = 190
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==UVLParser.NL:
                self.state = 189
                self.match(UVLParser.NL)


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

    class Imp_specContext(ParserRuleContext):

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

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

        def getRuleIndex(self):
            return UVLParser.RULE_imp_spec

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

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




    def imp_spec(self):

        localctx = UVLParser.Imp_specContext(self, self._ctx, self.state)
        self.enterRule(localctx, 34, self.RULE_imp_spec)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 192
            self.match(UVLParser.WORD)
            self.state = 197
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==UVLParser.T__2:
                self.state = 193
                self.match(UVLParser.T__2)
                self.state = 194
                self.match(UVLParser.WORD)
                self.state = 199
                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



    def sempred(self, localctx:RuleContext, ruleIndex:int, predIndex:int):
        if self._predicates == None:
            self._predicates = dict()
        self._predicates[13] = self.constraint_sempred
        pred = self._predicates.get(ruleIndex, None)
        if pred is None:
            raise Exception("No predicate with index:" + str(ruleIndex))
        else:
            return pred(localctx, predIndex)

    def constraint_sempred(self, localctx:ConstraintContext, predIndex:int):
            if predIndex == 0:
                return self.precpred(self._ctx, 4)
         

            if predIndex == 1:
                return self.precpred(self._ctx, 3)
         

            if predIndex == 2:
                return self.precpred(self._ctx, 2)
         




