Spade
Mini Shell
| Directory:~$ /lib/python2.7/site-packages/pycparser/ |
| [Home] [System Details] [Kill Me] |
�
"�SVc@sRddlZddlZddlmZddlmZdefd��YZdS(i����N(tlex(tTOKENtCLexerc<Bs�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z
d�ZiZxPeD]HZ
e
d kr�e
ed.<qge
d
kr�e
ed/<qge
ee
j�<qgWed�ZdkZdlZdmZdnZdoZdpZdqedredsZdteZeeeZeeeZduZdvZdwZdxZdyZdzed{ed{ed|Zd}edsZ
d~e d~Z!de!Z"d�e d�e d�Z#d�e
d�ed�Z$d�edsZ%d�e%d�Z&de&Z'd�e%d�ee%d�Z(d�Z)d�Z*d�e*dse)d�e)d�Z+d�Z,d�ed�ed�ed�Z-d�ed�ed{e-dse,d�Z.d�d�fZ/d��Z0e1e&�d���Z2e1e�d���Z3d��Z4d��Z5d�Z6d��Z7d��Z8d��Z9d�Z:e1e&�d���Z;e1e�d���Z<d��Z=d�Z>d��Z?d�Z@d�ZAd�ZBd�ZCd�ZDd�ZEd�ZFd�ZGd�ZHd�ZId�ZJd�ZKd�ZLd�ZMd�ZNd�ZOd�ZPd�ZQd�ZRd�ZSd�ZTd�ZUd�ZVd�ZWd�ZXd�ZYd�ZZd�Z[d�Z\d�Z]d�Z^d�Z_d�Z`d�Zad�Zbd�Zcd�Zdd�Zed�Zfd�Zgd�Zhd�Zid�Zjd�Zke1d��d���Zle1d��d���Zme&Zne1e+�d���Zoe1e.�d���Zpe1e�d���Zqe1e�d���Zre1e�d���Zse1e�d���Zte1e�d���Zue1e!�d���Zve1e"�d���Zwe1e#�d���Zxe1e$�d���Zye1e'�d���Zze1e(�d���Z{e1e�d���Z|d��Z}RS(�s
A lexer for the C language. After building it, set the
input text with input(), and call token() to get new
tokens.
The public attribute filename can be set to an initial
filaneme, but the lexer will update it upon #line
directives.
cCs^||_||_||_||_d|_d|_tjd�|_ tjd�|_
dS(sb Create a new Lexer.
error_func:
An error function. Will be called with an error
message, line and column as arguments, in case of
an error during lexing.
on_lbrace_func, on_rbrace_func:
Called when an LBRACE or RBRACE is encountered
(likely to push/pop type_lookup_func's scope)
type_lookup_func:
A type lookup function. Given a string, it must
return True IFF this string is a name of a type
that was defined with a typedef earlier.
ts([ ]*line\W)|([ ]*\d+)s
[ ]*pragma\WN(t
error_functon_lbrace_functon_rbrace_functtype_lookup_functfilenametNonet
last_tokentretcompiletline_patterntpragma_pattern(tselfRRRR((s5/usr/lib/python2.7/site-packages/pycparser/c_lexer.pyt__init__s cKstjd||�|_dS(s�
Builds the lexer from the specification. Must be
called after the lexer object is created.
This method exists separately, because the PLY
manual warns against calling lex.lex inside
__init__
tobjectN(Rtlexer(Rtkwargs((s5/usr/lib/python2.7/site-packages/pycparser/c_lexer.pytbuild:scCsd|j_dS(s?
Resets the internal line number counter of the lexer.
iN(Rtlineno(R((s5/usr/lib/python2.7/site-packages/pycparser/c_lexer.pytreset_linenoDscCs|jj|�dS(N(Rtinput(Rttext((s5/usr/lib/python2.7/site-packages/pycparser/c_lexer.pyRIscCs|jj�|_|jS(N(RttokenR
(R((s5/usr/lib/python2.7/site-packages/pycparser/c_lexer.pyRLscCs)|jjjdd|j�}|j|S(s3
Find the column of the token in its line.
s
i(Rtlexdatatrfindtlexpos(RRtlast_cr((s5/usr/lib/python2.7/site-packages/pycparser/c_lexer.pytfind_tok_columnPscCs>|j|�}|j||d|d�|jjd�dS(Nii(t_make_tok_locationRRtskip(RtmsgRtlocation((s5/usr/lib/python2.7/site-packages/pycparser/c_lexer.pyt_error[scCs|j|j|�fS(N(RR(RR((s5/usr/lib/python2.7/site-packages/pycparser/c_lexer.pyR`st_BOOLt_COMPLEXtAUTOtBREAKtCASEtCHARtCONSTtCONTINUEtDEFAULTtDOtDOUBLEtELSEtENUMtEXTERNtFLOATtFORtGOTOtIFtINLINEtINTtLONGtREGISTERtOFFSETOFtRESTRICTtRETURNtSHORTtSIGNEDtSIZEOFtSTATICtSTRUCTtSWITCHtTYPEDEFtUNIONtUNSIGNEDtVOIDtVOLATILEtWHILEt_Boolt_ComplextIDtTYPEIDt
INT_CONST_DECt
INT_CONST_OCTt
INT_CONST_HEXt
INT_CONST_BINtFLOAT_CONSTtHEX_FLOAT_CONSTt
CHAR_CONSTtWCHAR_CONSTtSTRING_LITERALtWSTRING_LITERALtPLUStMINUStTIMEStDIVIDEtMODtORtANDtNOTtXORtLSHIFTtRSHIFTtLORtLANDtLNOTtLTtLEtGTtGEtEQtNEtEQUALSt
TIMESEQUALtDIVEQUALtMODEQUALt PLUSEQUALt
MINUSEQUALtLSHIFTEQUALtRSHIFTEQUALtANDEQUALtXOREQUALtOREQUALtPLUSPLUSt
MINUSMINUStARROWtCONDOPtLPARENtRPARENtLBRACKETtRBRACKETtLBRACEtRBRACEtCOMMAtPERIODtSEMItCOLONtELLIPSIStPPHASHs[a-zA-Z_$][0-9a-zA-Z_$]*s0[xX]s[0-9a-fA-F]+s0[bB]s[01]+sD(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?s(0s)|([1-9][0-9]*t)s0[0-7]*s0[0-7]*[89]s([a-zA-Z._~!=&\^\-\\?'"])s(\d+)s(x[0-9a-fA-F]+)s#([\\][^a-zA-Z._~^!=&\^\-\\?'"x0-7])s(\\(t|s))s
([^'\\\n]|t'tLs('s*\n)|('s*$)s[^'
]+')|('')|('s [^'\n]*')s
([^"\\\n]|t"s*"t*s([eE][-+]?[0-9]+)s([0-9]*\.[0-9]+)|([0-9]+\.)s((((s
?)|([0-9]+s
))[FfLl]?)s([pP][+-]?[0-9]+)s(((s)?\.s)|(s\.))t(s[FfLl]?)tpplinet exclusivetpppragmacCs�|jj|jjd|jj�rG|jjd�d|_|_nD|j j|jjd|jj�r~|jjd�n
d|_
|SdS(s[
\t]*\#tposR�R�R�N(R
tmatchRRRtbeginR tpp_linetpp_filenameRttype(Rtt((s5/usr/lib/python2.7/site-packages/pycparser/c_lexer.pytt_PPHASH�s$$ cCsD|jdkr"|jd|�n|jjd�jd�|_dS(Ns$filename
before line number in
#lineR�(R�R R#tvaluetlstriptrstripR�(RR�((s5/usr/lib/python2.7/site-packages/pycparser/c_lexer.pytt_ppline_FILENAMEscCs"|jdkr|j|_ndS(N(R�R R�(RR�((s5/usr/lib/python2.7/site-packages/pycparser/c_lexer.pytt_ppline_LINE_NUMBER
scCsi|jdkr"|jd|�n3t|j�|j_|jdk rU|j|_n|jjd�dS(s\nsline
number missing in
#linetINITIALN( R�R R#tintRRR�RR�(RR�((s5/usr/lib/python2.7/site-packages/pycparser/c_lexer.pytt_ppline_NEWLINEscCsdS(tlineN((RR�((s5/usr/lib/python2.7/site-packages/pycparser/c_lexer.pytt_ppline_PPLINE
ss cCs|jd|�dS(Nsinvalid #line
directive(R#(RR�((s5/usr/lib/python2.7/site-packages/pycparser/c_lexer.pytt_ppline_error&scCs&|jjd7_|jjd�dS(s\niR�N(RRR�(RR�((s5/usr/lib/python2.7/site-packages/pycparser/c_lexer.pytt_pppragma_NEWLINE,scCsdS(tpragmaN((RR�((s5/usr/lib/python2.7/site-packages/pycparser/c_lexer.pytt_pppragma_PPPRAGMA1ss$
<>.-{}();=+-*/$%@&^~!?:,0123456789cCsdS(N((RR�((s5/usr/lib/python2.7/site-packages/pycparser/c_lexer.pytt_pppragma_STR7scCsdS(N((RR�((s5/usr/lib/python2.7/site-packages/pycparser/c_lexer.pyt
t_pppragma_ID:scCs|jd|�dS(Nsinvalid
#pragma
directive(R#(RR�((s5/usr/lib/python2.7/site-packages/pycparser/c_lexer.pytt_pppragma_error=scCs"|jj|jjd�7_dS(s\n+s
N(RRR�tcount(RR�((s5/usr/lib/python2.7/site-packages/pycparser/c_lexer.pyt t_NEWLINEFss\+t-s\*t/t%s\|t&t~s\^s<<s>>s\|\|s&&t!t<t>s<=s>=s==s!=t=s\*=s/=s%=s\+=s-=s<<=s>>=s&=s\|=s\^=s\+\+s--s->s\?s\(s\)s\[s\]t,s\.t;t:s\.\.\.s\{cCs|j�|S(N(R(RR�((s5/usr/lib/python2.7/site-packages/pycparser/c_lexer.pytt_LBRACE�s
s\}cCs|j�|S(N(R(RR�((s5/usr/lib/python2.7/site-packages/pycparser/c_lexer.pytt_RBRACE�s
cCs|S(N((RR�((s5/usr/lib/python2.7/site-packages/pycparser/c_lexer.pyt
t_FLOAT_CONST�scCs|S(N((RR�((s5/usr/lib/python2.7/site-packages/pycparser/c_lexer.pytt_HEX_FLOAT_CONST�scCs|S(N((RR�((s5/usr/lib/python2.7/site-packages/pycparser/c_lexer.pytt_INT_CONST_HEX�scCs|S(N((RR�((s5/usr/lib/python2.7/site-packages/pycparser/c_lexer.pytt_INT_CONST_BIN�scCsd}|j||�dS(NsInvalid
octal
constant(R#(RR�R!((s5/usr/lib/python2.7/site-packages/pycparser/c_lexer.pytt_BAD_CONST_OCT�scCs|S(N((RR�((s5/usr/lib/python2.7/site-packages/pycparser/c_lexer.pytt_INT_CONST_OCT�scCs|S(N((RR�((s5/usr/lib/python2.7/site-packages/pycparser/c_lexer.pytt_INT_CONST_DEC�scCs|S(N((RR�((s5/usr/lib/python2.7/site-packages/pycparser/c_lexer.pytt_CHAR_CONST�scCs|S(N((RR�((s5/usr/lib/python2.7/site-packages/pycparser/c_lexer.pyt
t_WCHAR_CONST�scCsd}|j||�dS(NsUnmatched
'(R#(RR�R!((s5/usr/lib/python2.7/site-packages/pycparser/c_lexer.pytt_UNMATCHED_QUOTE�scCs!d|j}|j||�dS(NsInvalid
char constant
%s(R�R#(RR�R!((s5/usr/lib/python2.7/site-packages/pycparser/c_lexer.pytt_BAD_CHAR_CONST�s
cCs|S(N((RR�((s5/usr/lib/python2.7/site-packages/pycparser/c_lexer.pytt_WSTRING_LITERAL�scCsd}|j||�dS(Ns#String
contains invalid escape
code(R#(RR�R!((s5/usr/lib/python2.7/site-packages/pycparser/c_lexer.pytt_BAD_STRING_LITERAL�scCsL|jj|jd�|_|jdkrH|j|j�rHd|_n|S(NRKRL(tkeyword_maptgetR�R�R(RR�((s5/usr/lib/python2.7/site-packages/pycparser/c_lexer.pytt_ID�s!cCs+dt|jd�}|j||�dS(NsIllegal
character
%si(treprR�R#(RR�R!((s5/usr/lib/python2.7/site-packages/pycparser/c_lexer.pytt_error�s(%R$R%R&R'R(R)R*R+R,R-R.R/R0R1R2R3R4R5R6R7R8R9R:R;R<R=R>R?R@RARBRCRDRERFRGRH(;sIDsTYPEIDRMRNRORPRQRRRSRTRURVRWRXRYRZR[R\R]R^R_R`RaRbRcRdReRfRgRhRiRjRkRlRmRnRoRpRqRrRsRtRuRvRwRxRyRzR{R|R}R~RR�R�R�R�R�sPPHASH(spplineR�(spppragmaR�(~t__name__t
__module__t__doc__RRRRRRR#RtkeywordsR�tkeywordtlowerttokenst
identifiert
hex_prefixt
hex_digitst
bin_prefixt
bin_digitstinteger_suffix_opttdecimal_constanttoctal_constantthex_constanttbin_constanttbad_octal_constantt
simple_escapetdecimal_escapet
hex_escapet
bad_escapetescape_sequencetcconst_chart
char_consttwchar_consttunmatched_quotetbad_char_consttstring_chartstring_literaltwstring_literaltbad_string_literalt
exponent_parttfractional_constanttfloating_constanttbinary_exponent_partthex_fractional_constantthex_floating_constanttstatesR�RR�R�R�R�tt_ppline_ignoreR�R�R�tt_pppragma_ignoreR�R�R�tt_ignoreR�tt_PLUStt_MINUStt_TIMEStt_DIVIDEtt_MODtt_ORtt_ANDtt_NOTtt_XORtt_LSHIFTtt_RSHIFTtt_LORtt_LANDtt_LNOTtt_LTtt_GTtt_LEtt_GEtt_EQtt_NEtt_EQUALStt_TIMESEQUALt
t_DIVEQUALt
t_MODEQUALtt_PLUSEQUALtt_MINUSEQUALt
t_LSHIFTEQUALt
t_RSHIFTEQUALt
t_ANDEQUALt t_OREQUALt
t_XOREQUALt
t_PLUSPLUStt_MINUSMINUStt_ARROWtt_CONDOPtt_LPARENtt_RPARENt
t_LBRACKETt
t_RBRACKETtt_COMMAtt_PERIODtt_SEMItt_COLONt
t_ELLIPSISR�R�tt_STRING_LITERALR�R�R�R�R�R�R�R�R�R�R�R�R�R�R�(((s5/usr/lib/python2.7/site-packages/pycparser/c_lexer.pyRs@ !
&
(RtsystplyRtply.lexRRR(((s5/usr/lib/python2.7/site-packages/pycparser/c_lexer.pyt<module> s