<reponame>BentleyJOakes/rtamt<gh_stars>0
# Generated from StlParser.g4 by ANTLR 4.5.1
# encoding: utf-8
from __future__ import print_function
from antlr4 import *
from io import StringIO

def serializedATN():
    with StringIO() as buf:
        buf.write(u"\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\3")
        buf.write(u"H\u00f6\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t")
        buf.write(u"\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r")
        buf.write(u"\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22\4")
        buf.write(u"\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\3\2\3\2\3\2\3")
        buf.write(u"\3\5\3\61\n\3\3\3\7\3\64\n\3\f\3\16\3\67\13\3\3\3\3\3")
        buf.write(u"\7\3;\n\3\f\3\16\3>\13\3\3\3\3\3\3\4\3\4\3\4\3\5\3\5")
        buf.write(u"\3\5\3\5\3\5\3\6\3\6\3\6\3\6\3\7\3\7\3\b\3\b\3\b\3\t")
        buf.write(u"\3\t\3\t\3\t\3\t\3\t\3\t\3\n\5\n[\n\n\3\n\5\n^\n\n\3")
        buf.write(u"\n\3\n\3\n\5\nc\n\n\3\13\3\13\3\13\3\13\5\13i\n\13\3")
        buf.write(u"\f\3\f\3\r\3\r\3\16\3\16\3\16\3\16\3\16\3\16\3\17\3\17")
        buf.write(u"\5\17w\n\17\3\20\3\20\3\21\3\21\3\21\3\21\3\21\5\21\u0080")
        buf.write(u"\n\21\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3")
        buf.write(u"\22\3\22\3\22\3\22\5\22\u008f\n\22\3\22\3\22\3\22\5\22")
        buf.write(u"\u0094\n\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3")
        buf.write(u"\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\5\22\u00a6\n\22")
        buf.write(u"\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3")
        buf.write(u"\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22")
        buf.write(u"\3\22\3\22\3\22\3\22\3\22\3\22\5\22\u00c3\n\22\3\22\7")
        buf.write(u"\22\u00c6\n\22\f\22\16\22\u00c9\13\22\3\23\3\23\3\23")
        buf.write(u"\3\23\3\23\3\23\3\23\3\23\5\23\u00d3\n\23\3\23\3\23\3")
        buf.write(u"\23\3\23\3\23\3\23\3\23\3\23\3\23\3\23\3\23\3\23\7\23")
        buf.write(u"\u00e1\n\23\f\23\16\23\u00e4\13\23\3\24\3\24\3\24\3\24")
        buf.write(u"\3\24\3\24\5\24\u00ec\n\24\3\25\3\25\3\25\3\25\5\25\u00f2")
        buf.write(u"\n\25\3\26\3\26\3\26\2\4\"$\27\2\4\6\b\n\f\16\20\22\24")
        buf.write(u"\26\30\32\34\36 \"$&(*\2\5\4\2\37\"DD\3\2\32\33\3\2\23")
        buf.write(u"\27\u010b\2,\3\2\2\2\4\60\3\2\2\2\6A\3\2\2\2\bD\3\2\2")
        buf.write(u"\2\nI\3\2\2\2\fM\3\2\2\2\16O\3\2\2\2\20R\3\2\2\2\22Z")
        buf.write(u"\3\2\2\2\24h\3\2\2\2\26j\3\2\2\2\30l\3\2\2\2\32n\3\2")
        buf.write(u"\2\2\34t\3\2\2\2\36x\3\2\2\2 \177\3\2\2\2\"\u00a5\3\2")
        buf.write(u"\2\2$\u00d2\3\2\2\2&\u00eb\3\2\2\2(\u00f1\3\2\2\2*\u00f3")
        buf.write(u"\3\2\2\2,-\5\4\3\2-.\7\2\2\3.\3\3\2\2\2/\61\5\6\4\2\60")
        buf.write(u"/\3\2\2\2\60\61\3\2\2\2\61\65\3\2\2\2\62\64\5\b\5\2\63")
        buf.write(u"\62\3\2\2\2\64\67\3\2\2\2\65\63\3\2\2\2\65\66\3\2\2\2")
        buf.write(u"\66<\3\2\2\2\67\65\3\2\2\28;\5\f\7\29;\5\16\b\2:8\3\2")
        buf.write(u"\2\2:9\3\2\2\2;>\3\2\2\2<:\3\2\2\2<=\3\2\2\2=?\3\2\2")
        buf.write(u"\2><\3\2\2\2?@\5\n\6\2@\5\3\2\2\2AB\7%\2\2BC\7D\2\2C")
        buf.write(u"\7\3\2\2\2DE\7&\2\2EF\7D\2\2FG\7\31\2\2GH\7D\2\2H\t\3")
        buf.write(u"\2\2\2IJ\7D\2\2JK\7>\2\2KL\5 \21\2L\13\3\2\2\2MN\5\22")
        buf.write(u"\n\2N\r\3\2\2\2OP\7\21\2\2PQ\5\20\t\2Q\17\3\2\2\2RS\7")
        buf.write(u"\30\2\2ST\7\7\2\2TU\7D\2\2UV\7\17\2\2VW\7D\2\2WX\7\b")
        buf.write(u"\2\2X\21\3\2\2\2Y[\7\35\2\2ZY\3\2\2\2Z[\3\2\2\2[]\3\2")
        buf.write(u"\2\2\\^\5\30\r\2]\\\3\2\2\2]^\3\2\2\2^_\3\2\2\2_`\5\26")
        buf.write(u"\f\2`b\5*\26\2ac\5\24\13\2ba\3\2\2\2bc\3\2\2\2c\23\3")
        buf.write(u"\2\2\2de\7>\2\2ei\5(\25\2fg\7>\2\2gi\5\"\22\2hd\3\2\2")
        buf.write(u"\2hf\3\2\2\2i\25\3\2\2\2jk\t\2\2\2k\27\3\2\2\2lm\t\3")
        buf.write(u"\2\2m\31\3\2\2\2no\7\13\2\2op\5\34\17\2pq\7\16\2\2qr")
        buf.write(u"\5\34\17\2rs\7\f\2\2s\33\3\2\2\2tv\5(\25\2uw\5\36\20")
        buf.write(u"\2vu\3\2\2\2vw\3\2\2\2w\35\3\2\2\2xy\t\4\2\2y\37\3\2")
        buf.write(u"\2\2z{\7/\2\2{\u0080\5\"\22\2|}\7\60\2\2}\u0080\5\"\22")
        buf.write(u"\2~\u0080\5\"\22\2\177z\3\2\2\2\177|\3\2\2\2\177~\3\2")
        buf.write(u"\2\2\u0080!\3\2\2\2\u0081\u0082\b\22\1\2\u0082\u0083")
        buf.write(u"\7\'\2\2\u0083\u00a6\5\"\22\20\u0084\u0085\7/\2\2\u0085")
        buf.write(u"\u0086\5\32\16\2\u0086\u0087\5\"\22\n\u0087\u00a6\3\2")
        buf.write(u"\2\2\u0088\u0089\7\60\2\2\u0089\u008a\5\32\16\2\u008a")
        buf.write(u"\u008b\5\"\22\t\u008b\u00a6\3\2\2\2\u008c\u008e\7\62")
        buf.write(u"\2\2\u008d\u008f\5\32\16\2\u008e\u008d\3\2\2\2\u008e")
        buf.write(u"\u008f\3\2\2\2\u008f\u0090\3\2\2\2\u0090\u00a6\5\"\22")
        buf.write(u"\7\u0091\u0093\7\63\2\2\u0092\u0094\5\32\16\2\u0093\u0092")
        buf.write(u"\3\2\2\2\u0093\u0094\3\2\2\2\u0094\u0095\3\2\2\2\u0095")
        buf.write(u"\u00a6\5\"\22\6\u0096\u00a6\5$\23\2\u0097\u0098\7\7\2")
        buf.write(u"\2\u0098\u0099\5\"\22\2\u0099\u009a\7\b\2\2\u009a\u00a6")
        buf.write(u"\3\2\2\2\u009b\u009c\7-\2\2\u009c\u009d\7\7\2\2\u009d")
        buf.write(u"\u009e\5\"\22\2\u009e\u009f\7\b\2\2\u009f\u00a6\3\2\2")
        buf.write(u"\2\u00a0\u00a1\7.\2\2\u00a1\u00a2\7\7\2\2\u00a2\u00a3")
        buf.write(u"\5\"\22\2\u00a3\u00a4\7\b\2\2\u00a4\u00a6\3\2\2\2\u00a5")
        buf.write(u"\u0081\3\2\2\2\u00a5\u0084\3\2\2\2\u00a5\u0088\3\2\2")
        buf.write(u"\2\u00a5\u008c\3\2\2\2\u00a5\u0091\3\2\2\2\u00a5\u0096")
        buf.write(u"\3\2\2\2\u00a5\u0097\3\2\2\2\u00a5\u009b\3\2\2\2\u00a5")
        buf.write(u"\u00a0\3\2\2\2\u00a6\u00c7\3\2\2\2\u00a7\u00a8\f\22\2")
        buf.write(u"\2\u00a8\u00a9\5&\24\2\u00a9\u00aa\5\"\22\23\u00aa\u00c6")
        buf.write(u"\3\2\2\2\u00ab\u00ac\f\17\2\2\u00ac\u00ad\7(\2\2\u00ad")
        buf.write(u"\u00c6\5\"\22\20\u00ae\u00af\f\16\2\2\u00af\u00b0\7)")
        buf.write(u"\2\2\u00b0\u00c6\5\"\22\17\u00b1\u00b2\f\r\2\2\u00b2")
        buf.write(u"\u00b3\7+\2\2\u00b3\u00c6\5\"\22\16\u00b4\u00b5\f\f\2")
        buf.write(u"\2\u00b5\u00b6\7*\2\2\u00b6\u00c6\5\"\22\r\u00b7\u00b8")
        buf.write(u"\f\13\2\2\u00b8\u00b9\7,\2\2\u00b9\u00c6\5\"\22\f\u00ba")
        buf.write(u"\u00bb\f\b\2\2\u00bb\u00bc\7\61\2\2\u00bc\u00bd\5\32")
        buf.write(u"\16\2\u00bd\u00be\5\"\22\t\u00be\u00c6\3\2\2\2\u00bf")
        buf.write(u"\u00c0\f\5\2\2\u00c0\u00c2\7\64\2\2\u00c1\u00c3\5\32")
        buf.write(u"\16\2\u00c2\u00c1\3\2\2\2\u00c2\u00c3\3\2\2\2\u00c3\u00c4")
        buf.write(u"\3\2\2\2\u00c4\u00c6\5\"\22\6\u00c5\u00a7\3\2\2\2\u00c5")
        buf.write(u"\u00ab\3\2\2\2\u00c5\u00ae\3\2\2\2\u00c5\u00b1\3\2\2")
        buf.write(u"\2\u00c5\u00b4\3\2\2\2\u00c5\u00b7\3\2\2\2\u00c5\u00ba")
        buf.write(u"\3\2\2\2\u00c5\u00bf\3\2\2\2\u00c6\u00c9\3\2\2\2\u00c7")
        buf.write(u"\u00c5\3\2\2\2\u00c7\u00c8\3\2\2\2\u00c8#\3\2\2\2\u00c9")
        buf.write(u"\u00c7\3\2\2\2\u00ca\u00cb\b\23\1\2\u00cb\u00d3\7D\2")
        buf.write(u"\2\u00cc\u00d3\5(\25\2\u00cd\u00ce\7\22\2\2\u00ce\u00cf")
        buf.write(u"\7\7\2\2\u00cf\u00d0\5$\23\2\u00d0\u00d1\7\b\2\2\u00d1")
        buf.write(u"\u00d3\3\2\2\2\u00d2\u00ca\3\2\2\2\u00d2\u00cc\3\2\2")
        buf.write(u"\2\u00d2\u00cd\3\2\2\2\u00d3\u00e2\3\2\2\2\u00d4\u00d5")
        buf.write(u"\f\7\2\2\u00d5\u00d6\7\4\2\2\u00d6\u00e1\5$\23\b\u00d7")
        buf.write(u"\u00d8\f\6\2\2\u00d8\u00d9\7\3\2\2\u00d9\u00e1\5$\23")
        buf.write(u"\7\u00da\u00db\f\5\2\2\u00db\u00dc\7\5\2\2\u00dc\u00e1")
        buf.write(u"\5$\23\6\u00dd\u00de\f\4\2\2\u00de\u00df\7\6\2\2\u00df")
        buf.write(u"\u00e1\5$\23\5\u00e0\u00d4\3\2\2\2\u00e0\u00d7\3\2\2")
        buf.write(u"\2\u00e0\u00da\3\2\2\2\u00e0\u00dd\3\2\2\2\u00e1\u00e4")
        buf.write(u"\3\2\2\2\u00e2\u00e0\3\2\2\2\u00e2\u00e3\3\2\2\2\u00e3")
        buf.write(u"%\3\2\2\2\u00e4\u00e2\3\2\2\2\u00e5\u00ec\7;\2\2\u00e6")
        buf.write(u"\u00ec\7:\2\2\u00e7\u00ec\7=\2\2\u00e8\u00ec\7<\2\2\u00e9")
        buf.write(u"\u00ec\78\2\2\u00ea\u00ec\79\2\2\u00eb\u00e5\3\2\2\2")
        buf.write(u"\u00eb\u00e6\3\2\2\2\u00eb\u00e7\3\2\2\2\u00eb\u00e8")
        buf.write(u"\3\2\2\2\u00eb\u00e9\3\2\2\2\u00eb\u00ea\3\2\2\2\u00ec")
        buf.write(u"\'\3\2\2\2\u00ed\u00f2\7B\2\2\u00ee\u00f2\7C\2\2\u00ef")
        buf.write(u"\u00f0\7\3\2\2\u00f0\u00f2\5(\25\2\u00f1\u00ed\3\2\2")
        buf.write(u"\2\u00f1\u00ee\3\2\2\2\u00f1\u00ef\3\2\2\2\u00f2)\3\2")
        buf.write(u"\2\2\u00f3\u00f4\7D\2\2\u00f4+\3\2\2\2\27\60\65:<Z]b")
        buf.write(u"hv\177\u008e\u0093\u00a5\u00c2\u00c5\u00c7\u00d2\u00e0")
        buf.write(u"\u00e2\u00eb\u00f1")
        return buf.getvalue()


class StlParser ( Parser ):

    grammarFileName = "StlParser.g4"

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

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

    sharedContextCache = PredictionContextCache()

    literalNames = [ u"<INVALID>", u"'-'", u"'+'", u"'*'", u"'/'", u"'('", 
                     u"')'", u"'{'", u"'}'", u"'['", u"']'", u"';'", u"':'", 
                     u"','", u"'.'", u"'@'", u"'abs'", u"'s'", u"'ms'", 
                     u"'us'", u"'ns'", u"'ps'", u"'topic'", u"'import'", 
                     u"'input'", u"'output'", u"'internal'", u"'const'", 
                     u"'real'", u"'float'", u"'long'", u"'complex'", u"'int'", 
                     u"'bool'", u"'assertion'", u"'specification'", u"'from'", 
                     u"<INVALID>", u"<INVALID>", u"<INVALID>", u"<INVALID>", 
                     u"<INVALID>", u"'xor'", u"'rise'", u"'fall'", u"<INVALID>", 
                     u"<INVALID>", u"<INVALID>", u"<INVALID>", u"<INVALID>", 
                     u"<INVALID>", u"<INVALID>", u"'oracle'", u"<INVALID>", 
                     u"'=='", u"'!=='", u"'>='", u"'<='", u"'>'", u"'<'", 
                     u"'='" ]

    symbolicNames = [ u"<INVALID>", u"MINUS", u"PLUS", u"TIMES", u"DIVIDE", 
                      u"LPAREN", u"RPAREN", u"LBRACE", u"RBRACE", u"LBRACK", 
                      u"RBRACK", u"SEMICOLON", u"COLON", u"COMMA", u"DOT", 
                      u"AT", u"ABS", u"SEC", u"MSEC", u"USEC", u"NSEC", 
                      u"PSEC", u"ROS_Topic", u"Import", u"Input", u"Output", 
                      u"Internal", u"Constant", u"DomainTypeReal", u"DomainTypeFloat", 
                      u"DomainTypeLong", u"DomainTypeComplex", u"DomainTypeInt", 
                      u"DomainTypeBool", u"Assertion", u"Specification", 
                      u"From", u"NotOperator", u"OrOperator", u"AndOperator", 
                      u"IffOperator", u"ImpliesOperator", u"XorOperator", 
                      u"RiseOperator", u"FallOperator", u"AlwaysOperator", 
                      u"EventuallyOperator", u"UntilOperator", u"HistoricallyOperator", 
                      u"OnceOperator", u"SinceOperator", u"NextOperator", 
                      u"OracleOperator", u"PreviousOperator", u"EqualOperator", 
                      u"NotEqualOperator", u"GreaterOrEqualOperator", u"LesserOrEqualOperator", 
                      u"GreaterOperator", u"LesserOperator", u"EQUAL", u"BooleanLiteral", 
                      u"TRUE", u"FALSE", u"IntegerLiteral", u"RealLiteral", 
                      u"Identifier", u"LINE_TERMINATOR", u"WHITESPACE", 
                      u"COMMENT", u"LINE_COMMENT" ]

    RULE_stlfile = 0
    RULE_stlSpecification = 1
    RULE_spec = 2
    RULE_modimport = 3
    RULE_assertion = 4
    RULE_declaration = 5
    RULE_annotation = 6
    RULE_annotation_type = 7
    RULE_variableDeclaration = 8
    RULE_assignment = 9
    RULE_domainType = 10
    RULE_ioType = 11
    RULE_interval = 12
    RULE_intervalTime = 13
    RULE_unit = 14
    RULE_topExpression = 15
    RULE_expression = 16
    RULE_real_expression = 17
    RULE_comparisonOp = 18
    RULE_literal = 19
    RULE_identifier = 20

    ruleNames =  [ u"stlfile", u"stlSpecification", u"spec", u"modimport", 
                   u"assertion", u"declaration", u"annotation", u"annotation_type", 
                   u"variableDeclaration", u"assignment", u"domainType", 
                   u"ioType", u"interval", u"intervalTime", u"unit", u"topExpression", 
                   u"expression", u"real_expression", u"comparisonOp", u"literal", 
                   u"identifier" ]

    EOF = Token.EOF
    MINUS=1
    PLUS=2
    TIMES=3
    DIVIDE=4
    LPAREN=5
    RPAREN=6
    LBRACE=7
    RBRACE=8
    LBRACK=9
    RBRACK=10
    SEMICOLON=11
    COLON=12
    COMMA=13
    DOT=14
    AT=15
    ABS=16
    SEC=17
    MSEC=18
    USEC=19
    NSEC=20
    PSEC=21
    ROS_Topic=22
    Import=23
    Input=24
    Output=25
    Internal=26
    Constant=27
    DomainTypeReal=28
    DomainTypeFloat=29
    DomainTypeLong=30
    DomainTypeComplex=31
    DomainTypeInt=32
    DomainTypeBool=33
    Assertion=34
    Specification=35
    From=36
    NotOperator=37
    OrOperator=38
    AndOperator=39
    IffOperator=40
    ImpliesOperator=41
    XorOperator=42
    RiseOperator=43
    FallOperator=44
    AlwaysOperator=45
    EventuallyOperator=46
    UntilOperator=47
    HistoricallyOperator=48
    OnceOperator=49
    SinceOperator=50
    NextOperator=51
    OracleOperator=52
    PreviousOperator=53
    EqualOperator=54
    NotEqualOperator=55
    GreaterOrEqualOperator=56
    LesserOrEqualOperator=57
    GreaterOperator=58
    LesserOperator=59
    EQUAL=60
    BooleanLiteral=61
    TRUE=62
    FALSE=63
    IntegerLiteral=64
    RealLiteral=65
    Identifier=66
    LINE_TERMINATOR=67
    WHITESPACE=68
    COMMENT=69
    LINE_COMMENT=70

    def __init__(self, input):
        super(StlParser, self).__init__(input)
        self.checkVersion("4.5.1")
        self._interp = ParserATNSimulator(self, self.atn, self.decisionsToDFA, self.sharedContextCache)
        self._predicates = None



    class StlfileContext(ParserRuleContext):

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

        def stlSpecification(self):
            return self.getTypedRuleContext(StlParser.StlSpecificationContext,0)


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

        def getRuleIndex(self):
            return StlParser.RULE_stlfile

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




    def stlfile(self):

        localctx = StlParser.StlfileContext(self, self._ctx, self.state)
        self.enterRule(localctx, 0, self.RULE_stlfile)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 42
            self.stlSpecification()
            self.state = 43
            self.match(StlParser.EOF)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class StlSpecificationContext(ParserRuleContext):

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

        def assertion(self):
            return self.getTypedRuleContext(StlParser.AssertionContext,0)


        def spec(self):
            return self.getTypedRuleContext(StlParser.SpecContext,0)


        def modimport(self, i=None):
            if i is None:
                return self.getTypedRuleContexts(StlParser.ModimportContext)
            else:
                return self.getTypedRuleContext(StlParser.ModimportContext,i)


        def declaration(self, i=None):
            if i is None:
                return self.getTypedRuleContexts(StlParser.DeclarationContext)
            else:
                return self.getTypedRuleContext(StlParser.DeclarationContext,i)


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


        def getRuleIndex(self):
            return StlParser.RULE_stlSpecification

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




    def stlSpecification(self):

        localctx = StlParser.StlSpecificationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 2, self.RULE_stlSpecification)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 46
            _la = self._input.LA(1)
            if _la==StlParser.Specification:
                self.state = 45
                self.spec()


            self.state = 51
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==StlParser.From:
                self.state = 48
                self.modimport()
                self.state = 53
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 58
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,3,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 56
                    token = self._input.LA(1)
                    if token in [StlParser.Input, StlParser.Output, StlParser.Constant, StlParser.DomainTypeFloat, StlParser.DomainTypeLong, StlParser.DomainTypeComplex, StlParser.DomainTypeInt, StlParser.Identifier]:
                        self.state = 54
                        self.declaration()

                    elif token in [StlParser.AT]:
                        self.state = 55
                        self.annotation()

                    else:
                        raise NoViableAltException(self)
             
                self.state = 60
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,3,self._ctx)

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

    class SpecContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return StlParser.RULE_spec

     
        def copyFrom(self, ctx):
            super(StlParser.SpecContext, self).copyFrom(ctx)



    class SpecificationContext(SpecContext):

        def __init__(self, parser, ctx): # actually a StlParser.SpecContext)
            super(StlParser.SpecificationContext, self).__init__(parser)
            self.copyFrom(ctx)

        def Specification(self):
            return self.getToken(StlParser.Specification, 0)
        def Identifier(self):
            return self.getToken(StlParser.Identifier, 0)

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



    def spec(self):

        localctx = StlParser.SpecContext(self, self._ctx, self.state)
        self.enterRule(localctx, 4, self.RULE_spec)
        try:
            localctx = StlParser.SpecificationContext(self, localctx)
            self.enterOuterAlt(localctx, 1)
            self.state = 63
            self.match(StlParser.Specification)
            self.state = 64
            self.match(StlParser.Identifier)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class ModimportContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return StlParser.RULE_modimport

     
        def copyFrom(self, ctx):
            super(StlParser.ModimportContext, self).copyFrom(ctx)



    class ModImportContext(ModimportContext):

        def __init__(self, parser, ctx): # actually a StlParser.ModimportContext)
            super(StlParser.ModImportContext, self).__init__(parser)
            self.copyFrom(ctx)

        def From(self):
            return self.getToken(StlParser.From, 0)
        def Identifier(self, i=None):
            if i is None:
                return self.getTokens(StlParser.Identifier)
            else:
                return self.getToken(StlParser.Identifier, i)
        def Import(self):
            return self.getToken(StlParser.Import, 0)

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



    def modimport(self):

        localctx = StlParser.ModimportContext(self, self._ctx, self.state)
        self.enterRule(localctx, 6, self.RULE_modimport)
        try:
            localctx = StlParser.ModImportContext(self, localctx)
            self.enterOuterAlt(localctx, 1)
            self.state = 66
            self.match(StlParser.From)
            self.state = 67
            self.match(StlParser.Identifier)
            self.state = 68
            self.match(StlParser.Import)
            self.state = 69
            self.match(StlParser.Identifier)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class AssertionContext(ParserRuleContext):

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

        def Identifier(self):
            return self.getToken(StlParser.Identifier, 0)

        def EQUAL(self):
            return self.getToken(StlParser.EQUAL, 0)

        def topExpression(self):
            return self.getTypedRuleContext(StlParser.TopExpressionContext,0)


        def getRuleIndex(self):
            return StlParser.RULE_assertion

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




    def assertion(self):

        localctx = StlParser.AssertionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 8, self.RULE_assertion)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 71
            self.match(StlParser.Identifier)
            self.state = 72
            self.match(StlParser.EQUAL)
            self.state = 73
            self.topExpression()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class DeclarationContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return StlParser.RULE_declaration

     
        def copyFrom(self, ctx):
            super(StlParser.DeclarationContext, self).copyFrom(ctx)



    class DeclVariableContext(DeclarationContext):

        def __init__(self, parser, ctx): # actually a StlParser.DeclarationContext)
            super(StlParser.DeclVariableContext, self).__init__(parser)
            self.copyFrom(ctx)

        def variableDeclaration(self):
            return self.getTypedRuleContext(StlParser.VariableDeclarationContext,0)


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



    def declaration(self):

        localctx = StlParser.DeclarationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 10, self.RULE_declaration)
        try:
            localctx = StlParser.DeclVariableContext(self, localctx)
            self.enterOuterAlt(localctx, 1)
            self.state = 75
            self.variableDeclaration()
        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=None, invokingState=-1):
            super(StlParser.AnnotationContext, self).__init__(parent, invokingState)
            self.parser = parser

        def annotation_type(self):
            return self.getTypedRuleContext(StlParser.Annotation_typeContext,0)


        def getRuleIndex(self):
            return StlParser.RULE_annotation

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




    def annotation(self):

        localctx = StlParser.AnnotationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 12, self.RULE_annotation)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 77
            self.match(StlParser.AT)
            self.state = 78
            self.annotation_type()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class Annotation_typeContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return StlParser.RULE_annotation_type

     
        def copyFrom(self, ctx):
            super(StlParser.Annotation_typeContext, self).copyFrom(ctx)



    class RosTopicContext(Annotation_typeContext):

        def __init__(self, parser, ctx): # actually a StlParser.Annotation_typeContext)
            super(StlParser.RosTopicContext, self).__init__(parser)
            self.copyFrom(ctx)

        def ROS_Topic(self):
            return self.getToken(StlParser.ROS_Topic, 0)
        def LPAREN(self):
            return self.getToken(StlParser.LPAREN, 0)
        def Identifier(self, i=None):
            if i is None:
                return self.getTokens(StlParser.Identifier)
            else:
                return self.getToken(StlParser.Identifier, i)
        def COMMA(self):
            return self.getToken(StlParser.COMMA, 0)
        def RPAREN(self):
            return self.getToken(StlParser.RPAREN, 0)

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



    def annotation_type(self):

        localctx = StlParser.Annotation_typeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 14, self.RULE_annotation_type)
        try:
            localctx = StlParser.RosTopicContext(self, localctx)
            self.enterOuterAlt(localctx, 1)
            self.state = 80
            self.match(StlParser.ROS_Topic)
            self.state = 81
            self.match(StlParser.LPAREN)
            self.state = 82
            self.match(StlParser.Identifier)
            self.state = 83
            self.match(StlParser.COMMA)
            self.state = 84
            self.match(StlParser.Identifier)
            self.state = 85
            self.match(StlParser.RPAREN)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class VariableDeclarationContext(ParserRuleContext):

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

        def domainType(self):
            return self.getTypedRuleContext(StlParser.DomainTypeContext,0)


        def identifier(self):
            return self.getTypedRuleContext(StlParser.IdentifierContext,0)


        def Constant(self):
            return self.getToken(StlParser.Constant, 0)

        def ioType(self):
            return self.getTypedRuleContext(StlParser.IoTypeContext,0)


        def assignment(self):
            return self.getTypedRuleContext(StlParser.AssignmentContext,0)


        def getRuleIndex(self):
            return StlParser.RULE_variableDeclaration

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




    def variableDeclaration(self):

        localctx = StlParser.VariableDeclarationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 16, self.RULE_variableDeclaration)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 88
            _la = self._input.LA(1)
            if _la==StlParser.Constant:
                self.state = 87
                self.match(StlParser.Constant)


            self.state = 91
            _la = self._input.LA(1)
            if _la==StlParser.Input or _la==StlParser.Output:
                self.state = 90
                self.ioType()


            self.state = 93
            self.domainType()
            self.state = 94
            self.identifier()
            self.state = 96
            _la = self._input.LA(1)
            if _la==StlParser.EQUAL:
                self.state = 95
                self.assignment()


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

    class AssignmentContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return StlParser.RULE_assignment

     
        def copyFrom(self, ctx):
            super(StlParser.AssignmentContext, self).copyFrom(ctx)



    class AsgnExprContext(AssignmentContext):

        def __init__(self, parser, ctx): # actually a StlParser.AssignmentContext)
            super(StlParser.AsgnExprContext, self).__init__(parser)
            self.copyFrom(ctx)

        def EQUAL(self):
            return self.getToken(StlParser.EQUAL, 0)
        def expression(self):
            return self.getTypedRuleContext(StlParser.ExpressionContext,0)


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


    class AsgnLiteralContext(AssignmentContext):

        def __init__(self, parser, ctx): # actually a StlParser.AssignmentContext)
            super(StlParser.AsgnLiteralContext, self).__init__(parser)
            self.copyFrom(ctx)

        def EQUAL(self):
            return self.getToken(StlParser.EQUAL, 0)
        def literal(self):
            return self.getTypedRuleContext(StlParser.LiteralContext,0)


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



    def assignment(self):

        localctx = StlParser.AssignmentContext(self, self._ctx, self.state)
        self.enterRule(localctx, 18, self.RULE_assignment)
        try:
            self.state = 102
            la_ = self._interp.adaptivePredict(self._input,7,self._ctx)
            if la_ == 1:
                localctx = StlParser.AsgnLiteralContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 98
                self.match(StlParser.EQUAL)
                self.state = 99
                self.literal()
                pass

            elif la_ == 2:
                localctx = StlParser.AsgnExprContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 100
                self.match(StlParser.EQUAL)
                self.state = 101
                self.expression(0)
                pass


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

    class DomainTypeContext(ParserRuleContext):

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

        def DomainTypeFloat(self):
            return self.getToken(StlParser.DomainTypeFloat, 0)

        def DomainTypeInt(self):
            return self.getToken(StlParser.DomainTypeInt, 0)

        def DomainTypeLong(self):
            return self.getToken(StlParser.DomainTypeLong, 0)

        def DomainTypeComplex(self):
            return self.getToken(StlParser.DomainTypeComplex, 0)

        def Identifier(self):
            return self.getToken(StlParser.Identifier, 0)

        def getRuleIndex(self):
            return StlParser.RULE_domainType

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




    def domainType(self):

        localctx = StlParser.DomainTypeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 20, self.RULE_domainType)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 104
            _la = self._input.LA(1)
            if not(((((_la - 29)) & ~0x3f) == 0 and ((1 << (_la - 29)) & ((1 << (StlParser.DomainTypeFloat - 29)) | (1 << (StlParser.DomainTypeLong - 29)) | (1 << (StlParser.DomainTypeComplex - 29)) | (1 << (StlParser.DomainTypeInt - 29)) | (1 << (StlParser.Identifier - 29)))) != 0)):
                self._errHandler.recoverInline(self)
            else:
                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 IoTypeContext(ParserRuleContext):

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

        def Input(self):
            return self.getToken(StlParser.Input, 0)

        def Output(self):
            return self.getToken(StlParser.Output, 0)

        def getRuleIndex(self):
            return StlParser.RULE_ioType

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




    def ioType(self):

        localctx = StlParser.IoTypeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 22, self.RULE_ioType)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 106
            _la = self._input.LA(1)
            if not(_la==StlParser.Input or _la==StlParser.Output):
                self._errHandler.recoverInline(self)
            else:
                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 IntervalContext(ParserRuleContext):

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

        def LBRACK(self):
            return self.getToken(StlParser.LBRACK, 0)

        def intervalTime(self, i=None):
            if i is None:
                return self.getTypedRuleContexts(StlParser.IntervalTimeContext)
            else:
                return self.getTypedRuleContext(StlParser.IntervalTimeContext,i)


        def COLON(self):
            return self.getToken(StlParser.COLON, 0)

        def RBRACK(self):
            return self.getToken(StlParser.RBRACK, 0)

        def getRuleIndex(self):
            return StlParser.RULE_interval

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




    def interval(self):

        localctx = StlParser.IntervalContext(self, self._ctx, self.state)
        self.enterRule(localctx, 24, self.RULE_interval)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 108
            self.match(StlParser.LBRACK)
            self.state = 109
            self.intervalTime()
            self.state = 110
            self.match(StlParser.COLON)
            self.state = 111
            self.intervalTime()
            self.state = 112
            self.match(StlParser.RBRACK)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class IntervalTimeContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return StlParser.RULE_intervalTime

     
        def copyFrom(self, ctx):
            super(StlParser.IntervalTimeContext, self).copyFrom(ctx)



    class IntervalTimeLiteralContext(IntervalTimeContext):

        def __init__(self, parser, ctx): # actually a StlParser.IntervalTimeContext)
            super(StlParser.IntervalTimeLiteralContext, self).__init__(parser)
            self.copyFrom(ctx)

        def literal(self):
            return self.getTypedRuleContext(StlParser.LiteralContext,0)

        def unit(self):
            return self.getTypedRuleContext(StlParser.UnitContext,0)


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



    def intervalTime(self):

        localctx = StlParser.IntervalTimeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 26, self.RULE_intervalTime)
        self._la = 0 # Token type
        try:
            localctx = StlParser.IntervalTimeLiteralContext(self, localctx)
            self.enterOuterAlt(localctx, 1)
            self.state = 114
            self.literal()
            self.state = 116
            _la = self._input.LA(1)
            if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << StlParser.SEC) | (1 << StlParser.MSEC) | (1 << StlParser.USEC) | (1 << StlParser.NSEC) | (1 << StlParser.PSEC))) != 0):
                self.state = 115
                self.unit()


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

    class UnitContext(ParserRuleContext):

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

        def SEC(self):
            return self.getToken(StlParser.SEC, 0)

        def MSEC(self):
            return self.getToken(StlParser.MSEC, 0)

        def USEC(self):
            return self.getToken(StlParser.USEC, 0)

        def NSEC(self):
            return self.getToken(StlParser.NSEC, 0)

        def PSEC(self):
            return self.getToken(StlParser.PSEC, 0)

        def getRuleIndex(self):
            return StlParser.RULE_unit

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




    def unit(self):

        localctx = StlParser.UnitContext(self, self._ctx, self.state)
        self.enterRule(localctx, 28, self.RULE_unit)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 118
            _la = self._input.LA(1)
            if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << StlParser.SEC) | (1 << StlParser.MSEC) | (1 << StlParser.USEC) | (1 << StlParser.NSEC) | (1 << StlParser.PSEC))) != 0)):
                self._errHandler.recoverInline(self)
            else:
                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 TopExpressionContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return StlParser.RULE_topExpression

     
        def copyFrom(self, ctx):
            super(StlParser.TopExpressionContext, self).copyFrom(ctx)



    class ExprContext(TopExpressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.TopExpressionContext)
            super(StlParser.ExprContext, self).__init__(parser)
            self.copyFrom(ctx)

        def expression(self):
            return self.getTypedRuleContext(StlParser.ExpressionContext,0)


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


    class ExprUntimedEvExprContext(TopExpressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.TopExpressionContext)
            super(StlParser.ExprUntimedEvExprContext, self).__init__(parser)
            self.copyFrom(ctx)

        def EventuallyOperator(self):
            return self.getToken(StlParser.EventuallyOperator, 0)
        def expression(self):
            return self.getTypedRuleContext(StlParser.ExpressionContext,0)


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


    class ExprUntimedAlwaysExprContext(TopExpressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.TopExpressionContext)
            super(StlParser.ExprUntimedAlwaysExprContext, self).__init__(parser)
            self.copyFrom(ctx)

        def AlwaysOperator(self):
            return self.getToken(StlParser.AlwaysOperator, 0)
        def expression(self):
            return self.getTypedRuleContext(StlParser.ExpressionContext,0)


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



    def topExpression(self):

        localctx = StlParser.TopExpressionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 30, self.RULE_topExpression)
        try:
            self.state = 125
            la_ = self._interp.adaptivePredict(self._input,9,self._ctx)
            if la_ == 1:
                localctx = StlParser.ExprUntimedAlwaysExprContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 120
                self.match(StlParser.AlwaysOperator)
                self.state = 121
                self.expression(0)
                pass

            elif la_ == 2:
                localctx = StlParser.ExprUntimedEvExprContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 122
                self.match(StlParser.EventuallyOperator)
                self.state = 123
                self.expression(0)
                pass

            elif la_ == 3:
                localctx = StlParser.ExprContext(self, localctx)
                self.enterOuterAlt(localctx, 3)
                self.state = 124
                self.expression(0)
                pass


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

    class ExpressionContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return StlParser.RULE_expression

     
        def copyFrom(self, ctx):
            super(StlParser.ExpressionContext, self).copyFrom(ctx)


    class ExprParenContext(ExpressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.ExpressionContext)
            super(StlParser.ExprParenContext, self).__init__(parser)
            self.copyFrom(ctx)

        def LPAREN(self):
            return self.getToken(StlParser.LPAREN, 0)
        def expression(self):
            return self.getTypedRuleContext(StlParser.ExpressionContext,0)

        def RPAREN(self):
            return self.getToken(StlParser.RPAREN, 0)

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


    class ExprAndExprContext(ExpressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.ExpressionContext)
            super(StlParser.ExprAndExprContext, self).__init__(parser)
            self.copyFrom(ctx)

        def expression(self, i=None):
            if i is None:
                return self.getTypedRuleContexts(StlParser.ExpressionContext)
            else:
                return self.getTypedRuleContext(StlParser.ExpressionContext,i)

        def AndOperator(self):
            return self.getToken(StlParser.AndOperator, 0)

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


    class ExpreOnceExprContext(ExpressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.ExpressionContext)
            super(StlParser.ExpreOnceExprContext, self).__init__(parser)
            self.copyFrom(ctx)

        def OnceOperator(self):
            return self.getToken(StlParser.OnceOperator, 0)
        def expression(self):
            return self.getTypedRuleContext(StlParser.ExpressionContext,0)

        def interval(self):
            return self.getTypedRuleContext(StlParser.IntervalContext,0)


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


    class ExprAlwaysExprContext(ExpressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.ExpressionContext)
            super(StlParser.ExprAlwaysExprContext, self).__init__(parser)
            self.copyFrom(ctx)

        def AlwaysOperator(self):
            return self.getToken(StlParser.AlwaysOperator, 0)
        def interval(self):
            return self.getTypedRuleContext(StlParser.IntervalContext,0)

        def expression(self):
            return self.getTypedRuleContext(StlParser.ExpressionContext,0)


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


    class ExprImpliesExprContext(ExpressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.ExpressionContext)
            super(StlParser.ExprImpliesExprContext, self).__init__(parser)
            self.copyFrom(ctx)

        def expression(self, i=None):
            if i is None:
                return self.getTypedRuleContexts(StlParser.ExpressionContext)
            else:
                return self.getTypedRuleContext(StlParser.ExpressionContext,i)

        def ImpliesOperator(self):
            return self.getToken(StlParser.ImpliesOperator, 0)

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


    class ExprXorExprContext(ExpressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.ExpressionContext)
            super(StlParser.ExprXorExprContext, self).__init__(parser)
            self.copyFrom(ctx)

        def expression(self, i=None):
            if i is None:
                return self.getTypedRuleContexts(StlParser.ExpressionContext)
            else:
                return self.getTypedRuleContext(StlParser.ExpressionContext,i)

        def XorOperator(self):
            return self.getToken(StlParser.XorOperator, 0)

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


    class ExprSinceExprContext(ExpressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.ExpressionContext)
            super(StlParser.ExprSinceExprContext, self).__init__(parser)
            self.copyFrom(ctx)

        def expression(self, i=None):
            if i is None:
                return self.getTypedRuleContexts(StlParser.ExpressionContext)
            else:
                return self.getTypedRuleContext(StlParser.ExpressionContext,i)

        def SinceOperator(self):
            return self.getToken(StlParser.SinceOperator, 0)
        def interval(self):
            return self.getTypedRuleContext(StlParser.IntervalContext,0)


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


    class ExprNotContext(ExpressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.ExpressionContext)
            super(StlParser.ExprNotContext, self).__init__(parser)
            self.copyFrom(ctx)

        def NotOperator(self):
            return self.getToken(StlParser.NotOperator, 0)
        def expression(self):
            return self.getTypedRuleContext(StlParser.ExpressionContext,0)


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


    class ExprOrExprContext(ExpressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.ExpressionContext)
            super(StlParser.ExprOrExprContext, self).__init__(parser)
            self.copyFrom(ctx)

        def expression(self, i=None):
            if i is None:
                return self.getTypedRuleContexts(StlParser.ExpressionContext)
            else:
                return self.getTypedRuleContext(StlParser.ExpressionContext,i)

        def OrOperator(self):
            return self.getToken(StlParser.OrOperator, 0)

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


    class ExprIffExprContext(ExpressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.ExpressionContext)
            super(StlParser.ExprIffExprContext, self).__init__(parser)
            self.copyFrom(ctx)

        def expression(self, i=None):
            if i is None:
                return self.getTypedRuleContexts(StlParser.ExpressionContext)
            else:
                return self.getTypedRuleContext(StlParser.ExpressionContext,i)

        def IffOperator(self):
            return self.getToken(StlParser.IffOperator, 0)

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


    class ExprFallContext(ExpressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.ExpressionContext)
            super(StlParser.ExprFallContext, self).__init__(parser)
            self.copyFrom(ctx)

        def FallOperator(self):
            return self.getToken(StlParser.FallOperator, 0)
        def LPAREN(self):
            return self.getToken(StlParser.LPAREN, 0)
        def expression(self):
            return self.getTypedRuleContext(StlParser.ExpressionContext,0)

        def RPAREN(self):
            return self.getToken(StlParser.RPAREN, 0)

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


    class ExprRiseContext(ExpressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.ExpressionContext)
            super(StlParser.ExprRiseContext, self).__init__(parser)
            self.copyFrom(ctx)

        def RiseOperator(self):
            return self.getToken(StlParser.RiseOperator, 0)
        def LPAREN(self):
            return self.getToken(StlParser.LPAREN, 0)
        def expression(self):
            return self.getTypedRuleContext(StlParser.ExpressionContext,0)

        def RPAREN(self):
            return self.getToken(StlParser.RPAREN, 0)

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


    class ExprHistExprContext(ExpressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.ExpressionContext)
            super(StlParser.ExprHistExprContext, self).__init__(parser)
            self.copyFrom(ctx)

        def HistoricallyOperator(self):
            return self.getToken(StlParser.HistoricallyOperator, 0)
        def expression(self):
            return self.getTypedRuleContext(StlParser.ExpressionContext,0)

        def interval(self):
            return self.getTypedRuleContext(StlParser.IntervalContext,0)


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


    class ExprRealContext(ExpressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.ExpressionContext)
            super(StlParser.ExprRealContext, self).__init__(parser)
            self.copyFrom(ctx)

        def real_expression(self):
            return self.getTypedRuleContext(StlParser.Real_expressionContext,0)


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


    class ExprUntilExprContext(ExpressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.ExpressionContext)
            super(StlParser.ExprUntilExprContext, self).__init__(parser)
            self.copyFrom(ctx)

        def expression(self, i=None):
            if i is None:
                return self.getTypedRuleContexts(StlParser.ExpressionContext)
            else:
                return self.getTypedRuleContext(StlParser.ExpressionContext,i)

        def UntilOperator(self):
            return self.getToken(StlParser.UntilOperator, 0)
        def interval(self):
            return self.getTypedRuleContext(StlParser.IntervalContext,0)


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


    class ExprEvExprContext(ExpressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.ExpressionContext)
            super(StlParser.ExprEvExprContext, self).__init__(parser)
            self.copyFrom(ctx)

        def EventuallyOperator(self):
            return self.getToken(StlParser.EventuallyOperator, 0)
        def interval(self):
            return self.getTypedRuleContext(StlParser.IntervalContext,0)

        def expression(self):
            return self.getTypedRuleContext(StlParser.ExpressionContext,0)


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


    class IdCompIntContext(ExpressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.ExpressionContext)
            super(StlParser.IdCompIntContext, self).__init__(parser)
            self.copyFrom(ctx)

        def expression(self, i=None):
            if i is None:
                return self.getTypedRuleContexts(StlParser.ExpressionContext)
            else:
                return self.getTypedRuleContext(StlParser.ExpressionContext,i)

        def comparisonOp(self):
            return self.getTypedRuleContext(StlParser.ComparisonOpContext,0)


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



    def expression(self, _p=0):
        _parentctx = self._ctx
        _parentState = self.state
        localctx = StlParser.ExpressionContext(self, self._ctx, _parentState)
        _prevctx = localctx
        _startState = 32
        self.enterRecursionRule(localctx, 32, self.RULE_expression, _p)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 163
            token = self._input.LA(1)
            if token in [StlParser.NotOperator]:
                localctx = StlParser.ExprNotContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx

                self.state = 128
                self.match(StlParser.NotOperator)
                self.state = 129
                self.expression(14)

            elif token in [StlParser.AlwaysOperator]:
                localctx = StlParser.ExprAlwaysExprContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 130
                self.match(StlParser.AlwaysOperator)
                self.state = 131
                self.interval()
                self.state = 132
                self.expression(8)

            elif token in [StlParser.EventuallyOperator]:
                localctx = StlParser.ExprEvExprContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 134
                self.match(StlParser.EventuallyOperator)
                self.state = 135
                self.interval()
                self.state = 136
                self.expression(7)

            elif token in [StlParser.HistoricallyOperator]:
                localctx = StlParser.ExprHistExprContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 138
                self.match(StlParser.HistoricallyOperator)
                self.state = 140
                _la = self._input.LA(1)
                if _la==StlParser.LBRACK:
                    self.state = 139
                    self.interval()


                self.state = 142
                self.expression(5)

            elif token in [StlParser.OnceOperator]:
                localctx = StlParser.ExpreOnceExprContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 143
                self.match(StlParser.OnceOperator)
                self.state = 145
                _la = self._input.LA(1)
                if _la==StlParser.LBRACK:
                    self.state = 144
                    self.interval()


                self.state = 147
                self.expression(4)

            elif token in [StlParser.MINUS, StlParser.ABS, StlParser.IntegerLiteral, StlParser.RealLiteral, StlParser.Identifier]:
                localctx = StlParser.ExprRealContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 148
                self.real_expression(0)

            elif token in [StlParser.LPAREN]:
                localctx = StlParser.ExprParenContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 149
                self.match(StlParser.LPAREN)
                self.state = 150
                self.expression(0)
                self.state = 151
                self.match(StlParser.RPAREN)

            elif token in [StlParser.RiseOperator]:
                localctx = StlParser.ExprRiseContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 153
                self.match(StlParser.RiseOperator)
                self.state = 154
                self.match(StlParser.LPAREN)
                self.state = 155
                self.expression(0)
                self.state = 156
                self.match(StlParser.RPAREN)

            elif token in [StlParser.FallOperator]:
                localctx = StlParser.ExprFallContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 158
                self.match(StlParser.FallOperator)
                self.state = 159
                self.match(StlParser.LPAREN)
                self.state = 160
                self.expression(0)
                self.state = 161
                self.match(StlParser.RPAREN)

            else:
                raise NoViableAltException(self)

            self._ctx.stop = self._input.LT(-1)
            self.state = 197
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,15,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 = 195
                    la_ = self._interp.adaptivePredict(self._input,14,self._ctx)
                    if la_ == 1:
                        localctx = StlParser.IdCompIntContext(self, StlParser.ExpressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
                        self.state = 165
                        if not self.precpred(self._ctx, 16):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 16)")
                        self.state = 166
                        self.comparisonOp()
                        self.state = 167
                        self.expression(17)
                        pass

                    elif la_ == 2:
                        localctx = StlParser.ExprOrExprContext(self, StlParser.ExpressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
                        self.state = 169
                        if not self.precpred(self._ctx, 13):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 13)")
                        self.state = 170
                        self.match(StlParser.OrOperator)
                        self.state = 171
                        self.expression(14)
                        pass

                    elif la_ == 3:
                        localctx = StlParser.ExprAndExprContext(self, StlParser.ExpressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
                        self.state = 172
                        if not self.precpred(self._ctx, 12):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 12)")
                        self.state = 173
                        self.match(StlParser.AndOperator)
                        self.state = 174
                        self.expression(13)
                        pass

                    elif la_ == 4:
                        localctx = StlParser.ExprImpliesExprContext(self, StlParser.ExpressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
                        self.state = 175
                        if not self.precpred(self._ctx, 11):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 11)")
                        self.state = 176
                        self.match(StlParser.ImpliesOperator)
                        self.state = 177
                        self.expression(12)
                        pass

                    elif la_ == 5:
                        localctx = StlParser.ExprIffExprContext(self, StlParser.ExpressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
                        self.state = 178
                        if not self.precpred(self._ctx, 10):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 10)")
                        self.state = 179
                        self.match(StlParser.IffOperator)
                        self.state = 180
                        self.expression(11)
                        pass

                    elif la_ == 6:
                        localctx = StlParser.ExprXorExprContext(self, StlParser.ExpressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
                        self.state = 181
                        if not self.precpred(self._ctx, 9):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 9)")
                        self.state = 182
                        self.match(StlParser.XorOperator)
                        self.state = 183
                        self.expression(10)
                        pass

                    elif la_ == 7:
                        localctx = StlParser.ExprUntilExprContext(self, StlParser.ExpressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
                        self.state = 184
                        if not self.precpred(self._ctx, 6):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 6)")
                        self.state = 185
                        self.match(StlParser.UntilOperator)
                        self.state = 186
                        self.interval()
                        self.state = 187
                        self.expression(7)
                        pass

                    elif la_ == 8:
                        localctx = StlParser.ExprSinceExprContext(self, StlParser.ExpressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
                        self.state = 189
                        if not self.precpred(self._ctx, 3):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 3)")
                        self.state = 190
                        self.match(StlParser.SinceOperator)
                        self.state = 192
                        _la = self._input.LA(1)
                        if _la==StlParser.LBRACK:
                            self.state = 191
                            self.interval()


                        self.state = 194
                        self.expression(4)
                        pass

             
                self.state = 199
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,15,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 Real_expressionContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return StlParser.RULE_real_expression

     
        def copyFrom(self, ctx):
            super(StlParser.Real_expressionContext, self).copyFrom(ctx)


    class ExprSubtractionContext(Real_expressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.Real_expressionContext)
            super(StlParser.ExprSubtractionContext, self).__init__(parser)
            self.copyFrom(ctx)

        def real_expression(self, i=None):
            if i is None:
                return self.getTypedRuleContexts(StlParser.Real_expressionContext)
            else:
                return self.getTypedRuleContext(StlParser.Real_expressionContext,i)

        def MINUS(self):
            return self.getToken(StlParser.MINUS, 0)

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


    class ExprDivisionContext(Real_expressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.Real_expressionContext)
            super(StlParser.ExprDivisionContext, self).__init__(parser)
            self.copyFrom(ctx)

        def real_expression(self, i=None):
            if i is None:
                return self.getTypedRuleContexts(StlParser.Real_expressionContext)
            else:
                return self.getTypedRuleContext(StlParser.Real_expressionContext,i)

        def DIVIDE(self):
            return self.getToken(StlParser.DIVIDE, 0)

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


    class ExprMultiplicationContext(Real_expressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.Real_expressionContext)
            super(StlParser.ExprMultiplicationContext, self).__init__(parser)
            self.copyFrom(ctx)

        def real_expression(self, i=None):
            if i is None:
                return self.getTypedRuleContexts(StlParser.Real_expressionContext)
            else:
                return self.getTypedRuleContext(StlParser.Real_expressionContext,i)

        def TIMES(self):
            return self.getToken(StlParser.TIMES, 0)

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


    class ExprLiteralContext(Real_expressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.Real_expressionContext)
            super(StlParser.ExprLiteralContext, self).__init__(parser)
            self.copyFrom(ctx)

        def literal(self):
            return self.getTypedRuleContext(StlParser.LiteralContext,0)


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


    class ExprIdContext(Real_expressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.Real_expressionContext)
            super(StlParser.ExprIdContext, self).__init__(parser)
            self.copyFrom(ctx)

        def Identifier(self):
            return self.getToken(StlParser.Identifier, 0)

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


    class ExprAbsContext(Real_expressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.Real_expressionContext)
            super(StlParser.ExprAbsContext, self).__init__(parser)
            self.copyFrom(ctx)

        def ABS(self):
            return self.getToken(StlParser.ABS, 0)
        def LPAREN(self):
            return self.getToken(StlParser.LPAREN, 0)
        def real_expression(self):
            return self.getTypedRuleContext(StlParser.Real_expressionContext,0)

        def RPAREN(self):
            return self.getToken(StlParser.RPAREN, 0)

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


    class ExprAdditionContext(Real_expressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.Real_expressionContext)
            super(StlParser.ExprAdditionContext, self).__init__(parser)
            self.copyFrom(ctx)

        def real_expression(self, i=None):
            if i is None:
                return self.getTypedRuleContexts(StlParser.Real_expressionContext)
            else:
                return self.getTypedRuleContext(StlParser.Real_expressionContext,i)

        def PLUS(self):
            return self.getToken(StlParser.PLUS, 0)

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



    def real_expression(self, _p=0):
        _parentctx = self._ctx
        _parentState = self.state
        localctx = StlParser.Real_expressionContext(self, self._ctx, _parentState)
        _prevctx = localctx
        _startState = 34
        self.enterRecursionRule(localctx, 34, self.RULE_real_expression, _p)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 208
            token = self._input.LA(1)
            if token in [StlParser.Identifier]:
                localctx = StlParser.ExprIdContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx

                self.state = 201
                self.match(StlParser.Identifier)

            elif token in [StlParser.MINUS, StlParser.IntegerLiteral, StlParser.RealLiteral]:
                localctx = StlParser.ExprLiteralContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 202
                self.literal()

            elif token in [StlParser.ABS]:
                localctx = StlParser.ExprAbsContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 203
                self.match(StlParser.ABS)
                self.state = 204
                self.match(StlParser.LPAREN)
                self.state = 205
                self.real_expression(0)
                self.state = 206
                self.match(StlParser.RPAREN)

            else:
                raise NoViableAltException(self)

            self._ctx.stop = self._input.LT(-1)
            self.state = 224
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,18,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 = 222
                    la_ = self._interp.adaptivePredict(self._input,17,self._ctx)
                    if la_ == 1:
                        localctx = StlParser.ExprAdditionContext(self, StlParser.Real_expressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_real_expression)
                        self.state = 210
                        if not self.precpred(self._ctx, 5):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 5)")
                        self.state = 211
                        self.match(StlParser.PLUS)
                        self.state = 212
                        self.real_expression(6)
                        pass

                    elif la_ == 2:
                        localctx = StlParser.ExprSubtractionContext(self, StlParser.Real_expressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_real_expression)
                        self.state = 213
                        if not self.precpred(self._ctx, 4):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 4)")
                        self.state = 214
                        self.match(StlParser.MINUS)
                        self.state = 215
                        self.real_expression(5)
                        pass

                    elif la_ == 3:
                        localctx = StlParser.ExprMultiplicationContext(self, StlParser.Real_expressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_real_expression)
                        self.state = 216
                        if not self.precpred(self._ctx, 3):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 3)")
                        self.state = 217
                        self.match(StlParser.TIMES)
                        self.state = 218
                        self.real_expression(4)
                        pass

                    elif la_ == 4:
                        localctx = StlParser.ExprDivisionContext(self, StlParser.Real_expressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_real_expression)
                        self.state = 219
                        if not self.precpred(self._ctx, 2):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 2)")
                        self.state = 220
                        self.match(StlParser.DIVIDE)
                        self.state = 221
                        self.real_expression(3)
                        pass

             
                self.state = 226
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,18,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 ComparisonOpContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return StlParser.RULE_comparisonOp

     
        def copyFrom(self, ctx):
            super(StlParser.ComparisonOpContext, self).copyFrom(ctx)



    class CmpOpEqContext(ComparisonOpContext):

        def __init__(self, parser, ctx): # actually a StlParser.ComparisonOpContext)
            super(StlParser.CmpOpEqContext, self).__init__(parser)
            self.copyFrom(ctx)

        def EqualOperator(self):
            return self.getToken(StlParser.EqualOperator, 0)

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


    class CmpOpGteContext(ComparisonOpContext):

        def __init__(self, parser, ctx): # actually a StlParser.ComparisonOpContext)
            super(StlParser.CmpOpGteContext, self).__init__(parser)
            self.copyFrom(ctx)

        def GreaterOrEqualOperator(self):
            return self.getToken(StlParser.GreaterOrEqualOperator, 0)

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


    class CmpOpLseContext(ComparisonOpContext):

        def __init__(self, parser, ctx): # actually a StlParser.ComparisonOpContext)
            super(StlParser.CmpOpLseContext, self).__init__(parser)
            self.copyFrom(ctx)

        def LesserOperator(self):
            return self.getToken(StlParser.LesserOperator, 0)

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


    class CmpOpGtContext(ComparisonOpContext):

        def __init__(self, parser, ctx): # actually a StlParser.ComparisonOpContext)
            super(StlParser.CmpOpGtContext, self).__init__(parser)
            self.copyFrom(ctx)

        def GreaterOperator(self):
            return self.getToken(StlParser.GreaterOperator, 0)

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


    class ComOpNeqContext(ComparisonOpContext):

        def __init__(self, parser, ctx): # actually a StlParser.ComparisonOpContext)
            super(StlParser.ComOpNeqContext, self).__init__(parser)
            self.copyFrom(ctx)

        def NotEqualOperator(self):
            return self.getToken(StlParser.NotEqualOperator, 0)

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


    class CmpOpLsContext(ComparisonOpContext):

        def __init__(self, parser, ctx): # actually a StlParser.ComparisonOpContext)
            super(StlParser.CmpOpLsContext, self).__init__(parser)
            self.copyFrom(ctx)

        def LesserOrEqualOperator(self):
            return self.getToken(StlParser.LesserOrEqualOperator, 0)

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



    def comparisonOp(self):

        localctx = StlParser.ComparisonOpContext(self, self._ctx, self.state)
        self.enterRule(localctx, 36, self.RULE_comparisonOp)
        try:
            self.state = 233
            token = self._input.LA(1)
            if token in [StlParser.LesserOrEqualOperator]:
                localctx = StlParser.CmpOpLsContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 227
                self.match(StlParser.LesserOrEqualOperator)

            elif token in [StlParser.GreaterOrEqualOperator]:
                localctx = StlParser.CmpOpGteContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 228
                self.match(StlParser.GreaterOrEqualOperator)

            elif token in [StlParser.LesserOperator]:
                localctx = StlParser.CmpOpLseContext(self, localctx)
                self.enterOuterAlt(localctx, 3)
                self.state = 229
                self.match(StlParser.LesserOperator)

            elif token in [StlParser.GreaterOperator]:
                localctx = StlParser.CmpOpGtContext(self, localctx)
                self.enterOuterAlt(localctx, 4)
                self.state = 230
                self.match(StlParser.GreaterOperator)

            elif token in [StlParser.EqualOperator]:
                localctx = StlParser.CmpOpEqContext(self, localctx)
                self.enterOuterAlt(localctx, 5)
                self.state = 231
                self.match(StlParser.EqualOperator)

            elif token in [StlParser.NotEqualOperator]:
                localctx = StlParser.ComOpNeqContext(self, localctx)
                self.enterOuterAlt(localctx, 6)
                self.state = 232
                self.match(StlParser.NotEqualOperator)

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

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

        def IntegerLiteral(self):
            return self.getToken(StlParser.IntegerLiteral, 0)

        def RealLiteral(self):
            return self.getToken(StlParser.RealLiteral, 0)

        def MINUS(self):
            return self.getToken(StlParser.MINUS, 0)

        def literal(self):
            return self.getTypedRuleContext(StlParser.LiteralContext,0)


        def getRuleIndex(self):
            return StlParser.RULE_literal

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




    def literal(self):

        localctx = StlParser.LiteralContext(self, self._ctx, self.state)
        self.enterRule(localctx, 38, self.RULE_literal)
        try:
            self.state = 239
            token = self._input.LA(1)
            if token in [StlParser.IntegerLiteral]:
                self.enterOuterAlt(localctx, 1)
                self.state = 235
                self.match(StlParser.IntegerLiteral)

            elif token in [StlParser.RealLiteral]:
                self.enterOuterAlt(localctx, 2)
                self.state = 236
                self.match(StlParser.RealLiteral)

            elif token in [StlParser.MINUS]:
                self.enterOuterAlt(localctx, 3)
                self.state = 237
                self.match(StlParser.MINUS)
                self.state = 238
                self.literal()

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

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


        def getRuleIndex(self):
            return StlParser.RULE_identifier

     
        def copyFrom(self, ctx):
            super(StlParser.IdentifierContext, self).copyFrom(ctx)



    class IdContext(IdentifierContext):

        def __init__(self, parser, ctx): # actually a StlParser.IdentifierContext)
            super(StlParser.IdContext, self).__init__(parser)
            self.copyFrom(ctx)

        def Identifier(self):
            return self.getToken(StlParser.Identifier, 0)

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



    def identifier(self):

        localctx = StlParser.IdentifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 40, self.RULE_identifier)
        try:
            localctx = StlParser.IdContext(self, localctx)
            self.enterOuterAlt(localctx, 1)
            self.state = 241
            self.match(StlParser.Identifier)
        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, ruleIndex, predIndex):
        if self._predicates == None:
            self._predicates = dict()
        self._predicates[16] = self.expression_sempred
        self._predicates[17] = self.real_expression_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 expression_sempred(self, localctx, predIndex):
            if predIndex == 0:
                return self.precpred(self._ctx, 16)
         

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

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

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

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

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

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

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

    def real_expression_sempred(self, localctx, predIndex):
            if predIndex == 8:
                return self.precpred(self._ctx, 5)
         

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

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

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





# Generated from StlParser.g4 by ANTLR 4.5.1
# encoding: utf-8
from __future__ import print_function
from antlr4 import *
from io import StringIO

def serializedATN():
    with StringIO() as buf:
        buf.write(u"\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\3")
        buf.write(u"H\u00f6\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t")
        buf.write(u"\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r")
        buf.write(u"\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22\4")
        buf.write(u"\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\3\2\3\2\3\2\3")
        buf.write(u"\3\5\3\61\n\3\3\3\7\3\64\n\3\f\3\16\3\67\13\3\3\3\3\3")
        buf.write(u"\7\3;\n\3\f\3\16\3>\13\3\3\3\3\3\3\4\3\4\3\4\3\5\3\5")
        buf.write(u"\3\5\3\5\3\5\3\6\3\6\3\6\3\6\3\7\3\7\3\b\3\b\3\b\3\t")
        buf.write(u"\3\t\3\t\3\t\3\t\3\t\3\t\3\n\5\n[\n\n\3\n\5\n^\n\n\3")
        buf.write(u"\n\3\n\3\n\5\nc\n\n\3\13\3\13\3\13\3\13\5\13i\n\13\3")
        buf.write(u"\f\3\f\3\r\3\r\3\16\3\16\3\16\3\16\3\16\3\16\3\17\3\17")
        buf.write(u"\5\17w\n\17\3\20\3\20\3\21\3\21\3\21\3\21\3\21\5\21\u0080")
        buf.write(u"\n\21\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3")
        buf.write(u"\22\3\22\3\22\3\22\5\22\u008f\n\22\3\22\3\22\3\22\5\22")
        buf.write(u"\u0094\n\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3")
        buf.write(u"\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\5\22\u00a6\n\22")
        buf.write(u"\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3")
        buf.write(u"\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22")
        buf.write(u"\3\22\3\22\3\22\3\22\3\22\3\22\5\22\u00c3\n\22\3\22\7")
        buf.write(u"\22\u00c6\n\22\f\22\16\22\u00c9\13\22\3\23\3\23\3\23")
        buf.write(u"\3\23\3\23\3\23\3\23\3\23\5\23\u00d3\n\23\3\23\3\23\3")
        buf.write(u"\23\3\23\3\23\3\23\3\23\3\23\3\23\3\23\3\23\3\23\7\23")
        buf.write(u"\u00e1\n\23\f\23\16\23\u00e4\13\23\3\24\3\24\3\24\3\24")
        buf.write(u"\3\24\3\24\5\24\u00ec\n\24\3\25\3\25\3\25\3\25\5\25\u00f2")
        buf.write(u"\n\25\3\26\3\26\3\26\2\4\"$\27\2\4\6\b\n\f\16\20\22\24")
        buf.write(u"\26\30\32\34\36 \"$&(*\2\5\4\2\37\"DD\3\2\32\33\3\2\23")
        buf.write(u"\27\u010b\2,\3\2\2\2\4\60\3\2\2\2\6A\3\2\2\2\bD\3\2\2")
        buf.write(u"\2\nI\3\2\2\2\fM\3\2\2\2\16O\3\2\2\2\20R\3\2\2\2\22Z")
        buf.write(u"\3\2\2\2\24h\3\2\2\2\26j\3\2\2\2\30l\3\2\2\2\32n\3\2")
        buf.write(u"\2\2\34t\3\2\2\2\36x\3\2\2\2 \177\3\2\2\2\"\u00a5\3\2")
        buf.write(u"\2\2$\u00d2\3\2\2\2&\u00eb\3\2\2\2(\u00f1\3\2\2\2*\u00f3")
        buf.write(u"\3\2\2\2,-\5\4\3\2-.\7\2\2\3.\3\3\2\2\2/\61\5\6\4\2\60")
        buf.write(u"/\3\2\2\2\60\61\3\2\2\2\61\65\3\2\2\2\62\64\5\b\5\2\63")
        buf.write(u"\62\3\2\2\2\64\67\3\2\2\2\65\63\3\2\2\2\65\66\3\2\2\2")
        buf.write(u"\66<\3\2\2\2\67\65\3\2\2\28;\5\f\7\29;\5\16\b\2:8\3\2")
        buf.write(u"\2\2:9\3\2\2\2;>\3\2\2\2<:\3\2\2\2<=\3\2\2\2=?\3\2\2")
        buf.write(u"\2><\3\2\2\2?@\5\n\6\2@\5\3\2\2\2AB\7%\2\2BC\7D\2\2C")
        buf.write(u"\7\3\2\2\2DE\7&\2\2EF\7D\2\2FG\7\31\2\2GH\7D\2\2H\t\3")
        buf.write(u"\2\2\2IJ\7D\2\2JK\7>\2\2KL\5 \21\2L\13\3\2\2\2MN\5\22")
        buf.write(u"\n\2N\r\3\2\2\2OP\7\21\2\2PQ\5\20\t\2Q\17\3\2\2\2RS\7")
        buf.write(u"\30\2\2ST\7\7\2\2TU\7D\2\2UV\7\17\2\2VW\7D\2\2WX\7\b")
        buf.write(u"\2\2X\21\3\2\2\2Y[\7\35\2\2ZY\3\2\2\2Z[\3\2\2\2[]\3\2")
        buf.write(u"\2\2\\^\5\30\r\2]\\\3\2\2\2]^\3\2\2\2^_\3\2\2\2_`\5\26")
        buf.write(u"\f\2`b\5*\26\2ac\5\24\13\2ba\3\2\2\2bc\3\2\2\2c\23\3")
        buf.write(u"\2\2\2de\7>\2\2ei\5(\25\2fg\7>\2\2gi\5\"\22\2hd\3\2\2")
        buf.write(u"\2hf\3\2\2\2i\25\3\2\2\2jk\t\2\2\2k\27\3\2\2\2lm\t\3")
        buf.write(u"\2\2m\31\3\2\2\2no\7\13\2\2op\5\34\17\2pq\7\16\2\2qr")
        buf.write(u"\5\34\17\2rs\7\f\2\2s\33\3\2\2\2tv\5(\25\2uw\5\36\20")
        buf.write(u"\2vu\3\2\2\2vw\3\2\2\2w\35\3\2\2\2xy\t\4\2\2y\37\3\2")
        buf.write(u"\2\2z{\7/\2\2{\u0080\5\"\22\2|}\7\60\2\2}\u0080\5\"\22")
        buf.write(u"\2~\u0080\5\"\22\2\177z\3\2\2\2\177|\3\2\2\2\177~\3\2")
        buf.write(u"\2\2\u0080!\3\2\2\2\u0081\u0082\b\22\1\2\u0082\u0083")
        buf.write(u"\7\'\2\2\u0083\u00a6\5\"\22\20\u0084\u0085\7/\2\2\u0085")
        buf.write(u"\u0086\5\32\16\2\u0086\u0087\5\"\22\n\u0087\u00a6\3\2")
        buf.write(u"\2\2\u0088\u0089\7\60\2\2\u0089\u008a\5\32\16\2\u008a")
        buf.write(u"\u008b\5\"\22\t\u008b\u00a6\3\2\2\2\u008c\u008e\7\62")
        buf.write(u"\2\2\u008d\u008f\5\32\16\2\u008e\u008d\3\2\2\2\u008e")
        buf.write(u"\u008f\3\2\2\2\u008f\u0090\3\2\2\2\u0090\u00a6\5\"\22")
        buf.write(u"\7\u0091\u0093\7\63\2\2\u0092\u0094\5\32\16\2\u0093\u0092")
        buf.write(u"\3\2\2\2\u0093\u0094\3\2\2\2\u0094\u0095\3\2\2\2\u0095")
        buf.write(u"\u00a6\5\"\22\6\u0096\u00a6\5$\23\2\u0097\u0098\7\7\2")
        buf.write(u"\2\u0098\u0099\5\"\22\2\u0099\u009a\7\b\2\2\u009a\u00a6")
        buf.write(u"\3\2\2\2\u009b\u009c\7-\2\2\u009c\u009d\7\7\2\2\u009d")
        buf.write(u"\u009e\5\"\22\2\u009e\u009f\7\b\2\2\u009f\u00a6\3\2\2")
        buf.write(u"\2\u00a0\u00a1\7.\2\2\u00a1\u00a2\7\7\2\2\u00a2\u00a3")
        buf.write(u"\5\"\22\2\u00a3\u00a4\7\b\2\2\u00a4\u00a6\3\2\2\2\u00a5")
        buf.write(u"\u0081\3\2\2\2\u00a5\u0084\3\2\2\2\u00a5\u0088\3\2\2")
        buf.write(u"\2\u00a5\u008c\3\2\2\2\u00a5\u0091\3\2\2\2\u00a5\u0096")
        buf.write(u"\3\2\2\2\u00a5\u0097\3\2\2\2\u00a5\u009b\3\2\2\2\u00a5")
        buf.write(u"\u00a0\3\2\2\2\u00a6\u00c7\3\2\2\2\u00a7\u00a8\f\22\2")
        buf.write(u"\2\u00a8\u00a9\5&\24\2\u00a9\u00aa\5\"\22\23\u00aa\u00c6")
        buf.write(u"\3\2\2\2\u00ab\u00ac\f\17\2\2\u00ac\u00ad\7(\2\2\u00ad")
        buf.write(u"\u00c6\5\"\22\20\u00ae\u00af\f\16\2\2\u00af\u00b0\7)")
        buf.write(u"\2\2\u00b0\u00c6\5\"\22\17\u00b1\u00b2\f\r\2\2\u00b2")
        buf.write(u"\u00b3\7+\2\2\u00b3\u00c6\5\"\22\16\u00b4\u00b5\f\f\2")
        buf.write(u"\2\u00b5\u00b6\7*\2\2\u00b6\u00c6\5\"\22\r\u00b7\u00b8")
        buf.write(u"\f\13\2\2\u00b8\u00b9\7,\2\2\u00b9\u00c6\5\"\22\f\u00ba")
        buf.write(u"\u00bb\f\b\2\2\u00bb\u00bc\7\61\2\2\u00bc\u00bd\5\32")
        buf.write(u"\16\2\u00bd\u00be\5\"\22\t\u00be\u00c6\3\2\2\2\u00bf")
        buf.write(u"\u00c0\f\5\2\2\u00c0\u00c2\7\64\2\2\u00c1\u00c3\5\32")
        buf.write(u"\16\2\u00c2\u00c1\3\2\2\2\u00c2\u00c3\3\2\2\2\u00c3\u00c4")
        buf.write(u"\3\2\2\2\u00c4\u00c6\5\"\22\6\u00c5\u00a7\3\2\2\2\u00c5")
        buf.write(u"\u00ab\3\2\2\2\u00c5\u00ae\3\2\2\2\u00c5\u00b1\3\2\2")
        buf.write(u"\2\u00c5\u00b4\3\2\2\2\u00c5\u00b7\3\2\2\2\u00c5\u00ba")
        buf.write(u"\3\2\2\2\u00c5\u00bf\3\2\2\2\u00c6\u00c9\3\2\2\2\u00c7")
        buf.write(u"\u00c5\3\2\2\2\u00c7\u00c8\3\2\2\2\u00c8#\3\2\2\2\u00c9")
        buf.write(u"\u00c7\3\2\2\2\u00ca\u00cb\b\23\1\2\u00cb\u00d3\7D\2")
        buf.write(u"\2\u00cc\u00d3\5(\25\2\u00cd\u00ce\7\22\2\2\u00ce\u00cf")
        buf.write(u"\7\7\2\2\u00cf\u00d0\5$\23\2\u00d0\u00d1\7\b\2\2\u00d1")
        buf.write(u"\u00d3\3\2\2\2\u00d2\u00ca\3\2\2\2\u00d2\u00cc\3\2\2")
        buf.write(u"\2\u00d2\u00cd\3\2\2\2\u00d3\u00e2\3\2\2\2\u00d4\u00d5")
        buf.write(u"\f\7\2\2\u00d5\u00d6\7\4\2\2\u00d6\u00e1\5$\23\b\u00d7")
        buf.write(u"\u00d8\f\6\2\2\u00d8\u00d9\7\3\2\2\u00d9\u00e1\5$\23")
        buf.write(u"\7\u00da\u00db\f\5\2\2\u00db\u00dc\7\5\2\2\u00dc\u00e1")
        buf.write(u"\5$\23\6\u00dd\u00de\f\4\2\2\u00de\u00df\7\6\2\2\u00df")
        buf.write(u"\u00e1\5$\23\5\u00e0\u00d4\3\2\2\2\u00e0\u00d7\3\2\2")
        buf.write(u"\2\u00e0\u00da\3\2\2\2\u00e0\u00dd\3\2\2\2\u00e1\u00e4")
        buf.write(u"\3\2\2\2\u00e2\u00e0\3\2\2\2\u00e2\u00e3\3\2\2\2\u00e3")
        buf.write(u"%\3\2\2\2\u00e4\u00e2\3\2\2\2\u00e5\u00ec\7;\2\2\u00e6")
        buf.write(u"\u00ec\7:\2\2\u00e7\u00ec\7=\2\2\u00e8\u00ec\7<\2\2\u00e9")
        buf.write(u"\u00ec\78\2\2\u00ea\u00ec\79\2\2\u00eb\u00e5\3\2\2\2")
        buf.write(u"\u00eb\u00e6\3\2\2\2\u00eb\u00e7\3\2\2\2\u00eb\u00e8")
        buf.write(u"\3\2\2\2\u00eb\u00e9\3\2\2\2\u00eb\u00ea\3\2\2\2\u00ec")
        buf.write(u"\'\3\2\2\2\u00ed\u00f2\7B\2\2\u00ee\u00f2\7C\2\2\u00ef")
        buf.write(u"\u00f0\7\3\2\2\u00f0\u00f2\5(\25\2\u00f1\u00ed\3\2\2")
        buf.write(u"\2\u00f1\u00ee\3\2\2\2\u00f1\u00ef\3\2\2\2\u00f2)\3\2")
        buf.write(u"\2\2\u00f3\u00f4\7D\2\2\u00f4+\3\2\2\2\27\60\65:<Z]b")
        buf.write(u"hv\177\u008e\u0093\u00a5\u00c2\u00c5\u00c7\u00d2\u00e0")
        buf.write(u"\u00e2\u00eb\u00f1")
        return buf.getvalue()


class StlParser ( Parser ):

    grammarFileName = "StlParser.g4"

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

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

    sharedContextCache = PredictionContextCache()

    literalNames = [ u"<INVALID>", u"'-'", u"'+'", u"'*'", u"'/'", u"'('", 
                     u"')'", u"'{'", u"'}'", u"'['", u"']'", u"';'", u"':'", 
                     u"','", u"'.'", u"'@'", u"'abs'", u"'s'", u"'ms'", 
                     u"'us'", u"'ns'", u"'ps'", u"'topic'", u"'import'", 
                     u"'input'", u"'output'", u"'internal'", u"'const'", 
                     u"'real'", u"'float'", u"'long'", u"'complex'", u"'int'", 
                     u"'bool'", u"'assertion'", u"'specification'", u"'from'", 
                     u"<INVALID>", u"<INVALID>", u"<INVALID>", u"<INVALID>", 
                     u"<INVALID>", u"'xor'", u"'rise'", u"'fall'", u"<INVALID>", 
                     u"<INVALID>", u"<INVALID>", u"<INVALID>", u"<INVALID>", 
                     u"<INVALID>", u"<INVALID>", u"'oracle'", u"<INVALID>", 
                     u"'=='", u"'!=='", u"'>='", u"'<='", u"'>'", u"'<'", 
                     u"'='" ]

    symbolicNames = [ u"<INVALID>", u"MINUS", u"PLUS", u"TIMES", u"DIVIDE", 
                      u"LPAREN", u"RPAREN", u"LBRACE", u"RBRACE", u"LBRACK", 
                      u"RBRACK", u"SEMICOLON", u"COLON", u"COMMA", u"DOT", 
                      u"AT", u"ABS", u"SEC", u"MSEC", u"USEC", u"NSEC", 
                      u"PSEC", u"ROS_Topic", u"Import", u"Input", u"Output", 
                      u"Internal", u"Constant", u"DomainTypeReal", u"DomainTypeFloat", 
                      u"DomainTypeLong", u"DomainTypeComplex", u"DomainTypeInt", 
                      u"DomainTypeBool", u"Assertion", u"Specification", 
                      u"From", u"NotOperator", u"OrOperator", u"AndOperator", 
                      u"IffOperator", u"ImpliesOperator", u"XorOperator", 
                      u"RiseOperator", u"FallOperator", u"AlwaysOperator", 
                      u"EventuallyOperator", u"UntilOperator", u"HistoricallyOperator", 
                      u"OnceOperator", u"SinceOperator", u"NextOperator", 
                      u"OracleOperator", u"PreviousOperator", u"EqualOperator", 
                      u"NotEqualOperator", u"GreaterOrEqualOperator", u"LesserOrEqualOperator", 
                      u"GreaterOperator", u"LesserOperator", u"EQUAL", u"BooleanLiteral", 
                      u"TRUE", u"FALSE", u"IntegerLiteral", u"RealLiteral", 
                      u"Identifier", u"LINE_TERMINATOR", u"WHITESPACE", 
                      u"COMMENT", u"LINE_COMMENT" ]

    RULE_stlfile = 0
    RULE_stlSpecification = 1
    RULE_spec = 2
    RULE_modimport = 3
    RULE_assertion = 4
    RULE_declaration = 5
    RULE_annotation = 6
    RULE_annotation_type = 7
    RULE_variableDeclaration = 8
    RULE_assignment = 9
    RULE_domainType = 10
    RULE_ioType = 11
    RULE_interval = 12
    RULE_intervalTime = 13
    RULE_unit = 14
    RULE_topExpression = 15
    RULE_expression = 16
    RULE_real_expression = 17
    RULE_comparisonOp = 18
    RULE_literal = 19
    RULE_identifier = 20

    ruleNames =  [ u"stlfile", u"stlSpecification", u"spec", u"modimport", 
                   u"assertion", u"declaration", u"annotation", u"annotation_type", 
                   u"variableDeclaration", u"assignment", u"domainType", 
                   u"ioType", u"interval", u"intervalTime", u"unit", u"topExpression", 
                   u"expression", u"real_expression", u"comparisonOp", u"literal", 
                   u"identifier" ]

    EOF = Token.EOF
    MINUS=1
    PLUS=2
    TIMES=3
    DIVIDE=4
    LPAREN=5
    RPAREN=6
    LBRACE=7
    RBRACE=8
    LBRACK=9
    RBRACK=10
    SEMICOLON=11
    COLON=12
    COMMA=13
    DOT=14
    AT=15
    ABS=16
    SEC=17
    MSEC=18
    USEC=19
    NSEC=20
    PSEC=21
    ROS_Topic=22
    Import=23
    Input=24
    Output=25
    Internal=26
    Constant=27
    DomainTypeReal=28
    DomainTypeFloat=29
    DomainTypeLong=30
    DomainTypeComplex=31
    DomainTypeInt=32
    DomainTypeBool=33
    Assertion=34
    Specification=35
    From=36
    NotOperator=37
    OrOperator=38
    AndOperator=39
    IffOperator=40
    ImpliesOperator=41
    XorOperator=42
    RiseOperator=43
    FallOperator=44
    AlwaysOperator=45
    EventuallyOperator=46
    UntilOperator=47
    HistoricallyOperator=48
    OnceOperator=49
    SinceOperator=50
    NextOperator=51
    OracleOperator=52
    PreviousOperator=53
    EqualOperator=54
    NotEqualOperator=55
    GreaterOrEqualOperator=56
    LesserOrEqualOperator=57
    GreaterOperator=58
    LesserOperator=59
    EQUAL=60
    BooleanLiteral=61
    TRUE=62
    FALSE=63
    IntegerLiteral=64
    RealLiteral=65
    Identifier=66
    LINE_TERMINATOR=67
    WHITESPACE=68
    COMMENT=69
    LINE_COMMENT=70

    def __init__(self, input):
        super(StlParser, self).__init__(input)
        self.checkVersion("4.5.1")
        self._interp = ParserATNSimulator(self, self.atn, self.decisionsToDFA, self.sharedContextCache)
        self._predicates = None



    class StlfileContext(ParserRuleContext):

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

        def stlSpecification(self):
            return self.getTypedRuleContext(StlParser.StlSpecificationContext,0)


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

        def getRuleIndex(self):
            return StlParser.RULE_stlfile

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




    def stlfile(self):

        localctx = StlParser.StlfileContext(self, self._ctx, self.state)
        self.enterRule(localctx, 0, self.RULE_stlfile)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 42
            self.stlSpecification()
            self.state = 43
            self.match(StlParser.EOF)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class StlSpecificationContext(ParserRuleContext):

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

        def assertion(self):
            return self.getTypedRuleContext(StlParser.AssertionContext,0)


        def spec(self):
            return self.getTypedRuleContext(StlParser.SpecContext,0)


        def modimport(self, i=None):
            if i is None:
                return self.getTypedRuleContexts(StlParser.ModimportContext)
            else:
                return self.getTypedRuleContext(StlParser.ModimportContext,i)


        def declaration(self, i=None):
            if i is None:
                return self.getTypedRuleContexts(StlParser.DeclarationContext)
            else:
                return self.getTypedRuleContext(StlParser.DeclarationContext,i)


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


        def getRuleIndex(self):
            return StlParser.RULE_stlSpecification

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




    def stlSpecification(self):

        localctx = StlParser.StlSpecificationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 2, self.RULE_stlSpecification)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 46
            _la = self._input.LA(1)
            if _la==StlParser.Specification:
                self.state = 45
                self.spec()


            self.state = 51
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==StlParser.From:
                self.state = 48
                self.modimport()
                self.state = 53
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 58
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,3,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 56
                    token = self._input.LA(1)
                    if token in [StlParser.Input, StlParser.Output, StlParser.Constant, StlParser.DomainTypeFloat, StlParser.DomainTypeLong, StlParser.DomainTypeComplex, StlParser.DomainTypeInt, StlParser.Identifier]:
                        self.state = 54
                        self.declaration()

                    elif token in [StlParser.AT]:
                        self.state = 55
                        self.annotation()

                    else:
                        raise NoViableAltException(self)
             
                self.state = 60
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,3,self._ctx)

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

    class SpecContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return StlParser.RULE_spec

     
        def copyFrom(self, ctx):
            super(StlParser.SpecContext, self).copyFrom(ctx)



    class SpecificationContext(SpecContext):

        def __init__(self, parser, ctx): # actually a StlParser.SpecContext)
            super(StlParser.SpecificationContext, self).__init__(parser)
            self.copyFrom(ctx)

        def Specification(self):
            return self.getToken(StlParser.Specification, 0)
        def Identifier(self):
            return self.getToken(StlParser.Identifier, 0)

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



    def spec(self):

        localctx = StlParser.SpecContext(self, self._ctx, self.state)
        self.enterRule(localctx, 4, self.RULE_spec)
        try:
            localctx = StlParser.SpecificationContext(self, localctx)
            self.enterOuterAlt(localctx, 1)
            self.state = 63
            self.match(StlParser.Specification)
            self.state = 64
            self.match(StlParser.Identifier)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class ModimportContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return StlParser.RULE_modimport

     
        def copyFrom(self, ctx):
            super(StlParser.ModimportContext, self).copyFrom(ctx)



    class ModImportContext(ModimportContext):

        def __init__(self, parser, ctx): # actually a StlParser.ModimportContext)
            super(StlParser.ModImportContext, self).__init__(parser)
            self.copyFrom(ctx)

        def From(self):
            return self.getToken(StlParser.From, 0)
        def Identifier(self, i=None):
            if i is None:
                return self.getTokens(StlParser.Identifier)
            else:
                return self.getToken(StlParser.Identifier, i)
        def Import(self):
            return self.getToken(StlParser.Import, 0)

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



    def modimport(self):

        localctx = StlParser.ModimportContext(self, self._ctx, self.state)
        self.enterRule(localctx, 6, self.RULE_modimport)
        try:
            localctx = StlParser.ModImportContext(self, localctx)
            self.enterOuterAlt(localctx, 1)
            self.state = 66
            self.match(StlParser.From)
            self.state = 67
            self.match(StlParser.Identifier)
            self.state = 68
            self.match(StlParser.Import)
            self.state = 69
            self.match(StlParser.Identifier)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class AssertionContext(ParserRuleContext):

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

        def Identifier(self):
            return self.getToken(StlParser.Identifier, 0)

        def EQUAL(self):
            return self.getToken(StlParser.EQUAL, 0)

        def topExpression(self):
            return self.getTypedRuleContext(StlParser.TopExpressionContext,0)


        def getRuleIndex(self):
            return StlParser.RULE_assertion

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




    def assertion(self):

        localctx = StlParser.AssertionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 8, self.RULE_assertion)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 71
            self.match(StlParser.Identifier)
            self.state = 72
            self.match(StlParser.EQUAL)
            self.state = 73
            self.topExpression()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class DeclarationContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return StlParser.RULE_declaration

     
        def copyFrom(self, ctx):
            super(StlParser.DeclarationContext, self).copyFrom(ctx)



    class DeclVariableContext(DeclarationContext):

        def __init__(self, parser, ctx): # actually a StlParser.DeclarationContext)
            super(StlParser.DeclVariableContext, self).__init__(parser)
            self.copyFrom(ctx)

        def variableDeclaration(self):
            return self.getTypedRuleContext(StlParser.VariableDeclarationContext,0)


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



    def declaration(self):

        localctx = StlParser.DeclarationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 10, self.RULE_declaration)
        try:
            localctx = StlParser.DeclVariableContext(self, localctx)
            self.enterOuterAlt(localctx, 1)
            self.state = 75
            self.variableDeclaration()
        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=None, invokingState=-1):
            super(StlParser.AnnotationContext, self).__init__(parent, invokingState)
            self.parser = parser

        def annotation_type(self):
            return self.getTypedRuleContext(StlParser.Annotation_typeContext,0)


        def getRuleIndex(self):
            return StlParser.RULE_annotation

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




    def annotation(self):

        localctx = StlParser.AnnotationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 12, self.RULE_annotation)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 77
            self.match(StlParser.AT)
            self.state = 78
            self.annotation_type()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class Annotation_typeContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return StlParser.RULE_annotation_type

     
        def copyFrom(self, ctx):
            super(StlParser.Annotation_typeContext, self).copyFrom(ctx)



    class RosTopicContext(Annotation_typeContext):

        def __init__(self, parser, ctx): # actually a StlParser.Annotation_typeContext)
            super(StlParser.RosTopicContext, self).__init__(parser)
            self.copyFrom(ctx)

        def ROS_Topic(self):
            return self.getToken(StlParser.ROS_Topic, 0)
        def LPAREN(self):
            return self.getToken(StlParser.LPAREN, 0)
        def Identifier(self, i=None):
            if i is None:
                return self.getTokens(StlParser.Identifier)
            else:
                return self.getToken(StlParser.Identifier, i)
        def COMMA(self):
            return self.getToken(StlParser.COMMA, 0)
        def RPAREN(self):
            return self.getToken(StlParser.RPAREN, 0)

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



    def annotation_type(self):

        localctx = StlParser.Annotation_typeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 14, self.RULE_annotation_type)
        try:
            localctx = StlParser.RosTopicContext(self, localctx)
            self.enterOuterAlt(localctx, 1)
            self.state = 80
            self.match(StlParser.ROS_Topic)
            self.state = 81
            self.match(StlParser.LPAREN)
            self.state = 82
            self.match(StlParser.Identifier)
            self.state = 83
            self.match(StlParser.COMMA)
            self.state = 84
            self.match(StlParser.Identifier)
            self.state = 85
            self.match(StlParser.RPAREN)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class VariableDeclarationContext(ParserRuleContext):

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

        def domainType(self):
            return self.getTypedRuleContext(StlParser.DomainTypeContext,0)


        def identifier(self):
            return self.getTypedRuleContext(StlParser.IdentifierContext,0)


        def Constant(self):
            return self.getToken(StlParser.Constant, 0)

        def ioType(self):
            return self.getTypedRuleContext(StlParser.IoTypeContext,0)


        def assignment(self):
            return self.getTypedRuleContext(StlParser.AssignmentContext,0)


        def getRuleIndex(self):
            return StlParser.RULE_variableDeclaration

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




    def variableDeclaration(self):

        localctx = StlParser.VariableDeclarationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 16, self.RULE_variableDeclaration)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 88
            _la = self._input.LA(1)
            if _la==StlParser.Constant:
                self.state = 87
                self.match(StlParser.Constant)


            self.state = 91
            _la = self._input.LA(1)
            if _la==StlParser.Input or _la==StlParser.Output:
                self.state = 90
                self.ioType()


            self.state = 93
            self.domainType()
            self.state = 94
            self.identifier()
            self.state = 96
            _la = self._input.LA(1)
            if _la==StlParser.EQUAL:
                self.state = 95
                self.assignment()


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

    class AssignmentContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return StlParser.RULE_assignment

     
        def copyFrom(self, ctx):
            super(StlParser.AssignmentContext, self).copyFrom(ctx)



    class AsgnExprContext(AssignmentContext):

        def __init__(self, parser, ctx): # actually a StlParser.AssignmentContext)
            super(StlParser.AsgnExprContext, self).__init__(parser)
            self.copyFrom(ctx)

        def EQUAL(self):
            return self.getToken(StlParser.EQUAL, 0)
        def expression(self):
            return self.getTypedRuleContext(StlParser.ExpressionContext,0)


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


    class AsgnLiteralContext(AssignmentContext):

        def __init__(self, parser, ctx): # actually a StlParser.AssignmentContext)
            super(StlParser.AsgnLiteralContext, self).__init__(parser)
            self.copyFrom(ctx)

        def EQUAL(self):
            return self.getToken(StlParser.EQUAL, 0)
        def literal(self):
            return self.getTypedRuleContext(StlParser.LiteralContext,0)


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



    def assignment(self):

        localctx = StlParser.AssignmentContext(self, self._ctx, self.state)
        self.enterRule(localctx, 18, self.RULE_assignment)
        try:
            self.state = 102
            la_ = self._interp.adaptivePredict(self._input,7,self._ctx)
            if la_ == 1:
                localctx = StlParser.AsgnLiteralContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 98
                self.match(StlParser.EQUAL)
                self.state = 99
                self.literal()
                pass

            elif la_ == 2:
                localctx = StlParser.AsgnExprContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 100
                self.match(StlParser.EQUAL)
                self.state = 101
                self.expression(0)
                pass


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

    class DomainTypeContext(ParserRuleContext):

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

        def DomainTypeFloat(self):
            return self.getToken(StlParser.DomainTypeFloat, 0)

        def DomainTypeInt(self):
            return self.getToken(StlParser.DomainTypeInt, 0)

        def DomainTypeLong(self):
            return self.getToken(StlParser.DomainTypeLong, 0)

        def DomainTypeComplex(self):
            return self.getToken(StlParser.DomainTypeComplex, 0)

        def Identifier(self):
            return self.getToken(StlParser.Identifier, 0)

        def getRuleIndex(self):
            return StlParser.RULE_domainType

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




    def domainType(self):

        localctx = StlParser.DomainTypeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 20, self.RULE_domainType)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 104
            _la = self._input.LA(1)
            if not(((((_la - 29)) & ~0x3f) == 0 and ((1 << (_la - 29)) & ((1 << (StlParser.DomainTypeFloat - 29)) | (1 << (StlParser.DomainTypeLong - 29)) | (1 << (StlParser.DomainTypeComplex - 29)) | (1 << (StlParser.DomainTypeInt - 29)) | (1 << (StlParser.Identifier - 29)))) != 0)):
                self._errHandler.recoverInline(self)
            else:
                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 IoTypeContext(ParserRuleContext):

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

        def Input(self):
            return self.getToken(StlParser.Input, 0)

        def Output(self):
            return self.getToken(StlParser.Output, 0)

        def getRuleIndex(self):
            return StlParser.RULE_ioType

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




    def ioType(self):

        localctx = StlParser.IoTypeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 22, self.RULE_ioType)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 106
            _la = self._input.LA(1)
            if not(_la==StlParser.Input or _la==StlParser.Output):
                self._errHandler.recoverInline(self)
            else:
                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 IntervalContext(ParserRuleContext):

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

        def LBRACK(self):
            return self.getToken(StlParser.LBRACK, 0)

        def intervalTime(self, i=None):
            if i is None:
                return self.getTypedRuleContexts(StlParser.IntervalTimeContext)
            else:
                return self.getTypedRuleContext(StlParser.IntervalTimeContext,i)


        def COLON(self):
            return self.getToken(StlParser.COLON, 0)

        def RBRACK(self):
            return self.getToken(StlParser.RBRACK, 0)

        def getRuleIndex(self):
            return StlParser.RULE_interval

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




    def interval(self):

        localctx = StlParser.IntervalContext(self, self._ctx, self.state)
        self.enterRule(localctx, 24, self.RULE_interval)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 108
            self.match(StlParser.LBRACK)
            self.state = 109
            self.intervalTime()
            self.state = 110
            self.match(StlParser.COLON)
            self.state = 111
            self.intervalTime()
            self.state = 112
            self.match(StlParser.RBRACK)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class IntervalTimeContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return StlParser.RULE_intervalTime

     
        def copyFrom(self, ctx):
            super(StlParser.IntervalTimeContext, self).copyFrom(ctx)



    class IntervalTimeLiteralContext(IntervalTimeContext):

        def __init__(self, parser, ctx): # actually a StlParser.IntervalTimeContext)
            super(StlParser.IntervalTimeLiteralContext, self).__init__(parser)
            self.copyFrom(ctx)

        def literal(self):
            return self.getTypedRuleContext(StlParser.LiteralContext,0)

        def unit(self):
            return self.getTypedRuleContext(StlParser.UnitContext,0)


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



    def intervalTime(self):

        localctx = StlParser.IntervalTimeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 26, self.RULE_intervalTime)
        self._la = 0 # Token type
        try:
            localctx = StlParser.IntervalTimeLiteralContext(self, localctx)
            self.enterOuterAlt(localctx, 1)
            self.state = 114
            self.literal()
            self.state = 116
            _la = self._input.LA(1)
            if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << StlParser.SEC) | (1 << StlParser.MSEC) | (1 << StlParser.USEC) | (1 << StlParser.NSEC) | (1 << StlParser.PSEC))) != 0):
                self.state = 115
                self.unit()


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

    class UnitContext(ParserRuleContext):

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

        def SEC(self):
            return self.getToken(StlParser.SEC, 0)

        def MSEC(self):
            return self.getToken(StlParser.MSEC, 0)

        def USEC(self):
            return self.getToken(StlParser.USEC, 0)

        def NSEC(self):
            return self.getToken(StlParser.NSEC, 0)

        def PSEC(self):
            return self.getToken(StlParser.PSEC, 0)

        def getRuleIndex(self):
            return StlParser.RULE_unit

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




    def unit(self):

        localctx = StlParser.UnitContext(self, self._ctx, self.state)
        self.enterRule(localctx, 28, self.RULE_unit)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 118
            _la = self._input.LA(1)
            if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << StlParser.SEC) | (1 << StlParser.MSEC) | (1 << StlParser.USEC) | (1 << StlParser.NSEC) | (1 << StlParser.PSEC))) != 0)):
                self._errHandler.recoverInline(self)
            else:
                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 TopExpressionContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return StlParser.RULE_topExpression

     
        def copyFrom(self, ctx):
            super(StlParser.TopExpressionContext, self).copyFrom(ctx)



    class ExprContext(TopExpressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.TopExpressionContext)
            super(StlParser.ExprContext, self).__init__(parser)
            self.copyFrom(ctx)

        def expression(self):
            return self.getTypedRuleContext(StlParser.ExpressionContext,0)


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


    class ExprUntimedEvExprContext(TopExpressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.TopExpressionContext)
            super(StlParser.ExprUntimedEvExprContext, self).__init__(parser)
            self.copyFrom(ctx)

        def EventuallyOperator(self):
            return self.getToken(StlParser.EventuallyOperator, 0)
        def expression(self):
            return self.getTypedRuleContext(StlParser.ExpressionContext,0)


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


    class ExprUntimedAlwaysExprContext(TopExpressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.TopExpressionContext)
            super(StlParser.ExprUntimedAlwaysExprContext, self).__init__(parser)
            self.copyFrom(ctx)

        def AlwaysOperator(self):
            return self.getToken(StlParser.AlwaysOperator, 0)
        def expression(self):
            return self.getTypedRuleContext(StlParser.ExpressionContext,0)


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



    def topExpression(self):

        localctx = StlParser.TopExpressionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 30, self.RULE_topExpression)
        try:
            self.state = 125
            la_ = self._interp.adaptivePredict(self._input,9,self._ctx)
            if la_ == 1:
                localctx = StlParser.ExprUntimedAlwaysExprContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 120
                self.match(StlParser.AlwaysOperator)
                self.state = 121
                self.expression(0)
                pass

            elif la_ == 2:
                localctx = StlParser.ExprUntimedEvExprContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 122
                self.match(StlParser.EventuallyOperator)
                self.state = 123
                self.expression(0)
                pass

            elif la_ == 3:
                localctx = StlParser.ExprContext(self, localctx)
                self.enterOuterAlt(localctx, 3)
                self.state = 124
                self.expression(0)
                pass


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

    class ExpressionContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return StlParser.RULE_expression

     
        def copyFrom(self, ctx):
            super(StlParser.ExpressionContext, self).copyFrom(ctx)


    class ExprParenContext(ExpressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.ExpressionContext)
            super(StlParser.ExprParenContext, self).__init__(parser)
            self.copyFrom(ctx)

        def LPAREN(self):
            return self.getToken(StlParser.LPAREN, 0)
        def expression(self):
            return self.getTypedRuleContext(StlParser.ExpressionContext,0)

        def RPAREN(self):
            return self.getToken(StlParser.RPAREN, 0)

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


    class ExprAndExprContext(ExpressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.ExpressionContext)
            super(StlParser.ExprAndExprContext, self).__init__(parser)
            self.copyFrom(ctx)

        def expression(self, i=None):
            if i is None:
                return self.getTypedRuleContexts(StlParser.ExpressionContext)
            else:
                return self.getTypedRuleContext(StlParser.ExpressionContext,i)

        def AndOperator(self):
            return self.getToken(StlParser.AndOperator, 0)

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


    class ExpreOnceExprContext(ExpressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.ExpressionContext)
            super(StlParser.ExpreOnceExprContext, self).__init__(parser)
            self.copyFrom(ctx)

        def OnceOperator(self):
            return self.getToken(StlParser.OnceOperator, 0)
        def expression(self):
            return self.getTypedRuleContext(StlParser.ExpressionContext,0)

        def interval(self):
            return self.getTypedRuleContext(StlParser.IntervalContext,0)


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


    class ExprAlwaysExprContext(ExpressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.ExpressionContext)
            super(StlParser.ExprAlwaysExprContext, self).__init__(parser)
            self.copyFrom(ctx)

        def AlwaysOperator(self):
            return self.getToken(StlParser.AlwaysOperator, 0)
        def interval(self):
            return self.getTypedRuleContext(StlParser.IntervalContext,0)

        def expression(self):
            return self.getTypedRuleContext(StlParser.ExpressionContext,0)


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


    class ExprImpliesExprContext(ExpressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.ExpressionContext)
            super(StlParser.ExprImpliesExprContext, self).__init__(parser)
            self.copyFrom(ctx)

        def expression(self, i=None):
            if i is None:
                return self.getTypedRuleContexts(StlParser.ExpressionContext)
            else:
                return self.getTypedRuleContext(StlParser.ExpressionContext,i)

        def ImpliesOperator(self):
            return self.getToken(StlParser.ImpliesOperator, 0)

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


    class ExprXorExprContext(ExpressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.ExpressionContext)
            super(StlParser.ExprXorExprContext, self).__init__(parser)
            self.copyFrom(ctx)

        def expression(self, i=None):
            if i is None:
                return self.getTypedRuleContexts(StlParser.ExpressionContext)
            else:
                return self.getTypedRuleContext(StlParser.ExpressionContext,i)

        def XorOperator(self):
            return self.getToken(StlParser.XorOperator, 0)

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


    class ExprSinceExprContext(ExpressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.ExpressionContext)
            super(StlParser.ExprSinceExprContext, self).__init__(parser)
            self.copyFrom(ctx)

        def expression(self, i=None):
            if i is None:
                return self.getTypedRuleContexts(StlParser.ExpressionContext)
            else:
                return self.getTypedRuleContext(StlParser.ExpressionContext,i)

        def SinceOperator(self):
            return self.getToken(StlParser.SinceOperator, 0)
        def interval(self):
            return self.getTypedRuleContext(StlParser.IntervalContext,0)


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


    class ExprNotContext(ExpressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.ExpressionContext)
            super(StlParser.ExprNotContext, self).__init__(parser)
            self.copyFrom(ctx)

        def NotOperator(self):
            return self.getToken(StlParser.NotOperator, 0)
        def expression(self):
            return self.getTypedRuleContext(StlParser.ExpressionContext,0)


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


    class ExprOrExprContext(ExpressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.ExpressionContext)
            super(StlParser.ExprOrExprContext, self).__init__(parser)
            self.copyFrom(ctx)

        def expression(self, i=None):
            if i is None:
                return self.getTypedRuleContexts(StlParser.ExpressionContext)
            else:
                return self.getTypedRuleContext(StlParser.ExpressionContext,i)

        def OrOperator(self):
            return self.getToken(StlParser.OrOperator, 0)

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


    class ExprIffExprContext(ExpressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.ExpressionContext)
            super(StlParser.ExprIffExprContext, self).__init__(parser)
            self.copyFrom(ctx)

        def expression(self, i=None):
            if i is None:
                return self.getTypedRuleContexts(StlParser.ExpressionContext)
            else:
                return self.getTypedRuleContext(StlParser.ExpressionContext,i)

        def IffOperator(self):
            return self.getToken(StlParser.IffOperator, 0)

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


    class ExprFallContext(ExpressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.ExpressionContext)
            super(StlParser.ExprFallContext, self).__init__(parser)
            self.copyFrom(ctx)

        def FallOperator(self):
            return self.getToken(StlParser.FallOperator, 0)
        def LPAREN(self):
            return self.getToken(StlParser.LPAREN, 0)
        def expression(self):
            return self.getTypedRuleContext(StlParser.ExpressionContext,0)

        def RPAREN(self):
            return self.getToken(StlParser.RPAREN, 0)

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


    class ExprRiseContext(ExpressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.ExpressionContext)
            super(StlParser.ExprRiseContext, self).__init__(parser)
            self.copyFrom(ctx)

        def RiseOperator(self):
            return self.getToken(StlParser.RiseOperator, 0)
        def LPAREN(self):
            return self.getToken(StlParser.LPAREN, 0)
        def expression(self):
            return self.getTypedRuleContext(StlParser.ExpressionContext,0)

        def RPAREN(self):
            return self.getToken(StlParser.RPAREN, 0)

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


    class ExprHistExprContext(ExpressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.ExpressionContext)
            super(StlParser.ExprHistExprContext, self).__init__(parser)
            self.copyFrom(ctx)

        def HistoricallyOperator(self):
            return self.getToken(StlParser.HistoricallyOperator, 0)
        def expression(self):
            return self.getTypedRuleContext(StlParser.ExpressionContext,0)

        def interval(self):
            return self.getTypedRuleContext(StlParser.IntervalContext,0)


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


    class ExprRealContext(ExpressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.ExpressionContext)
            super(StlParser.ExprRealContext, self).__init__(parser)
            self.copyFrom(ctx)

        def real_expression(self):
            return self.getTypedRuleContext(StlParser.Real_expressionContext,0)


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


    class ExprUntilExprContext(ExpressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.ExpressionContext)
            super(StlParser.ExprUntilExprContext, self).__init__(parser)
            self.copyFrom(ctx)

        def expression(self, i=None):
            if i is None:
                return self.getTypedRuleContexts(StlParser.ExpressionContext)
            else:
                return self.getTypedRuleContext(StlParser.ExpressionContext,i)

        def UntilOperator(self):
            return self.getToken(StlParser.UntilOperator, 0)
        def interval(self):
            return self.getTypedRuleContext(StlParser.IntervalContext,0)


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


    class ExprEvExprContext(ExpressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.ExpressionContext)
            super(StlParser.ExprEvExprContext, self).__init__(parser)
            self.copyFrom(ctx)

        def EventuallyOperator(self):
            return self.getToken(StlParser.EventuallyOperator, 0)
        def interval(self):
            return self.getTypedRuleContext(StlParser.IntervalContext,0)

        def expression(self):
            return self.getTypedRuleContext(StlParser.ExpressionContext,0)


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


    class IdCompIntContext(ExpressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.ExpressionContext)
            super(StlParser.IdCompIntContext, self).__init__(parser)
            self.copyFrom(ctx)

        def expression(self, i=None):
            if i is None:
                return self.getTypedRuleContexts(StlParser.ExpressionContext)
            else:
                return self.getTypedRuleContext(StlParser.ExpressionContext,i)

        def comparisonOp(self):
            return self.getTypedRuleContext(StlParser.ComparisonOpContext,0)


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



    def expression(self, _p=0):
        _parentctx = self._ctx
        _parentState = self.state
        localctx = StlParser.ExpressionContext(self, self._ctx, _parentState)
        _prevctx = localctx
        _startState = 32
        self.enterRecursionRule(localctx, 32, self.RULE_expression, _p)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 163
            token = self._input.LA(1)
            if token in [StlParser.NotOperator]:
                localctx = StlParser.ExprNotContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx

                self.state = 128
                self.match(StlParser.NotOperator)
                self.state = 129
                self.expression(14)

            elif token in [StlParser.AlwaysOperator]:
                localctx = StlParser.ExprAlwaysExprContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 130
                self.match(StlParser.AlwaysOperator)
                self.state = 131
                self.interval()
                self.state = 132
                self.expression(8)

            elif token in [StlParser.EventuallyOperator]:
                localctx = StlParser.ExprEvExprContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 134
                self.match(StlParser.EventuallyOperator)
                self.state = 135
                self.interval()
                self.state = 136
                self.expression(7)

            elif token in [StlParser.HistoricallyOperator]:
                localctx = StlParser.ExprHistExprContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 138
                self.match(StlParser.HistoricallyOperator)
                self.state = 140
                _la = self._input.LA(1)
                if _la==StlParser.LBRACK:
                    self.state = 139
                    self.interval()


                self.state = 142
                self.expression(5)

            elif token in [StlParser.OnceOperator]:
                localctx = StlParser.ExpreOnceExprContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 143
                self.match(StlParser.OnceOperator)
                self.state = 145
                _la = self._input.LA(1)
                if _la==StlParser.LBRACK:
                    self.state = 144
                    self.interval()


                self.state = 147
                self.expression(4)

            elif token in [StlParser.MINUS, StlParser.ABS, StlParser.IntegerLiteral, StlParser.RealLiteral, StlParser.Identifier]:
                localctx = StlParser.ExprRealContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 148
                self.real_expression(0)

            elif token in [StlParser.LPAREN]:
                localctx = StlParser.ExprParenContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 149
                self.match(StlParser.LPAREN)
                self.state = 150
                self.expression(0)
                self.state = 151
                self.match(StlParser.RPAREN)

            elif token in [StlParser.RiseOperator]:
                localctx = StlParser.ExprRiseContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 153
                self.match(StlParser.RiseOperator)
                self.state = 154
                self.match(StlParser.LPAREN)
                self.state = 155
                self.expression(0)
                self.state = 156
                self.match(StlParser.RPAREN)

            elif token in [StlParser.FallOperator]:
                localctx = StlParser.ExprFallContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 158
                self.match(StlParser.FallOperator)
                self.state = 159
                self.match(StlParser.LPAREN)
                self.state = 160
                self.expression(0)
                self.state = 161
                self.match(StlParser.RPAREN)

            else:
                raise NoViableAltException(self)

            self._ctx.stop = self._input.LT(-1)
            self.state = 197
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,15,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 = 195
                    la_ = self._interp.adaptivePredict(self._input,14,self._ctx)
                    if la_ == 1:
                        localctx = StlParser.IdCompIntContext(self, StlParser.ExpressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
                        self.state = 165
                        if not self.precpred(self._ctx, 16):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 16)")
                        self.state = 166
                        self.comparisonOp()
                        self.state = 167
                        self.expression(17)
                        pass

                    elif la_ == 2:
                        localctx = StlParser.ExprOrExprContext(self, StlParser.ExpressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
                        self.state = 169
                        if not self.precpred(self._ctx, 13):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 13)")
                        self.state = 170
                        self.match(StlParser.OrOperator)
                        self.state = 171
                        self.expression(14)
                        pass

                    elif la_ == 3:
                        localctx = StlParser.ExprAndExprContext(self, StlParser.ExpressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
                        self.state = 172
                        if not self.precpred(self._ctx, 12):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 12)")
                        self.state = 173
                        self.match(StlParser.AndOperator)
                        self.state = 174
                        self.expression(13)
                        pass

                    elif la_ == 4:
                        localctx = StlParser.ExprImpliesExprContext(self, StlParser.ExpressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
                        self.state = 175
                        if not self.precpred(self._ctx, 11):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 11)")
                        self.state = 176
                        self.match(StlParser.ImpliesOperator)
                        self.state = 177
                        self.expression(12)
                        pass

                    elif la_ == 5:
                        localctx = StlParser.ExprIffExprContext(self, StlParser.ExpressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
                        self.state = 178
                        if not self.precpred(self._ctx, 10):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 10)")
                        self.state = 179
                        self.match(StlParser.IffOperator)
                        self.state = 180
                        self.expression(11)
                        pass

                    elif la_ == 6:
                        localctx = StlParser.ExprXorExprContext(self, StlParser.ExpressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
                        self.state = 181
                        if not self.precpred(self._ctx, 9):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 9)")
                        self.state = 182
                        self.match(StlParser.XorOperator)
                        self.state = 183
                        self.expression(10)
                        pass

                    elif la_ == 7:
                        localctx = StlParser.ExprUntilExprContext(self, StlParser.ExpressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
                        self.state = 184
                        if not self.precpred(self._ctx, 6):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 6)")
                        self.state = 185
                        self.match(StlParser.UntilOperator)
                        self.state = 186
                        self.interval()
                        self.state = 187
                        self.expression(7)
                        pass

                    elif la_ == 8:
                        localctx = StlParser.ExprSinceExprContext(self, StlParser.ExpressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
                        self.state = 189
                        if not self.precpred(self._ctx, 3):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 3)")
                        self.state = 190
                        self.match(StlParser.SinceOperator)
                        self.state = 192
                        _la = self._input.LA(1)
                        if _la==StlParser.LBRACK:
                            self.state = 191
                            self.interval()


                        self.state = 194
                        self.expression(4)
                        pass

             
                self.state = 199
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,15,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 Real_expressionContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return StlParser.RULE_real_expression

     
        def copyFrom(self, ctx):
            super(StlParser.Real_expressionContext, self).copyFrom(ctx)


    class ExprSubtractionContext(Real_expressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.Real_expressionContext)
            super(StlParser.ExprSubtractionContext, self).__init__(parser)
            self.copyFrom(ctx)

        def real_expression(self, i=None):
            if i is None:
                return self.getTypedRuleContexts(StlParser.Real_expressionContext)
            else:
                return self.getTypedRuleContext(StlParser.Real_expressionContext,i)

        def MINUS(self):
            return self.getToken(StlParser.MINUS, 0)

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


    class ExprDivisionContext(Real_expressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.Real_expressionContext)
            super(StlParser.ExprDivisionContext, self).__init__(parser)
            self.copyFrom(ctx)

        def real_expression(self, i=None):
            if i is None:
                return self.getTypedRuleContexts(StlParser.Real_expressionContext)
            else:
                return self.getTypedRuleContext(StlParser.Real_expressionContext,i)

        def DIVIDE(self):
            return self.getToken(StlParser.DIVIDE, 0)

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


    class ExprMultiplicationContext(Real_expressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.Real_expressionContext)
            super(StlParser.ExprMultiplicationContext, self).__init__(parser)
            self.copyFrom(ctx)

        def real_expression(self, i=None):
            if i is None:
                return self.getTypedRuleContexts(StlParser.Real_expressionContext)
            else:
                return self.getTypedRuleContext(StlParser.Real_expressionContext,i)

        def TIMES(self):
            return self.getToken(StlParser.TIMES, 0)

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


    class ExprLiteralContext(Real_expressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.Real_expressionContext)
            super(StlParser.ExprLiteralContext, self).__init__(parser)
            self.copyFrom(ctx)

        def literal(self):
            return self.getTypedRuleContext(StlParser.LiteralContext,0)


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


    class ExprIdContext(Real_expressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.Real_expressionContext)
            super(StlParser.ExprIdContext, self).__init__(parser)
            self.copyFrom(ctx)

        def Identifier(self):
            return self.getToken(StlParser.Identifier, 0)

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


    class ExprAbsContext(Real_expressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.Real_expressionContext)
            super(StlParser.ExprAbsContext, self).__init__(parser)
            self.copyFrom(ctx)

        def ABS(self):
            return self.getToken(StlParser.ABS, 0)
        def LPAREN(self):
            return self.getToken(StlParser.LPAREN, 0)
        def real_expression(self):
            return self.getTypedRuleContext(StlParser.Real_expressionContext,0)

        def RPAREN(self):
            return self.getToken(StlParser.RPAREN, 0)

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


    class ExprAdditionContext(Real_expressionContext):

        def __init__(self, parser, ctx): # actually a StlParser.Real_expressionContext)
            super(StlParser.ExprAdditionContext, self).__init__(parser)
            self.copyFrom(ctx)

        def real_expression(self, i=None):
            if i is None:
                return self.getTypedRuleContexts(StlParser.Real_expressionContext)
            else:
                return self.getTypedRuleContext(StlParser.Real_expressionContext,i)

        def PLUS(self):
            return self.getToken(StlParser.PLUS, 0)

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



    def real_expression(self, _p=0):
        _parentctx = self._ctx
        _parentState = self.state
        localctx = StlParser.Real_expressionContext(self, self._ctx, _parentState)
        _prevctx = localctx
        _startState = 34
        self.enterRecursionRule(localctx, 34, self.RULE_real_expression, _p)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 208
            token = self._input.LA(1)
            if token in [StlParser.Identifier]:
                localctx = StlParser.ExprIdContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx

                self.state = 201
                self.match(StlParser.Identifier)

            elif token in [StlParser.MINUS, StlParser.IntegerLiteral, StlParser.RealLiteral]:
                localctx = StlParser.ExprLiteralContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 202
                self.literal()

            elif token in [StlParser.ABS]:
                localctx = StlParser.ExprAbsContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 203
                self.match(StlParser.ABS)
                self.state = 204
                self.match(StlParser.LPAREN)
                self.state = 205
                self.real_expression(0)
                self.state = 206
                self.match(StlParser.RPAREN)

            else:
                raise NoViableAltException(self)

            self._ctx.stop = self._input.LT(-1)
            self.state = 224
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,18,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 = 222
                    la_ = self._interp.adaptivePredict(self._input,17,self._ctx)
                    if la_ == 1:
                        localctx = StlParser.ExprAdditionContext(self, StlParser.Real_expressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_real_expression)
                        self.state = 210
                        if not self.precpred(self._ctx, 5):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 5)")
                        self.state = 211
                        self.match(StlParser.PLUS)
                        self.state = 212
                        self.real_expression(6)
                        pass

                    elif la_ == 2:
                        localctx = StlParser.ExprSubtractionContext(self, StlParser.Real_expressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_real_expression)
                        self.state = 213
                        if not self.precpred(self._ctx, 4):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 4)")
                        self.state = 214
                        self.match(StlParser.MINUS)
                        self.state = 215
                        self.real_expression(5)
                        pass

                    elif la_ == 3:
                        localctx = StlParser.ExprMultiplicationContext(self, StlParser.Real_expressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_real_expression)
                        self.state = 216
                        if not self.precpred(self._ctx, 3):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 3)")
                        self.state = 217
                        self.match(StlParser.TIMES)
                        self.state = 218
                        self.real_expression(4)
                        pass

                    elif la_ == 4:
                        localctx = StlParser.ExprDivisionContext(self, StlParser.Real_expressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_real_expression)
                        self.state = 219
                        if not self.precpred(self._ctx, 2):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 2)")
                        self.state = 220
                        self.match(StlParser.DIVIDE)
                        self.state = 221
                        self.real_expression(3)
                        pass

             
                self.state = 226
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,18,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 ComparisonOpContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return StlParser.RULE_comparisonOp

     
        def copyFrom(self, ctx):
            super(StlParser.ComparisonOpContext, self).copyFrom(ctx)



    class CmpOpEqContext(ComparisonOpContext):

        def __init__(self, parser, ctx): # actually a StlParser.ComparisonOpContext)
            super(StlParser.CmpOpEqContext, self).__init__(parser)
            self.copyFrom(ctx)

        def EqualOperator(self):
            return self.getToken(StlParser.EqualOperator, 0)

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


    class CmpOpGteContext(ComparisonOpContext):

        def __init__(self, parser, ctx): # actually a StlParser.ComparisonOpContext)
            super(StlParser.CmpOpGteContext, self).__init__(parser)
            self.copyFrom(ctx)

        def GreaterOrEqualOperator(self):
            return self.getToken(StlParser.GreaterOrEqualOperator, 0)

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


    class CmpOpLseContext(ComparisonOpContext):

        def __init__(self, parser, ctx): # actually a StlParser.ComparisonOpContext)
            super(StlParser.CmpOpLseContext, self).__init__(parser)
            self.copyFrom(ctx)

        def LesserOperator(self):
            return self.getToken(StlParser.LesserOperator, 0)

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


    class CmpOpGtContext(ComparisonOpContext):

        def __init__(self, parser, ctx): # actually a StlParser.ComparisonOpContext)
            super(StlParser.CmpOpGtContext, self).__init__(parser)
            self.copyFrom(ctx)

        def GreaterOperator(self):
            return self.getToken(StlParser.GreaterOperator, 0)

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


    class ComOpNeqContext(ComparisonOpContext):

        def __init__(self, parser, ctx): # actually a StlParser.ComparisonOpContext)
            super(StlParser.ComOpNeqContext, self).__init__(parser)
            self.copyFrom(ctx)

        def NotEqualOperator(self):
            return self.getToken(StlParser.NotEqualOperator, 0)

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


    class CmpOpLsContext(ComparisonOpContext):

        def __init__(self, parser, ctx): # actually a StlParser.ComparisonOpContext)
            super(StlParser.CmpOpLsContext, self).__init__(parser)
            self.copyFrom(ctx)

        def LesserOrEqualOperator(self):
            return self.getToken(StlParser.LesserOrEqualOperator, 0)

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



    def comparisonOp(self):

        localctx = StlParser.ComparisonOpContext(self, self._ctx, self.state)
        self.enterRule(localctx, 36, self.RULE_comparisonOp)
        try:
            self.state = 233
            token = self._input.LA(1)
            if token in [StlParser.LesserOrEqualOperator]:
                localctx = StlParser.CmpOpLsContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 227
                self.match(StlParser.LesserOrEqualOperator)

            elif token in [StlParser.GreaterOrEqualOperator]:
                localctx = StlParser.CmpOpGteContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 228
                self.match(StlParser.GreaterOrEqualOperator)

            elif token in [StlParser.LesserOperator]:
                localctx = StlParser.CmpOpLseContext(self, localctx)
                self.enterOuterAlt(localctx, 3)
                self.state = 229
                self.match(StlParser.LesserOperator)

            elif token in [StlParser.GreaterOperator]:
                localctx = StlParser.CmpOpGtContext(self, localctx)
                self.enterOuterAlt(localctx, 4)
                self.state = 230
                self.match(StlParser.GreaterOperator)

            elif token in [StlParser.EqualOperator]:
                localctx = StlParser.CmpOpEqContext(self, localctx)
                self.enterOuterAlt(localctx, 5)
                self.state = 231
                self.match(StlParser.EqualOperator)

            elif token in [StlParser.NotEqualOperator]:
                localctx = StlParser.ComOpNeqContext(self, localctx)
                self.enterOuterAlt(localctx, 6)
                self.state = 232
                self.match(StlParser.NotEqualOperator)

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

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

        def IntegerLiteral(self):
            return self.getToken(StlParser.IntegerLiteral, 0)

        def RealLiteral(self):
            return self.getToken(StlParser.RealLiteral, 0)

        def MINUS(self):
            return self.getToken(StlParser.MINUS, 0)

        def literal(self):
            return self.getTypedRuleContext(StlParser.LiteralContext,0)


        def getRuleIndex(self):
            return StlParser.RULE_literal

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




    def literal(self):

        localctx = StlParser.LiteralContext(self, self._ctx, self.state)
        self.enterRule(localctx, 38, self.RULE_literal)
        try:
            self.state = 239
            token = self._input.LA(1)
            if token in [StlParser.IntegerLiteral]:
                self.enterOuterAlt(localctx, 1)
                self.state = 235
                self.match(StlParser.IntegerLiteral)

            elif token in [StlParser.RealLiteral]:
                self.enterOuterAlt(localctx, 2)
                self.state = 236
                self.match(StlParser.RealLiteral)

            elif token in [StlParser.MINUS]:
                self.enterOuterAlt(localctx, 3)
                self.state = 237
                self.match(StlParser.MINUS)
                self.state = 238
                self.literal()

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

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


        def getRuleIndex(self):
            return StlParser.RULE_identifier

     
        def copyFrom(self, ctx):
            super(StlParser.IdentifierContext, self).copyFrom(ctx)



    class IdContext(IdentifierContext):

        def __init__(self, parser, ctx): # actually a StlParser.IdentifierContext)
            super(StlParser.IdContext, self).__init__(parser)
            self.copyFrom(ctx)

        def Identifier(self):
            return self.getToken(StlParser.Identifier, 0)

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



    def identifier(self):

        localctx = StlParser.IdentifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 40, self.RULE_identifier)
        try:
            localctx = StlParser.IdContext(self, localctx)
            self.enterOuterAlt(localctx, 1)
            self.state = 241
            self.match(StlParser.Identifier)
        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, ruleIndex, predIndex):
        if self._predicates == None:
            self._predicates = dict()
        self._predicates[16] = self.expression_sempred
        self._predicates[17] = self.real_expression_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 expression_sempred(self, localctx, predIndex):
            if predIndex == 0:
                return self.precpred(self._ctx, 16)
         

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

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

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

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

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

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

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

    def real_expression_sempred(self, localctx, predIndex):
            if predIndex == 8:
                return self.precpred(self._ctx, 5)
         

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

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

            if predIndex == 11:
                return self.precpred(self._ctx, 2)
# Generated from StlParser.g4 by ANTLR 4.5.1 # encoding: utf-8 #\3\2\2\2\u00c9") # Token type # actually a StlParser.SpecContext) # actually a StlParser.ModimportContext) # actually a StlParser.DeclarationContext) # actually a StlParser.Annotation_typeContext) # Token type # actually a StlParser.AssignmentContext) # actually a StlParser.AssignmentContext) # Token type # Token type # actually a StlParser.IntervalTimeContext) # Token type # Token type # actually a StlParser.TopExpressionContext) # actually a StlParser.TopExpressionContext) # actually a StlParser.TopExpressionContext) # actually a StlParser.ExpressionContext) # actually a StlParser.ExpressionContext) # actually a StlParser.ExpressionContext) # actually a StlParser.ExpressionContext) # actually a StlParser.ExpressionContext) # actually a StlParser.ExpressionContext) # actually a StlParser.ExpressionContext) # actually a StlParser.ExpressionContext) # actually a StlParser.ExpressionContext) # actually a StlParser.ExpressionContext) # actually a StlParser.ExpressionContext) # actually a StlParser.ExpressionContext) # actually a StlParser.ExpressionContext) # actually a StlParser.ExpressionContext) # actually a StlParser.ExpressionContext) # actually a StlParser.ExpressionContext) # actually a StlParser.ExpressionContext) # Token type # actually a StlParser.Real_expressionContext) # actually a StlParser.Real_expressionContext) # actually a StlParser.Real_expressionContext) # actually a StlParser.Real_expressionContext) # actually a StlParser.Real_expressionContext) # actually a StlParser.Real_expressionContext) # actually a StlParser.Real_expressionContext) # actually a StlParser.ComparisonOpContext) # actually a StlParser.ComparisonOpContext) # actually a StlParser.ComparisonOpContext) # actually a StlParser.ComparisonOpContext) # actually a StlParser.ComparisonOpContext) # actually a StlParser.ComparisonOpContext) # actually a StlParser.IdentifierContext)