o
    g÷§iš  ã                   @   s8   d Z ddlZddlZG dd„ dejƒZG dd„ dƒZdS )z^
This module contains everything needed to represent a low-level token in mathematical syntax
é    Nc                   @   s,   e Zd ZdZdZdZdZdZdZdZ	dZ
d	S )
Ú	TokenTypezc
    This enum represents the various kinds of Token objects the Equation parser can encounter
    é   é   é   é   é   é   é   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚCOMMAÚFUNCTIONÚLEFT_PARENTHESISÚNUMBERÚOPERATORÚRIGHT_PARENTHESISÚVARIABLE© r   r   úY/home/ubuntu/.local/lib/python3.10/site-packages/borb/pdf/canvas/layout/equation/token.pyr      s    r   c                   @   sº   e Zd ZdZddddejfdeje deje	 deje	 de
def
d	d
„Zdejd  fdd„Zdeje fdd„Zdeje	 fdd„Zdeje	 fdd„Zde
fdd„Zdefdd„ZdS )ÚTokenzf
    This module contains everything needed to represent a low-level token in mathematical syntax
    NÚ Úis_left_associativeÚnumber_of_argumentsÚ
precedenceÚtextÚtypec                 C   s(   g | _ || _|| _|| _|| _|| _d S )N)Ú	_childrenÚ_is_left_associativeÚ_number_of_argumentsÚ_precedenceÚ_textÚ_type)Úselfr   r   r   r   r   r   r   r   Ú__init__"   s   
zToken.__init__Úreturnc                 C   ó   | j S )zq
        This function returns the children of this Token
        :return:    the children of this Token
        )r   ©r$   r   r   r   Úget_children9   ó   zToken.get_childrenc                 C   r'   )a*  
        This function return True if this Token represents a left-associative operator,
        False if it represents a right-associative operator, and None if this Token does
        not represent an operator
        :return:    True if this Token represents a left-associative operator
        )r   r(   r   r   r   Úget_is_left_associative@   s   zToken.get_is_left_associativec                 C   r'   )zñ
        This function returns the number of arguments the operator (represented by this Token)
        accepts, and None if this Token does not represent an operator
        :return:    the number of arguments this operator accepts
        )r    r(   r   r   r   Úget_number_of_argumentsI   ó   zToken.get_number_of_argumentsc                 C   r'   )zÔ
        This function returns the precedence of the operator (represented by this Token)
        and None if this Token does not represent an operator
        :return:    the precedence of this operator
        )r!   r(   r   r   r   Úget_precedenceQ   r-   zToken.get_precedencec                 C   r'   )zƒ
        This function returns the text associated with this Token
        :return:    the text associated with this Token
        )r"   r(   r   r   r   Úget_textY   r*   zToken.get_textc                 C   r'   )zs
        This function returns the TokenType of this Token
        :return:    the TokenType of this Token
        )r#   r(   r   r   r   Úget_type`   r*   zToken.get_type)r
   r   r   r   r   r   ÚtypingÚOptionalÚboolÚintÚstrr%   ÚListr)   r+   r,   r.   r/   r0   r   r   r   r   r      s0    
úþýüû
ú	r   )r   Úenumr1   ÚEnumr   r   r   r   r   r   Ú<module>   s
   