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

from antlr4 import *

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


def serializedATN():
    return [
        4,
        1,
        19,
        109,
        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,
        1,
        0,
        1,
        0,
        1,
        0,
        1,
        1,
        1,
        1,
        1,
        1,
        3,
        1,
        23,
        8,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        3,
        1,
        31,
        8,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        3,
        1,
        47,
        8,
        1,
        1,
        2,
        1,
        2,
        4,
        2,
        51,
        8,
        2,
        11,
        2,
        12,
        2,
        52,
        1,
        2,
        1,
        2,
        4,
        2,
        57,
        8,
        2,
        11,
        2,
        12,
        2,
        58,
        3,
        2,
        61,
        8,
        2,
        1,
        3,
        1,
        3,
        5,
        3,
        65,
        8,
        3,
        10,
        3,
        12,
        3,
        68,
        9,
        3,
        1,
        3,
        3,
        3,
        71,
        8,
        3,
        1,
        4,
        1,
        4,
        1,
        4,
        1,
        4,
        1,
        4,
        1,
        4,
        5,
        4,
        79,
        8,
        4,
        10,
        4,
        12,
        4,
        82,
        9,
        4,
        1,
        4,
        1,
        4,
        1,
        4,
        1,
        4,
        1,
        4,
        1,
        4,
        1,
        4,
        5,
        4,
        91,
        8,
        4,
        10,
        4,
        12,
        4,
        94,
        9,
        4,
        3,
        4,
        96,
        8,
        4,
        1,
        5,
        1,
        5,
        1,
        5,
        1,
        5,
        1,
        5,
        3,
        5,
        103,
        8,
        5,
        1,
        6,
        1,
        6,
        1,
        7,
        1,
        7,
        1,
        7,
        0,
        0,
        8,
        0,
        2,
        4,
        6,
        8,
        10,
        12,
        14,
        0,
        1,
        1,
        0,
        15,
        17,
        119,
        0,
        16,
        1,
        0,
        0,
        0,
        2,
        46,
        1,
        0,
        0,
        0,
        4,
        60,
        1,
        0,
        0,
        0,
        6,
        66,
        1,
        0,
        0,
        0,
        8,
        95,
        1,
        0,
        0,
        0,
        10,
        102,
        1,
        0,
        0,
        0,
        12,
        104,
        1,
        0,
        0,
        0,
        14,
        106,
        1,
        0,
        0,
        0,
        16,
        17,
        3,
        6,
        3,
        0,
        17,
        18,
        5,
        0,
        0,
        1,
        18,
        1,
        1,
        0,
        0,
        0,
        19,
        22,
        5,
        2,
        0,
        0,
        20,
        21,
        5,
        11,
        0,
        0,
        21,
        23,
        5,
        10,
        0,
        0,
        22,
        20,
        1,
        0,
        0,
        0,
        22,
        23,
        1,
        0,
        0,
        0,
        23,
        24,
        1,
        0,
        0,
        0,
        24,
        25,
        5,
        11,
        0,
        0,
        25,
        30,
        3,
        8,
        4,
        0,
        26,
        27,
        5,
        5,
        0,
        0,
        27,
        28,
        3,
        6,
        3,
        0,
        28,
        29,
        5,
        6,
        0,
        0,
        29,
        31,
        1,
        0,
        0,
        0,
        30,
        26,
        1,
        0,
        0,
        0,
        30,
        31,
        1,
        0,
        0,
        0,
        31,
        47,
        1,
        0,
        0,
        0,
        32,
        33,
        5,
        2,
        0,
        0,
        33,
        34,
        5,
        10,
        0,
        0,
        34,
        35,
        5,
        11,
        0,
        0,
        35,
        47,
        3,
        8,
        4,
        0,
        36,
        37,
        5,
        2,
        0,
        0,
        37,
        47,
        5,
        11,
        0,
        0,
        38,
        39,
        5,
        2,
        0,
        0,
        39,
        40,
        5,
        11,
        0,
        0,
        40,
        41,
        3,
        8,
        4,
        0,
        41,
        42,
        5,
        5,
        0,
        0,
        42,
        43,
        3,
        6,
        3,
        0,
        43,
        47,
        1,
        0,
        0,
        0,
        44,
        45,
        5,
        2,
        0,
        0,
        45,
        47,
        3,
        8,
        4,
        0,
        46,
        19,
        1,
        0,
        0,
        0,
        46,
        32,
        1,
        0,
        0,
        0,
        46,
        36,
        1,
        0,
        0,
        0,
        46,
        38,
        1,
        0,
        0,
        0,
        46,
        44,
        1,
        0,
        0,
        0,
        47,
        3,
        1,
        0,
        0,
        0,
        48,
        49,
        5,
        3,
        0,
        0,
        49,
        51,
        3,
        2,
        1,
        0,
        50,
        48,
        1,
        0,
        0,
        0,
        51,
        52,
        1,
        0,
        0,
        0,
        52,
        50,
        1,
        0,
        0,
        0,
        52,
        53,
        1,
        0,
        0,
        0,
        53,
        61,
        1,
        0,
        0,
        0,
        54,
        55,
        5,
        3,
        0,
        0,
        55,
        57,
        3,
        14,
        7,
        0,
        56,
        54,
        1,
        0,
        0,
        0,
        57,
        58,
        1,
        0,
        0,
        0,
        58,
        56,
        1,
        0,
        0,
        0,
        58,
        59,
        1,
        0,
        0,
        0,
        59,
        61,
        1,
        0,
        0,
        0,
        60,
        50,
        1,
        0,
        0,
        0,
        60,
        56,
        1,
        0,
        0,
        0,
        61,
        5,
        1,
        0,
        0,
        0,
        62,
        65,
        3,
        14,
        7,
        0,
        63,
        65,
        3,
        2,
        1,
        0,
        64,
        62,
        1,
        0,
        0,
        0,
        64,
        63,
        1,
        0,
        0,
        0,
        65,
        68,
        1,
        0,
        0,
        0,
        66,
        64,
        1,
        0,
        0,
        0,
        66,
        67,
        1,
        0,
        0,
        0,
        67,
        70,
        1,
        0,
        0,
        0,
        68,
        66,
        1,
        0,
        0,
        0,
        69,
        71,
        3,
        4,
        2,
        0,
        70,
        69,
        1,
        0,
        0,
        0,
        70,
        71,
        1,
        0,
        0,
        0,
        71,
        7,
        1,
        0,
        0,
        0,
        72,
        73,
        5,
        9,
        0,
        0,
        73,
        96,
        5,
        13,
        0,
        0,
        74,
        75,
        5,
        9,
        0,
        0,
        75,
        80,
        3,
        10,
        5,
        0,
        76,
        77,
        5,
        14,
        0,
        0,
        77,
        79,
        3,
        10,
        5,
        0,
        78,
        76,
        1,
        0,
        0,
        0,
        79,
        82,
        1,
        0,
        0,
        0,
        80,
        78,
        1,
        0,
        0,
        0,
        80,
        81,
        1,
        0,
        0,
        0,
        81,
        83,
        1,
        0,
        0,
        0,
        82,
        80,
        1,
        0,
        0,
        0,
        83,
        84,
        5,
        13,
        0,
        0,
        84,
        96,
        1,
        0,
        0,
        0,
        85,
        96,
        5,
        9,
        0,
        0,
        86,
        87,
        5,
        9,
        0,
        0,
        87,
        92,
        3,
        10,
        5,
        0,
        88,
        89,
        5,
        14,
        0,
        0,
        89,
        91,
        3,
        10,
        5,
        0,
        90,
        88,
        1,
        0,
        0,
        0,
        91,
        94,
        1,
        0,
        0,
        0,
        92,
        90,
        1,
        0,
        0,
        0,
        92,
        93,
        1,
        0,
        0,
        0,
        93,
        96,
        1,
        0,
        0,
        0,
        94,
        92,
        1,
        0,
        0,
        0,
        95,
        72,
        1,
        0,
        0,
        0,
        95,
        74,
        1,
        0,
        0,
        0,
        95,
        85,
        1,
        0,
        0,
        0,
        95,
        86,
        1,
        0,
        0,
        0,
        96,
        9,
        1,
        0,
        0,
        0,
        97,
        98,
        5,
        18,
        0,
        0,
        98,
        99,
        5,
        19,
        0,
        0,
        99,
        103,
        3,
        12,
        6,
        0,
        100,
        103,
        5,
        18,
        0,
        0,
        101,
        103,
        3,
        12,
        6,
        0,
        102,
        97,
        1,
        0,
        0,
        0,
        102,
        100,
        1,
        0,
        0,
        0,
        102,
        101,
        1,
        0,
        0,
        0,
        103,
        11,
        1,
        0,
        0,
        0,
        104,
        105,
        7,
        0,
        0,
        0,
        105,
        13,
        1,
        0,
        0,
        0,
        106,
        107,
        5,
        4,
        0,
        0,
        107,
        15,
        1,
        0,
        0,
        0,
        13,
        22,
        30,
        46,
        52,
        58,
        60,
        64,
        66,
        70,
        80,
        92,
        95,
        102,
    ]


class TagTemplateParser(Parser):

    grammarFileName = "TagTemplateParser.g4"

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

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

    sharedContextCache = PredictionContextCache()

    literalNames = [
        "<INVALID>",
        "<INVALID>",
        "'%'",
        "'|'",
        "<INVALID>",
        "'{'",
        "'}'",
        "<INVALID>",
        "<INVALID>",
        "'('",
        "'.'",
        "<INVALID>",
        "<INVALID>",
        "')'",
        "','",
        "<INVALID>",
        "<INVALID>",
        "<INVALID>",
        "<INVALID>",
        "'='",
    ]

    symbolicNames = [
        "<INVALID>",
        "GLOBAL_WHITESPACE",
        "TAG_START",
        "PIPE",
        "TEXT",
        "CONTEXT_START",
        "CONTEXT_END",
        "ANY",
        "TAG_WHITESPACE",
        "ARGS_START",
        "CATEGORY_SEPARATOR",
        "TAG_ID",
        "ARGS_WHITESPACE",
        "ARGS_END",
        "ARG_SEPARATOR",
        "NUMERIC_VALUE",
        "BOOLEAN_VALUE",
        "STRING_VALUE",
        "ARG_NAME",
        "ARG_EQUALS",
    ]

    RULE_rootPattern = 0
    RULE_tag = 1
    RULE_pipeList = 2
    RULE_pattern = 3
    RULE_argumentList = 4
    RULE_argument = 5
    RULE_argumentValue = 6
    RULE_rawText = 7

    ruleNames = [
        "rootPattern",
        "tag",
        "pipeList",
        "pattern",
        "argumentList",
        "argument",
        "argumentValue",
        "rawText",
    ]

    EOF = Token.EOF
    GLOBAL_WHITESPACE = 1
    TAG_START = 2
    PIPE = 3
    TEXT = 4
    CONTEXT_START = 5
    CONTEXT_END = 6
    ANY = 7
    TAG_WHITESPACE = 8
    ARGS_START = 9
    CATEGORY_SEPARATOR = 10
    TAG_ID = 11
    ARGS_WHITESPACE = 12
    ARGS_END = 13
    ARG_SEPARATOR = 14
    NUMERIC_VALUE = 15
    BOOLEAN_VALUE = 16
    STRING_VALUE = 17
    ARG_NAME = 18
    ARG_EQUALS = 19

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

    class RootPatternContext(ParserRuleContext):
        __slots__ = "parser"

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

        def pattern(self):
            return self.getTypedRuleContext(TagTemplateParser.PatternContext, 0)

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

        def getRuleIndex(self):
            return TagTemplateParser.RULE_rootPattern

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

    def rootPattern(self):

        localctx = TagTemplateParser.RootPatternContext(self, self._ctx, self.state)
        self.enterRule(localctx, 0, self.RULE_rootPattern)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 16
            self.pattern()
            self.state = 17
            self.match(TagTemplateParser.EOF)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class TagContext(ParserRuleContext):
        __slots__ = "parser"

        def __init__(
            self, parser, parent: ParserRuleContext = None, invokingState: int = -1
        ):
            super().__init__(parent, invokingState)
            self.parser = parser
            self.categoryId = None  # Token
            self.tagId = None  # Token
            self.errorMissingCategoryId = None  # Token
            self.errorNoArgumentList = None  # Token
            self.errorUnclosedContext = None  # Token
            self.errorMissingTagId = None  # Token

        def TAG_START(self):
            return self.getToken(TagTemplateParser.TAG_START, 0)

        def argumentList(self):
            return self.getTypedRuleContext(TagTemplateParser.ArgumentListContext, 0)

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

        def CATEGORY_SEPARATOR(self):
            return self.getToken(TagTemplateParser.CATEGORY_SEPARATOR, 0)

        def CONTEXT_START(self):
            return self.getToken(TagTemplateParser.CONTEXT_START, 0)

        def pattern(self):
            return self.getTypedRuleContext(TagTemplateParser.PatternContext, 0)

        def CONTEXT_END(self):
            return self.getToken(TagTemplateParser.CONTEXT_END, 0)

        def getRuleIndex(self):
            return TagTemplateParser.RULE_tag

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

    def tag(self):

        localctx = TagTemplateParser.TagContext(self, self._ctx, self.state)
        self.enterRule(localctx, 2, self.RULE_tag)
        self._la = 0  # Token type
        try:
            self.state = 46
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input, 2, self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 19
                self.match(TagTemplateParser.TAG_START)
                self.state = 22
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input, 0, self._ctx)
                if la_ == 1:
                    self.state = 20
                    localctx.categoryId = self.match(TagTemplateParser.TAG_ID)
                    self.state = 21
                    self.match(TagTemplateParser.CATEGORY_SEPARATOR)

                self.state = 24
                localctx.tagId = self.match(TagTemplateParser.TAG_ID)
                self.state = 25
                self.argumentList()
                self.state = 30
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la == TagTemplateParser.CONTEXT_START:
                    self.state = 26
                    self.match(TagTemplateParser.CONTEXT_START)
                    self.state = 27
                    self.pattern()
                    self.state = 28
                    self.match(TagTemplateParser.CONTEXT_END)

                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 32
                self.match(TagTemplateParser.TAG_START)
                self.state = 33
                localctx.errorMissingCategoryId = self.match(
                    TagTemplateParser.CATEGORY_SEPARATOR
                )
                self.state = 34
                localctx.tagId = self.match(TagTemplateParser.TAG_ID)
                self.state = 35
                self.argumentList()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 36
                self.match(TagTemplateParser.TAG_START)
                self.state = 37
                localctx.errorNoArgumentList = self.match(TagTemplateParser.TAG_ID)
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 38
                self.match(TagTemplateParser.TAG_START)
                self.state = 39
                localctx.tagId = self.match(TagTemplateParser.TAG_ID)
                self.state = 40
                self.argumentList()
                self.state = 41
                localctx.errorUnclosedContext = self.match(
                    TagTemplateParser.CONTEXT_START
                )
                self.state = 42
                self.pattern()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 44
                localctx.errorMissingTagId = self.match(TagTemplateParser.TAG_START)
                self.state = 45
                self.argumentList()
                pass

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

    class PipeListContext(ParserRuleContext):
        __slots__ = "parser"

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

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

        def tag(self, i: int = None):
            if i is None:
                return self.getTypedRuleContexts(TagTemplateParser.TagContext)
            else:
                return self.getTypedRuleContext(TagTemplateParser.TagContext, i)

        def rawText(self, i: int = None):
            if i is None:
                return self.getTypedRuleContexts(TagTemplateParser.RawTextContext)
            else:
                return self.getTypedRuleContext(TagTemplateParser.RawTextContext, i)

        def getRuleIndex(self):
            return TagTemplateParser.RULE_pipeList

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

    def pipeList(self):

        localctx = TagTemplateParser.PipeListContext(self, self._ctx, self.state)
        self.enterRule(localctx, 4, self.RULE_pipeList)
        try:
            self.state = 60
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input, 5, self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 50
                self._errHandler.sync(self)
                _alt = 1
                while _alt != 2 and _alt != ATN.INVALID_ALT_NUMBER:
                    if _alt == 1:
                        self.state = 48
                        self.match(TagTemplateParser.PIPE)
                        self.state = 49
                        self.tag()

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

                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 56
                self._errHandler.sync(self)
                _alt = 1
                while _alt != 2 and _alt != ATN.INVALID_ALT_NUMBER:
                    if _alt == 1:
                        self.state = 54
                        self.match(TagTemplateParser.PIPE)
                        self.state = 55
                        localctx.errorNonTagInPipeList = self.rawText()

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

                pass

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

    class PatternContext(ParserRuleContext):
        __slots__ = "parser"

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

        def rawText(self, i: int = None):
            if i is None:
                return self.getTypedRuleContexts(TagTemplateParser.RawTextContext)
            else:
                return self.getTypedRuleContext(TagTemplateParser.RawTextContext, i)

        def tag(self, i: int = None):
            if i is None:
                return self.getTypedRuleContexts(TagTemplateParser.TagContext)
            else:
                return self.getTypedRuleContext(TagTemplateParser.TagContext, i)

        def pipeList(self):
            return self.getTypedRuleContext(TagTemplateParser.PipeListContext, 0)

        def getRuleIndex(self):
            return TagTemplateParser.RULE_pattern

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

    def pattern(self):

        localctx = TagTemplateParser.PatternContext(self, self._ctx, self.state)
        self.enterRule(localctx, 6, self.RULE_pattern)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 66
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input, 7, self._ctx)
            while _alt != 2 and _alt != ATN.INVALID_ALT_NUMBER:
                if _alt == 1:
                    self.state = 64
                    self._errHandler.sync(self)
                    token = self._input.LA(1)
                    if token in [TagTemplateParser.TEXT]:
                        self.state = 62
                        self.rawText()
                        pass
                    elif token in [TagTemplateParser.TAG_START]:
                        self.state = 63
                        self.tag()
                        pass
                    else:
                        raise NoViableAltException(self)

                self.state = 68
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input, 7, self._ctx)

            self.state = 70
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input, 8, self._ctx)
            if la_ == 1:
                self.state = 69
                localctx.pipe_list = self.pipeList()

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

    class ArgumentListContext(ParserRuleContext):
        __slots__ = "parser"

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

        def ARGS_START(self):
            return self.getToken(TagTemplateParser.ARGS_START, 0)

        def ARGS_END(self):
            return self.getToken(TagTemplateParser.ARGS_END, 0)

        def argument(self, i: int = None):
            if i is None:
                return self.getTypedRuleContexts(TagTemplateParser.ArgumentContext)
            else:
                return self.getTypedRuleContext(TagTemplateParser.ArgumentContext, i)

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

        def getRuleIndex(self):
            return TagTemplateParser.RULE_argumentList

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

    def argumentList(self):

        localctx = TagTemplateParser.ArgumentListContext(self, self._ctx, self.state)
        self.enterRule(localctx, 8, self.RULE_argumentList)
        self._la = 0  # Token type
        try:
            self.state = 95
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input, 11, self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 72
                self.match(TagTemplateParser.ARGS_START)
                self.state = 73
                self.match(TagTemplateParser.ARGS_END)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 74
                self.match(TagTemplateParser.ARGS_START)
                self.state = 75
                self.argument()
                self.state = 80
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la == TagTemplateParser.ARG_SEPARATOR:
                    self.state = 76
                    self.match(TagTemplateParser.ARG_SEPARATOR)
                    self.state = 77
                    self.argument()
                    self.state = 82
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 83
                self.match(TagTemplateParser.ARGS_END)
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 85
                localctx.errorUnclosedArgumentList = self.match(
                    TagTemplateParser.ARGS_START
                )
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 86
                localctx.errorUnclosedArgumentList = self.match(
                    TagTemplateParser.ARGS_START
                )
                self.state = 87
                self.argument()
                self.state = 92
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la == TagTemplateParser.ARG_SEPARATOR:
                    self.state = 88
                    self.match(TagTemplateParser.ARG_SEPARATOR)
                    self.state = 89
                    self.argument()
                    self.state = 94
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                pass

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

    class ArgumentContext(ParserRuleContext):
        __slots__ = "parser"

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

        def ARG_NAME(self):
            return self.getToken(TagTemplateParser.ARG_NAME, 0)

        def ARG_EQUALS(self):
            return self.getToken(TagTemplateParser.ARG_EQUALS, 0)

        def argumentValue(self):
            return self.getTypedRuleContext(TagTemplateParser.ArgumentValueContext, 0)

        def getRuleIndex(self):
            return TagTemplateParser.RULE_argument

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

    def argument(self):

        localctx = TagTemplateParser.ArgumentContext(self, self._ctx, self.state)
        self.enterRule(localctx, 10, self.RULE_argument)
        try:
            self.state = 102
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input, 12, self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 97
                self.match(TagTemplateParser.ARG_NAME)
                self.state = 98
                self.match(TagTemplateParser.ARG_EQUALS)
                self.state = 99
                self.argumentValue()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 100
                self.match(TagTemplateParser.ARG_NAME)
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 101
                self.argumentValue()
                pass

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

    class ArgumentValueContext(ParserRuleContext):
        __slots__ = "parser"

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

        def BOOLEAN_VALUE(self):
            return self.getToken(TagTemplateParser.BOOLEAN_VALUE, 0)

        def NUMERIC_VALUE(self):
            return self.getToken(TagTemplateParser.NUMERIC_VALUE, 0)

        def STRING_VALUE(self):
            return self.getToken(TagTemplateParser.STRING_VALUE, 0)

        def getRuleIndex(self):
            return TagTemplateParser.RULE_argumentValue

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

    def argumentValue(self):

        localctx = TagTemplateParser.ArgumentValueContext(self, self._ctx, self.state)
        self.enterRule(localctx, 12, self.RULE_argumentValue)
        self._la = 0  # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 104
            _la = self._input.LA(1)
            if not (
                (
                    ((_la) & ~0x3F) == 0
                    and (
                        (1 << _la)
                        & (
                            (1 << TagTemplateParser.NUMERIC_VALUE)
                            | (1 << TagTemplateParser.BOOLEAN_VALUE)
                            | (1 << TagTemplateParser.STRING_VALUE)
                        )
                    )
                    != 0
                )
            ):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class RawTextContext(ParserRuleContext):
        __slots__ = "parser"

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

        def TEXT(self):
            return self.getToken(TagTemplateParser.TEXT, 0)

        def getRuleIndex(self):
            return TagTemplateParser.RULE_rawText

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

    def rawText(self):

        localctx = TagTemplateParser.RawTextContext(self, self._ctx, self.state)
        self.enterRule(localctx, 14, self.RULE_rawText)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 106
            self.match(TagTemplateParser.TEXT)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx
