# Generated from ILATsm.g4 by ANTLR 4.13.1
# encoding: utf-8
from antlr4 import *
from io import StringIO
import sys

if sys.version_info[1] > 5:
    from typing import TextIO
else:
    from typing.io import TextIO


# Copyright (C) 2022, Xilinx, Inc.
# Copyright (C) 2022-2023, Advanced Micro Devices, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


def serializedATN():
    return [
        4,
        1,
        31,
        149,
        2,
        0,
        7,
        0,
        2,
        1,
        7,
        1,
        2,
        2,
        7,
        2,
        2,
        3,
        7,
        3,
        2,
        4,
        7,
        4,
        2,
        5,
        7,
        5,
        2,
        6,
        7,
        6,
        2,
        7,
        7,
        7,
        2,
        8,
        7,
        8,
        2,
        9,
        7,
        9,
        2,
        10,
        7,
        10,
        1,
        0,
        4,
        0,
        24,
        8,
        0,
        11,
        0,
        12,
        0,
        25,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        3,
        1,
        36,
        8,
        1,
        1,
        2,
        1,
        2,
        1,
        2,
        1,
        2,
        1,
        2,
        1,
        2,
        1,
        2,
        1,
        2,
        1,
        2,
        1,
        2,
        1,
        2,
        1,
        2,
        1,
        2,
        1,
        2,
        1,
        2,
        1,
        2,
        1,
        2,
        1,
        2,
        1,
        2,
        1,
        2,
        1,
        2,
        1,
        2,
        1,
        2,
        1,
        2,
        1,
        2,
        1,
        2,
        1,
        2,
        1,
        2,
        1,
        2,
        1,
        2,
        1,
        2,
        1,
        2,
        1,
        2,
        1,
        2,
        1,
        2,
        1,
        2,
        3,
        2,
        74,
        8,
        2,
        1,
        3,
        4,
        3,
        77,
        8,
        3,
        11,
        3,
        12,
        3,
        78,
        1,
        4,
        1,
        4,
        1,
        4,
        1,
        4,
        1,
        5,
        1,
        5,
        1,
        5,
        1,
        5,
        1,
        5,
        1,
        5,
        1,
        5,
        3,
        5,
        92,
        8,
        5,
        1,
        5,
        1,
        5,
        1,
        5,
        5,
        5,
        97,
        8,
        5,
        10,
        5,
        12,
        5,
        100,
        9,
        5,
        1,
        6,
        1,
        6,
        1,
        6,
        1,
        6,
        1,
        6,
        1,
        6,
        1,
        6,
        3,
        6,
        109,
        8,
        6,
        1,
        7,
        1,
        7,
        1,
        7,
        1,
        7,
        1,
        7,
        1,
        7,
        1,
        7,
        3,
        7,
        118,
        8,
        7,
        1,
        8,
        1,
        8,
        1,
        8,
        1,
        8,
        1,
        8,
        1,
        8,
        1,
        8,
        1,
        8,
        1,
        8,
        1,
        8,
        1,
        8,
        1,
        8,
        1,
        8,
        1,
        8,
        1,
        8,
        1,
        8,
        1,
        8,
        3,
        8,
        137,
        8,
        8,
        1,
        9,
        1,
        9,
        1,
        9,
        3,
        9,
        142,
        8,
        9,
        1,
        10,
        1,
        10,
        1,
        10,
        3,
        10,
        147,
        8,
        10,
        1,
        10,
        0,
        1,
        10,
        11,
        0,
        2,
        4,
        6,
        8,
        10,
        12,
        14,
        16,
        18,
        20,
        0,
        0,
        157,
        0,
        23,
        1,
        0,
        0,
        0,
        2,
        35,
        1,
        0,
        0,
        0,
        4,
        73,
        1,
        0,
        0,
        0,
        6,
        76,
        1,
        0,
        0,
        0,
        8,
        80,
        1,
        0,
        0,
        0,
        10,
        91,
        1,
        0,
        0,
        0,
        12,
        108,
        1,
        0,
        0,
        0,
        14,
        117,
        1,
        0,
        0,
        0,
        16,
        136,
        1,
        0,
        0,
        0,
        18,
        141,
        1,
        0,
        0,
        0,
        20,
        146,
        1,
        0,
        0,
        0,
        22,
        24,
        3,
        2,
        1,
        0,
        23,
        22,
        1,
        0,
        0,
        0,
        24,
        25,
        1,
        0,
        0,
        0,
        25,
        23,
        1,
        0,
        0,
        0,
        25,
        26,
        1,
        0,
        0,
        0,
        26,
        1,
        1,
        0,
        0,
        0,
        27,
        28,
        5,
        16,
        0,
        0,
        28,
        29,
        5,
        27,
        0,
        0,
        29,
        30,
        5,
        1,
        0,
        0,
        30,
        36,
        3,
        4,
        2,
        0,
        31,
        32,
        5,
        16,
        0,
        0,
        32,
        33,
        5,
        27,
        0,
        0,
        33,
        34,
        5,
        1,
        0,
        0,
        34,
        36,
        3,
        6,
        3,
        0,
        35,
        27,
        1,
        0,
        0,
        0,
        35,
        31,
        1,
        0,
        0,
        0,
        36,
        3,
        1,
        0,
        0,
        0,
        37,
        38,
        5,
        12,
        0,
        0,
        38,
        39,
        3,
        8,
        4,
        0,
        39,
        40,
        5,
        17,
        0,
        0,
        40,
        41,
        3,
        6,
        3,
        0,
        41,
        42,
        5,
        9,
        0,
        0,
        42,
        43,
        3,
        8,
        4,
        0,
        43,
        44,
        5,
        17,
        0,
        0,
        44,
        45,
        3,
        6,
        3,
        0,
        45,
        46,
        5,
        8,
        0,
        0,
        46,
        47,
        3,
        6,
        3,
        0,
        47,
        48,
        5,
        10,
        0,
        0,
        48,
        74,
        1,
        0,
        0,
        0,
        49,
        50,
        5,
        12,
        0,
        0,
        50,
        51,
        3,
        8,
        4,
        0,
        51,
        52,
        5,
        17,
        0,
        0,
        52,
        53,
        3,
        6,
        3,
        0,
        53,
        54,
        5,
        9,
        0,
        0,
        54,
        55,
        3,
        8,
        4,
        0,
        55,
        56,
        5,
        17,
        0,
        0,
        56,
        57,
        3,
        6,
        3,
        0,
        57,
        58,
        5,
        10,
        0,
        0,
        58,
        74,
        1,
        0,
        0,
        0,
        59,
        60,
        5,
        12,
        0,
        0,
        60,
        61,
        3,
        8,
        4,
        0,
        61,
        62,
        5,
        17,
        0,
        0,
        62,
        63,
        3,
        6,
        3,
        0,
        63,
        64,
        5,
        8,
        0,
        0,
        64,
        65,
        3,
        6,
        3,
        0,
        65,
        66,
        5,
        10,
        0,
        0,
        66,
        74,
        1,
        0,
        0,
        0,
        67,
        68,
        5,
        12,
        0,
        0,
        68,
        69,
        3,
        8,
        4,
        0,
        69,
        70,
        5,
        17,
        0,
        0,
        70,
        71,
        3,
        6,
        3,
        0,
        71,
        72,
        5,
        10,
        0,
        0,
        72,
        74,
        1,
        0,
        0,
        0,
        73,
        37,
        1,
        0,
        0,
        0,
        73,
        49,
        1,
        0,
        0,
        0,
        73,
        59,
        1,
        0,
        0,
        0,
        73,
        67,
        1,
        0,
        0,
        0,
        74,
        5,
        1,
        0,
        0,
        0,
        75,
        77,
        3,
        16,
        8,
        0,
        76,
        75,
        1,
        0,
        0,
        0,
        77,
        78,
        1,
        0,
        0,
        0,
        78,
        76,
        1,
        0,
        0,
        0,
        78,
        79,
        1,
        0,
        0,
        0,
        79,
        7,
        1,
        0,
        0,
        0,
        80,
        81,
        5,
        2,
        0,
        0,
        81,
        82,
        3,
        10,
        5,
        0,
        82,
        83,
        5,
        3,
        0,
        0,
        83,
        9,
        1,
        0,
        0,
        0,
        84,
        85,
        6,
        5,
        -1,
        0,
        85,
        92,
        3,
        12,
        6,
        0,
        86,
        92,
        3,
        14,
        7,
        0,
        87,
        88,
        5,
        2,
        0,
        0,
        88,
        89,
        3,
        10,
        5,
        0,
        89,
        90,
        5,
        3,
        0,
        0,
        90,
        92,
        1,
        0,
        0,
        0,
        91,
        84,
        1,
        0,
        0,
        0,
        91,
        86,
        1,
        0,
        0,
        0,
        91,
        87,
        1,
        0,
        0,
        0,
        92,
        98,
        1,
        0,
        0,
        0,
        93,
        94,
        10,
        4,
        0,
        0,
        94,
        95,
        5,
        5,
        0,
        0,
        95,
        97,
        3,
        10,
        5,
        5,
        96,
        93,
        1,
        0,
        0,
        0,
        97,
        100,
        1,
        0,
        0,
        0,
        98,
        96,
        1,
        0,
        0,
        0,
        98,
        99,
        1,
        0,
        0,
        0,
        99,
        11,
        1,
        0,
        0,
        0,
        100,
        98,
        1,
        0,
        0,
        0,
        101,
        102,
        5,
        27,
        0,
        0,
        102,
        103,
        5,
        6,
        0,
        0,
        103,
        109,
        3,
        18,
        9,
        0,
        104,
        105,
        3,
        18,
        9,
        0,
        105,
        106,
        5,
        6,
        0,
        0,
        106,
        107,
        5,
        27,
        0,
        0,
        107,
        109,
        1,
        0,
        0,
        0,
        108,
        101,
        1,
        0,
        0,
        0,
        108,
        104,
        1,
        0,
        0,
        0,
        109,
        13,
        1,
        0,
        0,
        0,
        110,
        111,
        5,
        25,
        0,
        0,
        111,
        112,
        5,
        6,
        0,
        0,
        112,
        118,
        3,
        20,
        10,
        0,
        113,
        114,
        3,
        20,
        10,
        0,
        114,
        115,
        5,
        6,
        0,
        0,
        115,
        116,
        5,
        25,
        0,
        0,
        116,
        118,
        1,
        0,
        0,
        0,
        117,
        110,
        1,
        0,
        0,
        0,
        117,
        113,
        1,
        0,
        0,
        0,
        118,
        15,
        1,
        0,
        0,
        0,
        119,
        120,
        5,
        7,
        0,
        0,
        120,
        121,
        5,
        26,
        0,
        0,
        121,
        137,
        5,
        4,
        0,
        0,
        122,
        123,
        5,
        15,
        0,
        0,
        123,
        124,
        5,
        26,
        0,
        0,
        124,
        137,
        5,
        4,
        0,
        0,
        125,
        126,
        5,
        13,
        0,
        0,
        126,
        127,
        5,
        25,
        0,
        0,
        127,
        137,
        5,
        4,
        0,
        0,
        128,
        129,
        5,
        14,
        0,
        0,
        129,
        130,
        5,
        25,
        0,
        0,
        130,
        137,
        5,
        4,
        0,
        0,
        131,
        132,
        5,
        11,
        0,
        0,
        132,
        133,
        5,
        27,
        0,
        0,
        133,
        137,
        5,
        4,
        0,
        0,
        134,
        135,
        5,
        18,
        0,
        0,
        135,
        137,
        5,
        4,
        0,
        0,
        136,
        119,
        1,
        0,
        0,
        0,
        136,
        122,
        1,
        0,
        0,
        0,
        136,
        125,
        1,
        0,
        0,
        0,
        136,
        128,
        1,
        0,
        0,
        0,
        136,
        131,
        1,
        0,
        0,
        0,
        136,
        134,
        1,
        0,
        0,
        0,
        137,
        17,
        1,
        0,
        0,
        0,
        138,
        142,
        3,
        20,
        10,
        0,
        139,
        142,
        5,
        22,
        0,
        0,
        140,
        142,
        5,
        23,
        0,
        0,
        141,
        138,
        1,
        0,
        0,
        0,
        141,
        139,
        1,
        0,
        0,
        0,
        141,
        140,
        1,
        0,
        0,
        0,
        142,
        19,
        1,
        0,
        0,
        0,
        143,
        147,
        5,
        19,
        0,
        0,
        144,
        147,
        5,
        20,
        0,
        0,
        145,
        147,
        5,
        21,
        0,
        0,
        146,
        143,
        1,
        0,
        0,
        0,
        146,
        144,
        1,
        0,
        0,
        0,
        146,
        145,
        1,
        0,
        0,
        0,
        147,
        21,
        1,
        0,
        0,
        0,
        11,
        25,
        35,
        73,
        78,
        91,
        98,
        108,
        117,
        136,
        141,
        146,
    ]


class ILATsmParser(Parser):
    grammarFileName = "ILATsm.g4"

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

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

    sharedContextCache = PredictionContextCache()

    literalNames = ["<INVALID>", "':'", "'('", "')'", "';'"]

    symbolicNames = [
        "<INVALID>",
        "<INVALID>",
        "<INVALID>",
        "<INVALID>",
        "<INVALID>",
        "LOGIC_OP",
        "COMPARE_OP",
        "CLEAR_FLAG",
        "ELSE",
        "ELSEIF",
        "ENDIF",
        "GOTO",
        "IF",
        "INCREMENT_COUNTER",
        "RESET_COUNTER",
        "SET_FLAG",
        "STATE",
        "THEN",
        "TRIGGER",
        "INTEGER_VAL",
        "HEX_VAL",
        "BINARY_VAL",
        "ENUM_VAL",
        "ENUM_STRING_VAL",
        "LINE_COMMENT",
        "COUNTER_NAME",
        "FLAG_NAME",
        "IDENTIFIER",
        "PROBE_BUS_RANGE",
        "TRUE",
        "FALSE",
        "WS",
    ]

    RULE_ila_tsm = 0
    RULE_state_block = 1
    RULE_if_condition = 2
    RULE_actions = 3
    RULE_full_condition = 4
    RULE_condition = 5
    RULE_probe_match = 6
    RULE_counter_match = 7
    RULE_action = 8
    RULE_probe_number = 9
    RULE_number = 10

    ruleNames = [
        "ila_tsm",
        "state_block",
        "if_condition",
        "actions",
        "full_condition",
        "condition",
        "probe_match",
        "counter_match",
        "action",
        "probe_number",
        "number",
    ]

    EOF = Token.EOF
    T__0 = 1
    T__1 = 2
    T__2 = 3
    T__3 = 4
    LOGIC_OP = 5
    COMPARE_OP = 6
    CLEAR_FLAG = 7
    ELSE = 8
    ELSEIF = 9
    ENDIF = 10
    GOTO = 11
    IF = 12
    INCREMENT_COUNTER = 13
    RESET_COUNTER = 14
    SET_FLAG = 15
    STATE = 16
    THEN = 17
    TRIGGER = 18
    INTEGER_VAL = 19
    HEX_VAL = 20
    BINARY_VAL = 21
    ENUM_VAL = 22
    ENUM_STRING_VAL = 23
    LINE_COMMENT = 24
    COUNTER_NAME = 25
    FLAG_NAME = 26
    IDENTIFIER = 27
    PROBE_BUS_RANGE = 28
    TRUE = 29
    FALSE = 30
    WS = 31

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

    class Ila_tsmContext(ParserRuleContext):
        __slots__ = "parser"

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

        def state_block(self, i: int = None):
            if i is None:
                return self.getTypedRuleContexts(ILATsmParser.State_blockContext)
            else:
                return self.getTypedRuleContext(ILATsmParser.State_blockContext, i)

        def getRuleIndex(self):
            return ILATsmParser.RULE_ila_tsm

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

    def ila_tsm(self):
        localctx = ILATsmParser.Ila_tsmContext(self, self._ctx, self.state)
        self.enterRule(localctx, 0, self.RULE_ila_tsm)
        self._la = 0  # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 23
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 22
                self.state_block()
                self.state = 25
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not (_la == 16):
                    break

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

    class State_blockContext(ParserRuleContext):
        __slots__ = "parser"

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

        def getRuleIndex(self):
            return ILATsmParser.RULE_state_block

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

    class State_no_ifContext(State_blockContext):
        def __init__(
            self, parser, ctx: ParserRuleContext
        ):  # actually a ILATsmParser.State_blockContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def STATE(self):
            return self.getToken(ILATsmParser.STATE, 0)

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

        def actions(self):
            return self.getTypedRuleContext(ILATsmParser.ActionsContext, 0)

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

    class State_ifContext(State_blockContext):
        def __init__(
            self, parser, ctx: ParserRuleContext
        ):  # actually a ILATsmParser.State_blockContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def STATE(self):
            return self.getToken(ILATsmParser.STATE, 0)

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

        def if_condition(self):
            return self.getTypedRuleContext(ILATsmParser.If_conditionContext, 0)

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

    def state_block(self):
        localctx = ILATsmParser.State_blockContext(self, self._ctx, self.state)
        self.enterRule(localctx, 2, self.RULE_state_block)
        try:
            self.state = 35
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input, 1, self._ctx)
            if la_ == 1:
                localctx = ILATsmParser.State_ifContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 27
                self.match(ILATsmParser.STATE)
                self.state = 28
                self.match(ILATsmParser.IDENTIFIER)
                self.state = 29
                self.match(ILATsmParser.T__0)
                self.state = 30
                self.if_condition()
                pass

            elif la_ == 2:
                localctx = ILATsmParser.State_no_ifContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 31
                self.match(ILATsmParser.STATE)
                self.state = 32
                self.match(ILATsmParser.IDENTIFIER)
                self.state = 33
                self.match(ILATsmParser.T__0)
                self.state = 34
                self.actions()
                pass

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

    class If_conditionContext(ParserRuleContext):
        __slots__ = "parser"

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

        def IF(self):
            return self.getToken(ILATsmParser.IF, 0)

        def full_condition(self, i: int = None):
            if i is None:
                return self.getTypedRuleContexts(ILATsmParser.Full_conditionContext)
            else:
                return self.getTypedRuleContext(ILATsmParser.Full_conditionContext, i)

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

        def actions(self, i: int = None):
            if i is None:
                return self.getTypedRuleContexts(ILATsmParser.ActionsContext)
            else:
                return self.getTypedRuleContext(ILATsmParser.ActionsContext, i)

        def ELSEIF(self):
            return self.getToken(ILATsmParser.ELSEIF, 0)

        def ELSE(self):
            return self.getToken(ILATsmParser.ELSE, 0)

        def ENDIF(self):
            return self.getToken(ILATsmParser.ENDIF, 0)

        def getRuleIndex(self):
            return ILATsmParser.RULE_if_condition

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

    def if_condition(self):
        localctx = ILATsmParser.If_conditionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 4, self.RULE_if_condition)
        try:
            self.state = 73
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input, 2, self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 37
                self.match(ILATsmParser.IF)
                self.state = 38
                self.full_condition()
                self.state = 39
                self.match(ILATsmParser.THEN)
                self.state = 40
                self.actions()
                self.state = 41
                self.match(ILATsmParser.ELSEIF)
                self.state = 42
                self.full_condition()
                self.state = 43
                self.match(ILATsmParser.THEN)
                self.state = 44
                self.actions()
                self.state = 45
                self.match(ILATsmParser.ELSE)
                self.state = 46
                self.actions()
                self.state = 47
                self.match(ILATsmParser.ENDIF)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 49
                self.match(ILATsmParser.IF)
                self.state = 50
                self.full_condition()
                self.state = 51
                self.match(ILATsmParser.THEN)
                self.state = 52
                self.actions()
                self.state = 53
                self.match(ILATsmParser.ELSEIF)
                self.state = 54
                self.full_condition()
                self.state = 55
                self.match(ILATsmParser.THEN)
                self.state = 56
                self.actions()
                self.state = 57
                self.match(ILATsmParser.ENDIF)
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 59
                self.match(ILATsmParser.IF)
                self.state = 60
                self.full_condition()
                self.state = 61
                self.match(ILATsmParser.THEN)
                self.state = 62
                self.actions()
                self.state = 63
                self.match(ILATsmParser.ELSE)
                self.state = 64
                self.actions()
                self.state = 65
                self.match(ILATsmParser.ENDIF)
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 67
                self.match(ILATsmParser.IF)
                self.state = 68
                self.full_condition()
                self.state = 69
                self.match(ILATsmParser.THEN)
                self.state = 70
                self.actions()
                self.state = 71
                self.match(ILATsmParser.ENDIF)
                pass

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

    class ActionsContext(ParserRuleContext):
        __slots__ = "parser"

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

        def action(self, i: int = None):
            if i is None:
                return self.getTypedRuleContexts(ILATsmParser.ActionContext)
            else:
                return self.getTypedRuleContext(ILATsmParser.ActionContext, i)

        def getRuleIndex(self):
            return ILATsmParser.RULE_actions

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

    def actions(self):
        localctx = ILATsmParser.ActionsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 6, self.RULE_actions)
        self._la = 0  # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 76
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 75
                self.action()
                self.state = 78
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not ((((_la) & ~0x3F) == 0 and ((1 << _la) & 321664) != 0)):
                    break

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

    class Full_conditionContext(ParserRuleContext):
        __slots__ = "parser"

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

        def condition(self):
            return self.getTypedRuleContext(ILATsmParser.ConditionContext, 0)

        def getRuleIndex(self):
            return ILATsmParser.RULE_full_condition

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

    def full_condition(self):
        localctx = ILATsmParser.Full_conditionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 8, self.RULE_full_condition)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 80
            self.match(ILATsmParser.T__1)
            self.state = 81
            self.condition(0)
            self.state = 82
            self.match(ILATsmParser.T__2)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class ConditionContext(ParserRuleContext):
        __slots__ = "parser"

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

        def getRuleIndex(self):
            return ILATsmParser.RULE_condition

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

    class Condition_counter_matchContext(ConditionContext):
        def __init__(
            self, parser, ctx: ParserRuleContext
        ):  # actually a ILATsmParser.ConditionContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def counter_match(self):
            return self.getTypedRuleContext(ILATsmParser.Counter_matchContext, 0)

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

    class Condition_parenContext(ConditionContext):
        def __init__(
            self, parser, ctx: ParserRuleContext
        ):  # actually a ILATsmParser.ConditionContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def condition(self):
            return self.getTypedRuleContext(ILATsmParser.ConditionContext, 0)

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

    class Condition_logic_opContext(ConditionContext):
        def __init__(
            self, parser, ctx: ParserRuleContext
        ):  # actually a ILATsmParser.ConditionContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def condition(self, i: int = None):
            if i is None:
                return self.getTypedRuleContexts(ILATsmParser.ConditionContext)
            else:
                return self.getTypedRuleContext(ILATsmParser.ConditionContext, i)

        def LOGIC_OP(self):
            return self.getToken(ILATsmParser.LOGIC_OP, 0)

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

    class Condition_probe_matchContext(ConditionContext):
        def __init__(
            self, parser, ctx: ParserRuleContext
        ):  # actually a ILATsmParser.ConditionContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def probe_match(self):
            return self.getTypedRuleContext(ILATsmParser.Probe_matchContext, 0)

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

    def condition(self, _p: int = 0):
        _parentctx = self._ctx
        _parentState = self.state
        localctx = ILATsmParser.ConditionContext(self, self._ctx, _parentState)
        _prevctx = localctx
        _startState = 10
        self.enterRecursionRule(localctx, 10, self.RULE_condition, _p)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 91
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input, 4, self._ctx)
            if la_ == 1:
                localctx = ILATsmParser.Condition_probe_matchContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx

                self.state = 85
                self.probe_match()
                pass

            elif la_ == 2:
                localctx = ILATsmParser.Condition_counter_matchContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 86
                self.counter_match()
                pass

            elif la_ == 3:
                localctx = ILATsmParser.Condition_parenContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 87
                self.match(ILATsmParser.T__1)
                self.state = 88
                self.condition(0)
                self.state = 89
                self.match(ILATsmParser.T__2)
                pass

            self._ctx.stop = self._input.LT(-1)
            self.state = 98
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input, 5, self._ctx)
            while _alt != 2 and _alt != ATN.INVALID_ALT_NUMBER:
                if _alt == 1:
                    if self._parseListeners is not None:
                        self.triggerExitRuleEvent()
                    _prevctx = localctx
                    localctx = ILATsmParser.Condition_logic_opContext(
                        self, ILATsmParser.ConditionContext(self, _parentctx, _parentState)
                    )
                    self.pushNewRecursionContext(localctx, _startState, self.RULE_condition)
                    self.state = 93
                    if not self.precpred(self._ctx, 4):
                        from antlr4.error.Errors import FailedPredicateException

                        raise FailedPredicateException(self, "self.precpred(self._ctx, 4)")
                    self.state = 94
                    self.match(ILATsmParser.LOGIC_OP)
                    self.state = 95
                    self.condition(5)
                self.state = 100
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input, 5, 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 Probe_matchContext(ParserRuleContext):
        __slots__ = "parser"

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

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

        def COMPARE_OP(self):
            return self.getToken(ILATsmParser.COMPARE_OP, 0)

        def probe_number(self):
            return self.getTypedRuleContext(ILATsmParser.Probe_numberContext, 0)

        def getRuleIndex(self):
            return ILATsmParser.RULE_probe_match

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

    def probe_match(self):
        localctx = ILATsmParser.Probe_matchContext(self, self._ctx, self.state)
        self.enterRule(localctx, 12, self.RULE_probe_match)
        try:
            self.state = 108
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [27]:
                self.enterOuterAlt(localctx, 1)
                self.state = 101
                self.match(ILATsmParser.IDENTIFIER)
                self.state = 102
                self.match(ILATsmParser.COMPARE_OP)
                self.state = 103
                self.probe_number()
                pass
            elif token in [19, 20, 21, 22, 23]:
                self.enterOuterAlt(localctx, 2)
                self.state = 104
                self.probe_number()
                self.state = 105
                self.match(ILATsmParser.COMPARE_OP)
                self.state = 106
                self.match(ILATsmParser.IDENTIFIER)
                pass
            else:
                raise NoViableAltException(self)

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

    class Counter_matchContext(ParserRuleContext):
        __slots__ = "parser"

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

        def COUNTER_NAME(self):
            return self.getToken(ILATsmParser.COUNTER_NAME, 0)

        def COMPARE_OP(self):
            return self.getToken(ILATsmParser.COMPARE_OP, 0)

        def number(self):
            return self.getTypedRuleContext(ILATsmParser.NumberContext, 0)

        def getRuleIndex(self):
            return ILATsmParser.RULE_counter_match

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

    def counter_match(self):
        localctx = ILATsmParser.Counter_matchContext(self, self._ctx, self.state)
        self.enterRule(localctx, 14, self.RULE_counter_match)
        try:
            self.state = 117
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [25]:
                self.enterOuterAlt(localctx, 1)
                self.state = 110
                self.match(ILATsmParser.COUNTER_NAME)
                self.state = 111
                self.match(ILATsmParser.COMPARE_OP)
                self.state = 112
                self.number()
                pass
            elif token in [19, 20, 21]:
                self.enterOuterAlt(localctx, 2)
                self.state = 113
                self.number()
                self.state = 114
                self.match(ILATsmParser.COMPARE_OP)
                self.state = 115
                self.match(ILATsmParser.COUNTER_NAME)
                pass
            else:
                raise NoViableAltException(self)

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

    class ActionContext(ParserRuleContext):
        __slots__ = "parser"

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

        def getRuleIndex(self):
            return ILATsmParser.RULE_action

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

    class Action_set_flagContext(ActionContext):
        def __init__(self, parser, ctx: ParserRuleContext):  # actually a ILATsmParser.ActionContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def SET_FLAG(self):
            return self.getToken(ILATsmParser.SET_FLAG, 0)

        def FLAG_NAME(self):
            return self.getToken(ILATsmParser.FLAG_NAME, 0)

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

    class Action_reset_counterContext(ActionContext):
        def __init__(self, parser, ctx: ParserRuleContext):  # actually a ILATsmParser.ActionContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def RESET_COUNTER(self):
            return self.getToken(ILATsmParser.RESET_COUNTER, 0)

        def COUNTER_NAME(self):
            return self.getToken(ILATsmParser.COUNTER_NAME, 0)

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

    class Action_gotoContext(ActionContext):
        def __init__(self, parser, ctx: ParserRuleContext):  # actually a ILATsmParser.ActionContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def GOTO(self):
            return self.getToken(ILATsmParser.GOTO, 0)

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

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

    class Action_triggerContext(ActionContext):
        def __init__(self, parser, ctx: ParserRuleContext):  # actually a ILATsmParser.ActionContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def TRIGGER(self):
            return self.getToken(ILATsmParser.TRIGGER, 0)

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

    class Action_inc_counterContext(ActionContext):
        def __init__(self, parser, ctx: ParserRuleContext):  # actually a ILATsmParser.ActionContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def INCREMENT_COUNTER(self):
            return self.getToken(ILATsmParser.INCREMENT_COUNTER, 0)

        def COUNTER_NAME(self):
            return self.getToken(ILATsmParser.COUNTER_NAME, 0)

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

    class Action_clear_flagContext(ActionContext):
        def __init__(self, parser, ctx: ParserRuleContext):  # actually a ILATsmParser.ActionContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def CLEAR_FLAG(self):
            return self.getToken(ILATsmParser.CLEAR_FLAG, 0)

        def FLAG_NAME(self):
            return self.getToken(ILATsmParser.FLAG_NAME, 0)

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

    def action(self):
        localctx = ILATsmParser.ActionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 16, self.RULE_action)
        try:
            self.state = 136
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [7]:
                localctx = ILATsmParser.Action_clear_flagContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 119
                self.match(ILATsmParser.CLEAR_FLAG)
                self.state = 120
                self.match(ILATsmParser.FLAG_NAME)
                self.state = 121
                self.match(ILATsmParser.T__3)
                pass
            elif token in [15]:
                localctx = ILATsmParser.Action_set_flagContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 122
                self.match(ILATsmParser.SET_FLAG)
                self.state = 123
                self.match(ILATsmParser.FLAG_NAME)
                self.state = 124
                self.match(ILATsmParser.T__3)
                pass
            elif token in [13]:
                localctx = ILATsmParser.Action_inc_counterContext(self, localctx)
                self.enterOuterAlt(localctx, 3)
                self.state = 125
                self.match(ILATsmParser.INCREMENT_COUNTER)
                self.state = 126
                self.match(ILATsmParser.COUNTER_NAME)
                self.state = 127
                self.match(ILATsmParser.T__3)
                pass
            elif token in [14]:
                localctx = ILATsmParser.Action_reset_counterContext(self, localctx)
                self.enterOuterAlt(localctx, 4)
                self.state = 128
                self.match(ILATsmParser.RESET_COUNTER)
                self.state = 129
                self.match(ILATsmParser.COUNTER_NAME)
                self.state = 130
                self.match(ILATsmParser.T__3)
                pass
            elif token in [11]:
                localctx = ILATsmParser.Action_gotoContext(self, localctx)
                self.enterOuterAlt(localctx, 5)
                self.state = 131
                self.match(ILATsmParser.GOTO)
                self.state = 132
                self.match(ILATsmParser.IDENTIFIER)
                self.state = 133
                self.match(ILATsmParser.T__3)
                pass
            elif token in [18]:
                localctx = ILATsmParser.Action_triggerContext(self, localctx)
                self.enterOuterAlt(localctx, 6)
                self.state = 134
                self.match(ILATsmParser.TRIGGER)
                self.state = 135
                self.match(ILATsmParser.T__3)
                pass
            else:
                raise NoViableAltException(self)

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

    class Probe_numberContext(ParserRuleContext):
        __slots__ = "parser"

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

        def getRuleIndex(self):
            return ILATsmParser.RULE_probe_number

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

    class Enum_string_valContext(Probe_numberContext):
        def __init__(
            self, parser, ctx: ParserRuleContext
        ):  # actually a ILATsmParser.Probe_numberContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def ENUM_STRING_VAL(self):
            return self.getToken(ILATsmParser.ENUM_STRING_VAL, 0)

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

    class Probe_valContext(Probe_numberContext):
        def __init__(
            self, parser, ctx: ParserRuleContext
        ):  # actually a ILATsmParser.Probe_numberContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def number(self):
            return self.getTypedRuleContext(ILATsmParser.NumberContext, 0)

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

    class Enum_valContext(Probe_numberContext):
        def __init__(
            self, parser, ctx: ParserRuleContext
        ):  # actually a ILATsmParser.Probe_numberContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def ENUM_VAL(self):
            return self.getToken(ILATsmParser.ENUM_VAL, 0)

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

    def probe_number(self):
        localctx = ILATsmParser.Probe_numberContext(self, self._ctx, self.state)
        self.enterRule(localctx, 18, self.RULE_probe_number)
        try:
            self.state = 141
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [19, 20, 21]:
                localctx = ILATsmParser.Probe_valContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 138
                self.number()
                pass
            elif token in [22]:
                localctx = ILATsmParser.Enum_valContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 139
                self.match(ILATsmParser.ENUM_VAL)
                pass
            elif token in [23]:
                localctx = ILATsmParser.Enum_string_valContext(self, localctx)
                self.enterOuterAlt(localctx, 3)
                self.state = 140
                self.match(ILATsmParser.ENUM_STRING_VAL)
                pass
            else:
                raise NoViableAltException(self)

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

    class NumberContext(ParserRuleContext):
        __slots__ = "parser"

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

        def getRuleIndex(self):
            return ILATsmParser.RULE_number

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

    class Int_valContext(NumberContext):
        def __init__(self, parser, ctx: ParserRuleContext):  # actually a ILATsmParser.NumberContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def INTEGER_VAL(self):
            return self.getToken(ILATsmParser.INTEGER_VAL, 0)

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

    class Bin_valContext(NumberContext):
        def __init__(self, parser, ctx: ParserRuleContext):  # actually a ILATsmParser.NumberContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def BINARY_VAL(self):
            return self.getToken(ILATsmParser.BINARY_VAL, 0)

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

    class Hex_valContext(NumberContext):
        def __init__(self, parser, ctx: ParserRuleContext):  # actually a ILATsmParser.NumberContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def HEX_VAL(self):
            return self.getToken(ILATsmParser.HEX_VAL, 0)

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

    def number(self):
        localctx = ILATsmParser.NumberContext(self, self._ctx, self.state)
        self.enterRule(localctx, 20, self.RULE_number)
        try:
            self.state = 146
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [19]:
                localctx = ILATsmParser.Int_valContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 143
                self.match(ILATsmParser.INTEGER_VAL)
                pass
            elif token in [20]:
                localctx = ILATsmParser.Hex_valContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 144
                self.match(ILATsmParser.HEX_VAL)
                pass
            elif token in [21]:
                localctx = ILATsmParser.Bin_valContext(self, localctx)
                self.enterOuterAlt(localctx, 3)
                self.state = 145
                self.match(ILATsmParser.BINARY_VAL)
                pass
            else:
                raise NoViableAltException(self)

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

    def sempred(self, localctx: RuleContext, ruleIndex: int, predIndex: int):
        if self._predicates == None:
            self._predicates = dict()
        self._predicates[5] = self.condition_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 condition_sempred(self, localctx: ConditionContext, predIndex: int):
        if predIndex == 0:
            return self.precpred(self._ctx, 4)
