from collections.abc import Generator
from typing import Any, Literal
from typing_extensions import Self

from antlr4.Recognizer import Recognizer
from antlr4.tree.Tree import INVALID_INTERVAL as INVALID_INTERVAL, ParseTreeVisitor as ParseTreeVisitor, RuleNode as RuleNode
from antlr4.tree.Trees import Trees as Trees

Parser: None

class RuleContext(RuleNode):
    __slots__ = ("parentCtx", "invokingState")
    EMPTY: RuleContext | None
    parentCtx: RuleContext | None
    invokingState: int
    def __init__(self, parent: RuleContext | None = None, invokingState: int = -1) -> None: ...
    def depth(self) -> int: ...
    def isEmpty(self) -> bool: ...
    def getSourceInterval(self) -> tuple[int | None, int | None]: ...
    def getRuleContext(self) -> Self: ...
    def getPayload(self) -> Self: ...
    def getText(self) -> str: ...
    def getRuleIndex(self) -> Literal[-1]: ...
    def getAltNumber(self) -> Literal[0]: ...
    def setAltNumber(self, altNumber: int) -> None: ...
    def getChild(self, i: int) -> Any: ...
    def getChildCount(self) -> int: ...
    def getChildren(self) -> Generator[Any]: ...
    def accept(self, visitor: ParseTreeVisitor) -> None: ...
    def toStringTree(self, ruleNames: list[str] | None = None, recog: Recognizer | None = None) -> str: ...
    def toString(self, ruleNames: list[str], stop: RuleContext) -> str: ...
