o
    ee                     @   s  d dl mZ ddlmZmZmZmZ ddlm	Z	 d dl
mZmZmZ dZdZdZd	Zd
ZdZdZdZdZdZdZdZdZdZee	jfee	jfee	jfee	j fee	j!fee	j"fee	j#fee	j$fee	j%fee	j&fee	j'fee	j(fee	j)fee	j*ffZ+edd,dd e+D  d ee Z-dgdd e+D  Z.i de	j/de	j0de	j1de	j2d e	j3d!e	j4d"e	j5d#e	j6d$e	j7d%e	j8de	j9de	j:d&e	j;d'e	j<d(e	j=d)e	j>Z?G d*d+ d+eZ@eAd,krze@d-D ]ZBeCeB qW dS  ey ZD zeCd.eD W Y dZD[DdS dZD[Dww dS )/    )print_function   )EOFCommonTokenTokenStreamTokenStreamException)ExcelFormulaParser)compile
IGNORECASEVERBOSEz\d+\bz
    (?:
        (?: \d* \. \d+ ) # .1 .12 .123 etc 9.1 etc 98.1 etc
        |
        (?: \d+ \. ) # 1. 12. 123. etc
    )
    # followed by optional exponent part
    (?: [Ee] [+-]? \d+ ) ?
    z"(?:[^"]|"")*"z"[Rr]0*[1-9][0-9]*[Cc]0*[1-9][0-9]*z\$?[A-I]?[A-Z]\$?0*[1-9][0-9]*zTRUE\bzFALSE\bzIF\bzCHOOSE\bz	\w[\.\w]*z'(?:[^']|'')*'z<>z>=z<=(z)|(c                 c   s    | ]}|d  V  qdS )r   N .0ir   r   I/var/www/html/venv/lib/python3.10/site-packages/xlwt/ExcelFormulaLexer.py	<genexpr>4   s    r   )Nc                 C   s   g | ]}|d  qS r   r   r   r   r   r   
<listcomp>7   s    r   =<>+-*/:;,&%^!c                   @   sF   e Zd Zdd Zdd Zdd Zddd	Zd
d Zdd Zdd Z	dS )Lexerc                 C   s   |d d  | _ d| _d| _d S )Nr   )_text_pos_line)selftextr   r   r   __init__N   s   
zLexer.__init__c                 C   s   t | j| jkS N)lenr%   r&   r(   r   r   r   isEOFS   s   zLexer.isEOFc                 C   s   | j | j S r+   )r%   r&   r-   r   r   r   curr_chV      zLexer.curr_chr   c                 C   s   |  j |7  _ d S r+   )r&   )r(   nr   r   r   next_chY   s   zLexer.next_chc                 C   s   |   dv S )Nz 	
)r/   r-   r   r   r   is_whitespace\   r0   zLexer.is_whitespacec                 C   sH   t | j| j}|sd S |d| _tt|j |d|	dd dS )Nr   r   typer)   col)
_rematchr%   r&   endTok_toktype	lastindexgroupstart)r(   mr   r   r   match_pattern_   s
   $zLexer.match_patternc                 C   s   |   s|  r|   |   s|  s|   rttdS |  }|r%|S |  }zt| }W n tyA   t	d|  | j
f w |   t||| j
dS )N)r5   z Unexpected char %r in column %u.r4   )r.   r3   r2   r:   r   r@   r/   single_char_lookupKeyErrorr   r&   )r(   ttetyr   r   r   	nextTokenf   s$   
zLexer.nextTokenNr   )
__name__
__module____qualname__r*   r.   r/   r2   r3   r@   rF   r   r   r   r   r$   M   s    
r$   __main__zN 1.23 456 "abcd" R2C2 a1 iv65536 true false if choose a_name 'qname' <> >= <= zerror:)E
__future__r   antlrr   r   r:   r   r    r   rer	   	recompiler
   r   int_const_patternflt_const_patternstr_const_patternref2d_r1c1_patternref2d_patterntrue_patternfalse_pattern
if_patternchoose_patternname_patternquotename_pattern
ne_pattern
ge_pattern
le_pattern	NUM_CONST	INT_CONST	STR_CONST
REF2D_R1C1REF2D
TRUE_CONSTFALSE_CONSTFUNC_IFFUNC_CHOOSENAME	QUOTENAMENEGELEpattern_type_tuplesjoinr7   r;   EQLTGTADDSUBMULDIVCOLON	SEMICOLONCOMMALPRPCONCATPERCENTPOWERBANGrA   r$   rG   rC   printer   r   r   r   <module>   s    		

-
