# Path: omegaconf/errors.py
# class GrammarParseError(OmegaConfBaseException):
#     """
#     Thrown when failing to parse an expression according to the ANTLR grammar.
#     """
# 
# Path: omegaconf/grammar_visitor.py
# class GrammarVisitor(OmegaConfGrammarParserVisitor):
#     def __init__(
#         self,
#         node_interpolation_callback: Callable[
#             [str, Optional[Set[int]]],
#             Optional["Node"],
#         ],
#         resolver_interpolation_callback: Callable[..., Any],
#         memo: Optional[Set[int]],
#         **kw: Dict[Any, Any],
#     ):
#     def aggregateResult(self, aggregate: List[Any], nextResult: Any) -> List[Any]:
#     def defaultResult(self) -> List[Any]:
#     def visitConfigKey(self, ctx: OmegaConfGrammarParser.ConfigKeyContext) -> str:
#     def visitConfigValue(self, ctx: OmegaConfGrammarParser.ConfigValueContext) -> Any:
#     def visitDictKey(self, ctx: OmegaConfGrammarParser.DictKeyContext) -> Any:
#     def visitDictContainer(
#         self, ctx: OmegaConfGrammarParser.DictContainerContext
#     ) -> Dict[Any, Any]:
#     def visitElement(self, ctx: OmegaConfGrammarParser.ElementContext) -> Any:
#     def visitInterpolation(
#         self, ctx: OmegaConfGrammarParser.InterpolationContext
#     ) -> Any:
#     def visitInterpolationNode(
#         self, ctx: OmegaConfGrammarParser.InterpolationNodeContext
#     ) -> Optional["Node"]:
#     def visitInterpolationResolver(
#         self, ctx: OmegaConfGrammarParser.InterpolationResolverContext
#     ) -> Any:
#     def visitDictKeyValuePair(
#         self, ctx: OmegaConfGrammarParser.DictKeyValuePairContext
#     ) -> Tuple[Any, Any]:
#     def visitListContainer(
#         self, ctx: OmegaConfGrammarParser.ListContainerContext
#     ) -> List[Any]:
#     def visitPrimitive(self, ctx: OmegaConfGrammarParser.PrimitiveContext) -> Any:
#     def visitQuotedValue(self, ctx: OmegaConfGrammarParser.QuotedValueContext) -> str:
#     def visitResolverName(self, ctx: OmegaConfGrammarParser.ResolverNameContext) -> str:
#     def visitSequence(
#         self, ctx: OmegaConfGrammarParser.SequenceContext
#     ) -> Generator[Any, None, None]:
#         def empty_str_warning() -> None:
#     def visitSingleElement(
#         self, ctx: OmegaConfGrammarParser.SingleElementContext
#     ) -> Any:
#     def visitText(self, ctx: OmegaConfGrammarParser.TextContext) -> Any:
#     def _createPrimitive(
#         self,
#         ctx: Union[
#             OmegaConfGrammarParser.PrimitiveContext,
#             OmegaConfGrammarParser.DictKeyContext,
#         ],
#     ) -> Any:
#     def _unescape(
#         self,
#         seq: List[Union[TerminalNode, OmegaConfGrammarParser.InterpolationContext]],
#     ) -> str:


import re
import threading
from typing import Any
from antlr4 import CommonTokenStream, InputStream, ParserRuleContext
from antlr4.error.ErrorListener import ErrorListener
from .errors import GrammarParseError
from .grammar_visitor import (  # type: ignore
    OmegaConfGrammarLexer,
    OmegaConfGrammarParser,
)
        msg: Any,
        e: Any,
    ) -> None:
        raise GrammarParseError(str(e) if msg is None else msg) from e

    def reportAmbiguity(
        self,
        recognizer: Any,
        dfa: Any,
        startIndex: Any,
        stopIndex: Any,
        exact: Any,
        ambigAlts: Any,
        configs: Any,
    ) -> None:
        raise GrammarParseError("ANTLR error: Ambiguity")  # pragma: no cover

    def reportAttemptingFullContext(
        self,
        recognizer: Any,
        dfa: Any,
        startIndex: Any,
        stopIndex: Any,
        conflictingAlts: Any,
        configs: Any,
    ) -> None:
        # Note: for now we raise an error to be safe. However this is mostly a
        # performance warning, so in the future this may be relaxed if we need
        # to change the grammar in such a way that this warning cannot be
        # avoided (another option would be to switch to SLL parsing mode).

# Path: omegaconf/errors.py
# class GrammarParseError(OmegaConfBaseException):
#     """
#     Thrown when failing to parse an expression according to the ANTLR grammar.
#     """
# 
# Path: omegaconf/grammar_visitor.py
# class GrammarVisitor(OmegaConfGrammarParserVisitor):
#     def __init__(
#         self,
#         node_interpolation_callback: Callable[
#             [str, Optional[Set[int]]],
#             Optional["Node"],
#         ],
#         resolver_interpolation_callback: Callable[..., Any],
#         memo: Optional[Set[int]],
#         **kw: Dict[Any, Any],
#     ):
#     def aggregateResult(self, aggregate: List[Any], nextResult: Any) -> List[Any]:
#     def defaultResult(self) -> List[Any]:
#     def visitConfigKey(self, ctx: OmegaConfGrammarParser.ConfigKeyContext) -> str:
#     def visitConfigValue(self, ctx: OmegaConfGrammarParser.ConfigValueContext) -> Any:
#     def visitDictKey(self, ctx: OmegaConfGrammarParser.DictKeyContext) -> Any:
#     def visitDictContainer(
#         self, ctx: OmegaConfGrammarParser.DictContainerContext
#     ) -> Dict[Any, Any]:
#     def visitElement(self, ctx: OmegaConfGrammarParser.ElementContext) -> Any:
#     def visitInterpolation(
#         self, ctx: OmegaConfGrammarParser.InterpolationContext
#     ) -> Any:
#     def visitInterpolationNode(
#         self, ctx: OmegaConfGrammarParser.InterpolationNodeContext
#     ) -> Optional["Node"]:
#     def visitInterpolationResolver(
#         self, ctx: OmegaConfGrammarParser.InterpolationResolverContext
#     ) -> Any:
#     def visitDictKeyValuePair(
#         self, ctx: OmegaConfGrammarParser.DictKeyValuePairContext
#     ) -> Tuple[Any, Any]:
#     def visitListContainer(
#         self, ctx: OmegaConfGrammarParser.ListContainerContext
#     ) -> List[Any]:
#     def visitPrimitive(self, ctx: OmegaConfGrammarParser.PrimitiveContext) -> Any:
#     def visitQuotedValue(self, ctx: OmegaConfGrammarParser.QuotedValueContext) -> str:
#     def visitResolverName(self, ctx: OmegaConfGrammarParser.ResolverNameContext) -> str:
#     def visitSequence(
#         self, ctx: OmegaConfGrammarParser.SequenceContext
#     ) -> Generator[Any, None, None]:
#         def empty_str_warning() -> None:
#     def visitSingleElement(
#         self, ctx: OmegaConfGrammarParser.SingleElementContext
#     ) -> Any:
#     def visitText(self, ctx: OmegaConfGrammarParser.TextContext) -> Any:
#     def _createPrimitive(
#         self,
#         ctx: Union[
#             OmegaConfGrammarParser.PrimitiveContext,
#             OmegaConfGrammarParser.DictKeyContext,
#         ],
#     ) -> Any:
#     def _unescape(
#         self,
#         seq: List[Union[TerminalNode, OmegaConfGrammarParser.InterpolationContext]],
#     ) -> str:


# Path: omegaconf/grammar_parser.py
import re
import threading
from typing import Any
from antlr4 import CommonTokenStream, InputStream, ParserRuleContext
from antlr4.error.ErrorListener import ErrorListener
from .errors import GrammarParseError
from .grammar_visitor import (  # type: ignore
    OmegaConfGrammarLexer,
    OmegaConfGrammarParser,
)

        msg: Any,
        e: Any,
    ) -> None:
        raise GrammarParseError(str(e) if msg is None else msg) from e

    def reportAmbiguity(
        self,
        recognizer: Any,
        dfa: Any,
        startIndex: Any,
        stopIndex: Any,
        exact: Any,
        ambigAlts: Any,
        configs: Any,
    ) -> None:
        raise GrammarParseError("ANTLR error: Ambiguity")  # pragma: no cover

    def reportAttemptingFullContext(
        self,
        recognizer: Any,
        dfa: Any,
        startIndex: Any,
        stopIndex: Any,
        conflictingAlts: Any,
        configs: Any,
    ) -> None:
        # Note: for now we raise an error to be safe. However this is mostly a
        # performance warning, so in the future this may be relaxed if we need
        # to change the grammar in such a way that this warning cannot be
        # avoided (another option would be to switch to SLL parsing mode).

        raise GrammarParseError(