File: //usr/local/CyberCP/lib64/python3.10/site-packages/pycparser/__pycache__/c_parser.cpython-310.pyc
o
�h*" � @ sd d dl mZ d dlmZ d dlmZ d dlmZmZm Z m
Z
d dlmZm
Z
e
G dd� de��ZdS ) � )�yacc)�c_ast)�CLexer)� PLYParser�
ParseError�
parameterized�template)�fix_switch_cases�fix_atomic_specifiersc @ s� e Zd Zdedddddfdd�Z�d_dd �Zd
d� Zdd
� Zdd� Zdd� Z dd� Z
dd� Zdd� Zdd� Z
dd� Zdd� Zdd� Zd d!� Z�d`d"d#�Z�d`d$d%�Zd&d'� Zd(d)� Zd*Zd+d,� Zd-d.� Zd/d0� Zd1d2� Zd3d4� Zd5d6� Zd7d8� Zd9d:� Zd;d<� Zd=d>� Z d?d@� Z!dAdB� Z"dCdD� Z#dEdF� Z$dGdH� Z%dIdJ� Z&dKdL� Z'dMdN� Z(dOdP� Z)dQdR� Z*dSdT� Z+dUdV� Z,dWdX� Z-dYdZ� Z.d[d\� Z/d]d^� Z0d_d`� Z1dadb� Z2dcdd� Z3dedf� Z4dgdh� Z5didj� Z6dkdl� Z7dmdn� Z8dodp� Z9dqdr� Z:dsdt� Z;dudv� Z<dwdx� Z=dydz� Z>d{d|� Z?d}d~� Z@dd�� ZAd�d�� ZBd�d�� ZCd�d�� ZDd�d�� ZEd�d�� ZFd�d�� ZGd�d�� ZHd�d�� ZId�d�� ZJd�d�� ZKd�d�� ZLd�d�� ZMd�d�� ZNd�d�� ZOd�d�� ZPd�d�� ZQd�d�� ZRd�d�� ZSd�d�� ZTd�d�� ZUd�d�� ZVd�d�� ZWeXd�d�d��d�d�� �ZYeXd�d�d��d�d�� �ZZeXd�d�d��d�d�� �Z[eXd�d��d�d�� �Z\eXd�d�d��d�d�� �Z]eXd�d�d��d�d�� �Z^eXd�d�d��d�d�� �Z_eXd�d�d��d�d�� �Z`d�d�� Zad�dÄ Zbd�dń Zcd�dDŽ Zdd�dɄ Zed�d˄ Zfd�d̈́ Zgd�dτ Zhd�dф Zid�dӄ Zjd�dՄ Zkd�dׄ Zld�dل Zmd�dۄ Znd�d݄ Zod�d߄ Zpd�d� Zqd�d� Zrd�d� Zsd�d� Ztd�d� Zud�d� Zvd�d� Zwd�d� Zxd�d� Zyd�d� Zzd�d�� Z{d�d�� Z|d�d�� Z}d�d�� Z~d�d�� Zd�d�� Z��d �d� Z��d�d� Z��d�d� Z��d�d� Z��d�d � Z��d
�d� Z��d�d
� Z��d�d� Z��d�d� Z��d�d� Z��d�d� Z��d�d� Z��d�d� Z��d�d� Z��d�d� Z��d�d� Z��d �d!� Z��d"�d#� Z��d$�d%� Z��d&�d'� Z��d(�d)� Z��d*�d+� Z��d,�d-� Z��d.�d/� Z��d0�d1� Z��d2�d3� Z��d4�d5� Z��d6�d7� Z��d8�d9� Z��d:�d;� Z��d<�d=� Z��d>�d?� Z��d@�dA� Z��dB�dC� Z��dD�dE� Z��dF�dG� Z��dH�dI� Z��dJ�dK� Z��dL�dM� Z��dN�dO� Z��dP�dQ� Z��dR�dS� Z��dT�dU� Z��dV�dW� Z��dX�dY� Z��dZ�d[� Z��d\�d]� Z��d^S (a �CParserTzpycparser.lextabzpycparser.yacctabF� c
C s~ || j | j| j| jd�| _| jj|||d� | jj| _g d�}|D ]} | �| � q!tj| d||||d�| _ t
� g| _d| _dS )a Create a new CParser.
Some arguments for controlling the debug/optimization
level of the parser are provided. The defaults are
tuned for release/performance mode.
The simple rules for using them are:
*) When tweaking CParser/CLexer, set these to False
*) When releasing a stable parser, set to True
lex_optimize:
Set to False when you're modifying the lexer.
Otherwise, changes in the lexer won't be used, if
some lextab.py file exists.
When releasing with a stable lexer, set to True
to save the re-generation of the lexer table on
each run.
lexer:
Set this parameter to define the lexer to use if
you're not using the default CLexer.
lextab:
Points to the lex table that's used for optimized
mode. Only if you're modifying the lexer and want
some tests to avoid re-generating the table, make
this point to a local lex table file (that's been
earlier generated with lex_optimize=True)
yacc_optimize:
Set to False when you're modifying the parser.
Otherwise, changes in the parser won't be used, if
some parsetab.py file exists.
When releasing with a stable parser, set to True
to save the re-generation of the parser table on
each run.
yacctab:
Points to the yacc table that's used for optimized
mode. Only if you're modifying the parser, make
this point to a local yacc table file
yacc_debug:
Generate a parser.out file that explains how yacc
built the parsing table from the grammar.
taboutputdir:
Set this parameter to control the location of generated
lextab and yacctab files.
)�
error_func�on_lbrace_func�on_rbrace_func�type_lookup_func)�optimize�lextab� outputdir)�abstract_declarator�assignment_expression�declaration_list�declaration_specifiers_no_type�designation�
expression�identifier_list�init_declarator_list�id_init_declarator_list�initializer_list�parameter_type_list�block_item_list�type_qualifier_list�struct_declarator_list�translation_unit_or_empty)�module�start�debugr � tabmoduler N)
�_lex_error_func�_lex_on_lbrace_func�_lex_on_rbrace_func�_lex_type_lookup_func�clex�build�tokens�_create_opt_ruler �cparser�dict�_scope_stack�_last_yielded_token)
�self�lex_optimize�lexerr �
yacc_optimize�yacctab�
yacc_debug�taboutputdir�rules_with_opt�rule� r<