o
    Ngj}
                     @  sb   d Z ddlmZ ddlmZmZ G dd deZh dZh dZg dZ	e
d	ZG d
d dZdS )a  Token types for the MicroBasic lexer.

Keyword and operator lists are taken directly from the Roboteq MicroBasic
Scripting Language User & Reference Manual (V2.0, July 8, 2019), "Keywords"
and "Operators" sections. That grammar is publicly documented and is a
reliable source of truth for tokenizing/parsing .mb source. (The bytecode
this eventually compiles to is NOT publicly documented -- see
docs/reverse_engineering.md.)
    )annotations)Enumautoc                   @  s`   e Zd Ze Ze Ze Ze Ze Ze Z	e Z
e Ze Ze Ze Ze Ze Ze ZdS )	TokenTypeN)__name__
__module____qualname__r   INTEGERSTRINGIDENTLABELKEYWORDOPLPARENRPARENLBRACKETRBRACKETCOMMACOLONNEWLINEEOF r   r   M/sessions/nice-awesome-ritchie/mnt/compiler/src/microbasic_compiler/tokens.pyr      s    
r   >%   #defineasdoifortoanddimendformodnotxorelseexitgotoloopnextstepthentruefalsegosubprintuntilwhileelseifoptionreturntoboolbooleanintegerandwhilecontinueevaluateexplicit	terminate>   abscossinatansqrtwaitgetvalue	getconfig	setconfig
setcommandgettimercountgettimerstatesettimercountsettimerstate)z<<=z>>=z++z--z<<z>>z<=z>=z<>z+=z-=z*=z/=z+-*/=<>c                   @  s.   e Zd ZdZdd	d
ZdddZdddZdS )Tokentypevaluelinecoltype_r   rO   strrP   intrQ   c                 C  s   || _ || _|| _|| _d S NrM   )selfrR   rO   rP   rQ   r   r   r   __init__L   s   
zToken.__init__r5   c              	   C  s(   d| j j d| jd| j d| j d	S )NzToken(z, z, line=z, col=))rN   namerO   rP   rQ   )rV   r   r   r   __repr__R   s   (zToken.__repr__boolc                 C  s&   t |tstS | j| jf|j|jfkS rU   )
isinstancerL   NotImplementedrN   rO   )rV   otherr   r   r   __eq__U   s   
zToken.__eq__N)rR   r   rO   rS   rP   rT   rQ   rT   )r5   rS   )r5   r[   )r   r   r   	__slots__rW   rZ   r_   r   r   r   r   rL   I   s
    

rL   N)__doc__
__future__r   enumr   r   r   KEYWORDSBUILTIN_FUNCTIONSMULTI_CHAR_OPERATORSsetSINGLE_CHAR_OPERATORSrL   r   r   r   r   <module>   s    
	