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ONST_OCTszCLexer.t_INT_CONST_OCTcCs|SrrrYrrrt_INT_CONST_DECszCLexer.t_INT_CONST_DECcCs|SrrrYrrrt_INT_CONST_CHARszCLexer.t_INT_CONST_CHARcCs|SrrrYrrr t_CHAR_CONSTszCLexer.t_CHAR_CONSTcCs|SrrrYrrr t_WCHAR_CONSTszCLexer.t_WCHAR_CONSTcCs|SrrrYrrrt_U8CHAR_CONSTszCLexer.t_U8CHAR_CONSTcCs|SrrrYrrrt_U16CHAR_CONSTszCLexer.t_U16CHAR_CONSTcCs|SrrrYrrrt_U32CHAR_CONSTszCLexer.t_U32CHAR_CONSTcCsd}|||dS)Nz Unmatched 'rgrrrrt_UNMATCHED_QUOTEszCLexer.t_UNMATCHED_QUOTEcCsd|j}|||dS)NzInvalid char constant %s)r\r)rrrrt_BAD_CHAR_CONSTs zCLexer.t_BAD_CHAR_CONSTcCs|SrrrYrrrt_WSTRING_LITERAL szCLexer.t_WSTRING_LITERALcCs|SrrrYrrrt_U8STRING_LITERALszCLexer.t_U8STRING_LITERALcCs|SrrrYrrrt_U16STRING_LITERALszCLexer.t_U16STRING_LITERALcCs|SrrrYrrrt_U32STRING_LITERALszCLexer.t_U32STRING_LITERALcCsd}|||dS)Nz#String contains invalid escape codergrrrrt_BAD_STRING_LITERALszCLexer.t_BAD_STRING_LITERALcCs2|j|jd|_|jdkr.||jr.d|_|S)Nr1r2) keyword_mapgetr\rXr rYrrrt_ID"sz CLexer.t_IDcCs"dt|jd}|||dS)NzIllegal character %sr)reprr\r)rrrrt_error)szCLexer.t_error)__name__ __module__ __qualname____doc__rrrrrr$r)r%keywordsZ keywords_newrkeywordloweruppertokens identifierZ hex_prefixZ hex_digits bin_prefixZ bin_digitsZinteger_suffix_optZdecimal_constantZoctal_constantZ hex_constantZ bin_constantZbad_octal_constantZ simple_escapeZdecimal_escapeZ hex_escapeZ bad_escapeZescape_sequenceZescape_sequence_start_in_stringZ cconst_charZ char_constZ wchar_constZ u8char_constZ u16char_constZ u32char_constZmulticharacter_constantZunmatched_quoteZbad_char_constZ string_charZstring_literalZwstring_literalZu8string_literalZu16string_literalZu32string_literalZbad_string_literalZ exponent_partZfractional_constantZfloating_constantZbinary_exponent_partZhex_fractional_constantZhex_floating_constantZstatesr[rr_r`rdrfZt_ppline_ignorerhrirjZt_pppragma_ignorerkrlZt_ignorernZt_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_MODEQUALZ t_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~rrrrrrrrrrrrrrrrrrrrrrrrrsJ!   & C       $                           r)r ZplyrZply.lexrrrrrrr s