Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Bower components Debian packages RPM packages NuGet packages

agriconnect / pycparser   python

Repository URL to install this package:

Version: 2.18 

/ __pycache__ / c_lexer.cpython-36.pyc

3

õ±ÂX8ã@s<ddlZddlZddlmZddlmZGdd„deƒZdS)éNé)Úlex)ÚTOKENc>@sTeZdZdZdd„Zdd„Zdd„Zdd	„Zd
d„Zdd
„Z	dd„Z
dd„ZdZiZ
x<eD]4Zedkrree
d8<q\edkr„ee
d9<q\ee
ejƒ<q\Wed
ZdwZdxZdyZdzZd{Zd|Zd}ed~edZd€eZeeeZeeeZdZd‚ZdƒZd„Zd…Zd†ed‡ed‡edˆZ d‰e dZ!dŠe!dŠZ"d‹e"Z#dŒe!de!dŽZ$dŒe!dedZ%d‘e dZ&d’e&d“Z'd‹e'Z(d’e&d”ee&d“Z)d•Z*d–Z+d—e+de*d˜e*d™Z,dšZ-d›edœededžZ.dŸedŸed‡e.de-d Z/dZ0d¤d¥„Z1e2e'ƒd¦d§„ƒZ3e2eƒd¨d©„ƒZ4dªd«„Z5d¬d­„Z6d®Z7d¯d°„Z8d±d²„Z9d³d´„Z:d®Z;dµd¶„Z<d·d¸„Z=d®Z>d¹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æZke2dçƒdèd鄃Zle2dêƒdëd섃Zme'Zne2e,ƒdídZoe2e/ƒdïdð„ƒZpe2eƒdñdò„ƒZqe2eƒdódô„ƒZre2eƒdõdö„ƒZse2eƒd÷dø„ƒZte2eƒdùdú„ƒZue2e"ƒdûdü„ƒZve2e#ƒdýdþ„ƒZwe2e$ƒdÿd„ƒZxe2e%ƒdd„ƒZye2e(ƒdd„ƒZze2e)ƒdd„ƒZ{e2eƒdd„ƒZ|d	d
„Z}dS(ÚCLexera 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)ab 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.
        ÚNz([ \t]*line\W)|([ \t]*\d+)z[ \t]*pragma\W)
Ú
error_funcÚon_lbrace_funcÚon_rbrace_funcÚtype_lookup_funcÚfilenameÚ
last_tokenÚreÚcompileÚline_patternÚpragma_pattern)Úselfrrr	r
©rú../pycparser/c_lexer.pyÚ__init__szCLexer.__init__cKstjfd|i|—Ž|_dS)zù 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__
        ÚobjectN)rÚlexer)rÚkwargsrrrÚbuild:szCLexer.buildcCsd|j_dS)z? Resets the internal line number counter of the lexer.
        rN)rÚlineno)rrrrÚreset_linenoDszCLexer.reset_linenocCs|jj|ƒdS)N)rÚinput)rÚtextrrrrIszCLexer.inputcCs|jjƒ|_|jS)N)rÚtokenr)rrrrrLszCLexer.tokencCs|jjjdd|jƒ}|j|S)z3 Find the column of the token in its line.
        Ú
r)rÚlexdataÚrfindÚlexpos)rrZlast_crrrrÚfind_tok_columnPszCLexer.find_tok_columncCs0|j|ƒ}|j||d|dƒ|jjdƒdS)Nrr)Ú_make_tok_locationrrÚskip)rÚmsgrÚlocationrrrÚ_error[s
z
CLexer._errorcCs|j|j|ƒfS)N)rr")rrrrrr#`szCLexer._make_tok_locationÚ_BOOLÚ_COMPLEXÚAUTOÚBREAKÚCASEÚCHARÚCONSTÚCONTINUEÚDEFAULTÚDOÚDOUBLEÚELSEÚENUMÚEXTERNÚFLOATÚFORÚGOTOÚIFÚINLINEÚINTÚLONGÚREGISTERÚOFFSETOFÚRESTRICTÚRETURNÚSHORTÚSIGNEDÚSIZEOFÚSTATICÚSTRUCTÚSWITCHÚTYPEDEFÚUNIONÚUNSIGNEDÚVOIDÚVOLATILEÚWHILEÚ__INT128Z_BoolZ_ComplexÚIDÚTYPEIDÚ
INT_CONST_DECÚ
INT_CONST_OCTÚ
INT_CONST_HEXÚ
INT_CONST_BINÚFLOAT_CONSTÚHEX_FLOAT_CONSTÚ
CHAR_CONSTÚWCHAR_CONSTÚSTRING_LITERALÚWSTRING_LITERALÚPLUSÚMINUSÚTIMESÚDIVIDEÚMODÚORÚANDÚNOTÚXORÚLSHIFTÚRSHIFTÚLORÚLANDÚLNOTÚLTÚLEÚGTÚGEÚEQÚNEÚEQUALSÚ
TIMESEQUALÚDIVEQUALÚMODEQUALÚ	PLUSEQUALÚ
MINUSEQUALÚLSHIFTEQUALÚRSHIFTEQUALÚANDEQUALÚXOREQUALÚOREQUALÚPLUSPLUSÚ
MINUSMINUSÚARROWÚCONDOPÚLPARENÚRPARENÚLBRACKETÚRBRACKETÚLBRACEÚRBRACEÚCOMMAÚPERIODÚSEMIÚCOLONÚELLIPSISÚPPHASHÚPPPRAGMAÚPPPRAGMASTRz[a-zA-Z_$][0-9a-zA-Z_$]*z0[xX]z[0-9a-fA-F]+z0[bB]z[01]+zD(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?z(0z)|([1-9][0-9]*ú)z0[0-7]*z0[0-7]*[89]z([a-zA-Z._~!=&\^\-\\?'"])z(\d+)z(x[0-9a-fA-F]+)z#([\\][^a-zA-Z._~^!=&\^\-\\?'"x0-7])z(\\(ú|z))z
([^'\\\n]|ú'ÚLz('z*\n)|('z*$)z[^'
]+')|('')|('z	[^'\n]*')z
([^"\\\n]|ú"z*"z*?z([eE][-+]?[0-9]+)z([0-9]*\.[0-9]+)|([0-9]+\.)z((((z
?)|([0-9]+z
))[FfLl]?)z([pP][+-]?[0-9]+)z(((z)?\.z)|(z\.))ú(z[FfLl]?)ÚpplineÚ	exclusiveÚpppragmacCsf|jj|jj|jjdr2|jjdƒd|_|_n0|jj|jj|jjdrX|jjdƒn
d|_	|SdS)z[ \t]*\#)Úposr‘Nr“rˆ)
rÚmatchrrr!ÚbeginÚpp_lineÚpp_filenamerÚtype)rÚtrrrÚt_PPHASH÷szCLexer.t_PPHASHcCs0|jdkr|jd|ƒn|jjdƒjdƒ|_dS)Nz$filename before line number in #liner)r—r'ÚvalueÚlstripÚrstripr˜)rršrrrÚt_ppline_FILENAMEs
zCLexer.t_ppline_FILENAMEcCs|jdkr|j|_ndS)N)r—rœ)rršrrrÚt_ppline_LINE_NUMBERs

zCLexer.t_ppline_LINE_NUMBERcCsH|jdkr|jd|ƒn t|jƒ|j_|jdk	r8|j|_|jjdƒdS)z\nNzline number missing in #lineÚINITIAL)r—r'Úintrrr˜rr–)rršrrrÚt_ppline_NEWLINEs

zCLexer.t_ppline_NEWLINEcCsdS)ÚlineNr)rršrrrÚt_ppline_PPLINE!szCLexer.t_ppline_PPLINEz 	cCs|jd|ƒdS)Nzinvalid #line directive)r')rršrrrÚt_ppline_error'szCLexer.t_ppline_errorcCs |jjd7_|jjdƒdS)z\nrr¡N)rrr–)rršrrrÚt_pppragma_NEWLINE-szCLexer.t_pppragma_NEWLINEcCs|S)Zpragmar)rršrrrÚt_pppragma_PPPRAGMA2szCLexer.t_pppragma_PPPRAGMAcCs
d|_|S)z.+rŠ)r™)rršrrrÚt_pppragma_STR8szCLexer.t_pppragma_STRcCs|jd|ƒdS)Nzinvalid #pragma directive)r')rršrrrÚt_pppragma_error=szCLexer.t_pppragma_errorcCs|jj|jjdƒ7_dS)z\n+rN)rrrœÚcount)rršrrrÚ	t_NEWLINEFszCLexer.t_NEWLINEz\+ú-z\*ú/ú%z\|ú&ú~z\^z<<z>>z\|\|z&&ú!ú<ú>z<=z>=z==z!=ú=z\*=z/=z%=z\+=z-=z<<=z>>=z&=z\|=z\^=z\+\+z--z->z\?z\(z\)z\[z\]ú,z\.ú;ú:z\.\.\.z\{cCs|jƒ|S)N)r)rršrrrÚt_LBRACEŽszCLexer.t_LBRACEz\}cCs|jƒ|S)N)r	)rršrrrÚt_RBRACE’szCLexer.t_RBRACEcCs|S)Nr)rršrrrÚ
t_FLOAT_CONSTžszCLexer.t_FLOAT_CONSTcCs|S)Nr)rršrrrÚt_HEX_FLOAT_CONST¢szCLexer.t_HEX_FLOAT_CONSTcCs|S)Nr)rršrrrÚt_INT_CONST_HEX¦szCLexer.t_INT_CONST_HEXcCs|S)Nr)rršrrrÚt_INT_CONST_BINªszCLexer.t_INT_CONST_BINcCsd}|j||ƒdS)NzInvalid octal constant)r')rršr%rrrÚt_BAD_CONST_OCT®szCLexer.t_BAD_CONST_OCTcCs|S)Nr)rršrrrÚt_INT_CONST_OCT³szCLexer.t_INT_CONST_OCTcCs|S)Nr)rršrrrÚt_INT_CONST_DEC·szCLexer.t_INT_CONST_DECcCs|S)Nr)rršrrrÚt_CHAR_CONST¾szCLexer.t_CHAR_CONSTcCs|S)Nr)rršrrrÚ
t_WCHAR_CONSTÂszCLexer.t_WCHAR_CONSTcCsd}|j||ƒdS)NzUnmatched ')r')rršr%rrrÚt_UNMATCHED_QUOTEÆszCLexer.t_UNMATCHED_QUOTEcCsd|j}|j||ƒdS)NzInvalid char constant %s)rœr')rršr%rrrÚt_BAD_CHAR_CONSTËs
zCLexer.t_BAD_CHAR_CONSTcCs|S)Nr)rršrrrÚt_WSTRING_LITERALÐszCLexer.t_WSTRING_LITERALcCsd}|j||ƒdS)Nz#String contains invalid escape code)r')rršr%rrrÚt_BAD_STRING_LITERALÖszCLexer.t_BAD_STRING_LITERALcCs2|jj|jdƒ|_|jdkr.|j|jƒr.d|_|S)NrNrO)Úkeyword_mapÚgetrœr™r
)rršrrrÚt_IDÛszCLexer.t_IDcCs"dt|jdƒ}|j||ƒdS)NzIllegal character %sr)Úreprrœr')rršr%rrrÚt_errorâszCLexer.t_errorN)&r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrM)=rNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnrorprqrrrsrtrurvrwrxryrzr{r|r}r~rr€rr‚rƒr„r…r†r‡rˆr‰rŠ©r‘r’©r“r’)rÍrÎ)~Ú__name__Ú
__module__Ú__qualname__Ú__doc__rrrrrr"r'r#ÚkeywordsrÈÚkeywordÚlowerÚtokensZ
identifierZ
hex_prefixZ
hex_digitsZ
bin_prefixZ
bin_digitsZinteger_suffix_optZdecimal_constantZoctal_constantZhex_constantZbin_constantZbad_octal_constantZ
simple_escapeZdecimal_escapeZ
hex_escapeZ
bad_escapeZescape_sequenceZcconst_charZ
char_constZwchar_constZunmatched_quoteZbad_char_constZstring_charZstring_literalZwstring_literalZbad_string_literalZ
exponent_partZfractional_constantZfloating_constantZbinary_exponent_partZhex_fractional_constantZhex_floating_constantZstatesr›rrŸr r£r¥Zt_ppline_ignorer¦r§r¨Zt_pppragma_ignorer©rªZt_ignorer¬Zt_PLUSZt_MINUSZt_TIMESZt_DIVIDEZt_MODZt_ORZt_ANDZt_NOTZt_XORZt_LSHIFTZt_RSHIFTZt_LORZt_LANDZt_LNOTZt_LTZt_GTZt_LEZt_GEZt_EQZt_NEZt_EQUALSZt_TIMESEQUALZ
t_DIVEQUALZ
t_MODEQUALZt_PLUSEQUALZt_MINUSEQUALZ
t_LSHIFTEQUALZ
t_RSHIFTEQUALZ
t_ANDEQUALZ	t_OREQUALZ
t_XOREQUALZ
t_PLUSPLUSZt_MINUSMINUSZt_ARROWZt_CONDOPZt_LPARENZt_RPARENZ
t_LBRACKETZ
t_RBRACKETZt_COMMAZt_PERIODZt_SEMIZt_COLONZ
t_ELLIPSISr¹rºZt_STRING_LITERALr»r¼r½r¾r¿rÀrÁrÂrÃrÄrÅrÆrÇrÊrÌrrrrrsB!



		$	r)r
ÚsysÚplyrZply.lexrrrrrrrÚ<module>	s