OwlCyberSecurity - MANAGER
Edit File: driver.pyc
� {fc�����������@���s��d��Z��d�Z�d�d�g�Z�d�d�l�Z�d�d�l�Z�d�d�l�Z�d�d�l�Z�d�d�l�Z�d�d�l�Z�d�d�l �m �Z �m�Z�m�Z�m �Z �m�Z�d�e�f�d�������YZ�d ����Z�d �d�e�e�d�d���Z�d����Z�d ����Z�d����Z�e�d�k�r�e�j�e�e��������n��d�S(���sZ���Parser driver. This provides a high-level interface to parse a file into a syntax tree. s#���Guido van Rossum <guido@python.org>t���Drivert���load_grammari����Ni���(���t���grammart���parset���tokent���tokenizet���pgenc�����������B���sV���e��Z�d�d�d����Z�e�d���Z�e�d���Z�e�d���Z�d�e�d���Z�e�d���Z �RS(���c���������C���s:���|�|��_��|�d��k�r$�t�j����}�n��|�|��_�|�|��_�d��S(���N(���R���t���Nonet���loggingt ���getLoggert���loggert���convert(���t���selfR���R���R ���(����(����s,���/usr/lib64/python2.7/lib2to3/pgen2/driver.pyt���__init__ ���s ���� c���������C���s=��t��j�|��j�|��j���}�|�j����d�}�d�}�d �}�}�}�} �} �d�}�x�|�D]�}�|�\�}�}�}�} �} �|�|�|�f�k�r |�|�f�|�k�s��t�|�|�f�|�f�����|�\�} �}�|�| �k��r��|�d�| �|�7}�| �}�d�}�n��|�|�k��r |�| �|�|�!7}�|�}�q n��|�t�j�t�j �f�k�r`|�|�7}�| �\�}�}�|�j �d���rQ�|�d�7}�d�}�qQ�qQ�n��|�t�j�k�rt�j �|�}�n��|�r�|��j�j�d�t�j�|�|�|���n��|�j�|�|�|�|�f���r�|�r�|��j�j�d���n��Pn��d�}�| �\�}�}�|�j �d���rQ�|�d�7}�d�}�qQ�qQ�Wt��j�d�|�|�|�|�f�����|�j�S( ���s4���Parse a series of tokens and return the syntax tree.i���i����u����s��� s���%s %r (prefix=%r)s���Stop.t����s���incomplete inputN(���R���t���ParserR���R���t���setupR���t���AssertionErrorR���t���COMMENTt���NLt���endswithR���t���OPt���opmapR ���t���debugt���tok_namet���addtokent ���ParseErrort���rootnode(���R���t���tokensR���t���pt���linenot���columnt���typet���valuet���startt���endt ���line_textt���prefixt ���quintuplet���s_linenot���s_column(����(����s,���/usr/lib64/python2.7/lib2to3/pgen2/driver.pyt���parse_tokens'���sT���� * c���������C���s"���t��j�|�j���}�|��j�|�|���S(���s*���Parse a stream and return the syntax tree.(���R���t���generate_tokenst���readlineR)���(���R���t���streamR���R���(����(����s,���/usr/lib64/python2.7/lib2to3/pgen2/driver.pyt���parse_stream_rawW���s����c���������C���s���|��j��|�|���S(���s*���Parse a stream and return the syntax tree.(���R-���(���R���R,���R���(����(����s,���/usr/lib64/python2.7/lib2to3/pgen2/driver.pyt���parse_stream\���s����c���������C���s;���t��j�|�d�|���}�z�|��j�|�|���SWd�|�j����Xd�S(���s(���Parse a file and return the syntax tree.t���rN(���t���codecst���openR.���t���close(���R���t���filenamet���encodingR���R,���(����(����s,���/usr/lib64/python2.7/lib2to3/pgen2/driver.pyt ���parse_file`���s����c���������C���s+���t��j�t�j�|���j���}�|��j�|�|���S(���s*���Parse a string and return the syntax tree.(���R���R*���t���StringIOR+���R)���(���R���t���textR���R���(����(����s,���/usr/lib64/python2.7/lib2to3/pgen2/driver.pyt���parse_stringh���s����N( ���t���__name__t ���__module__R���R ���t���FalseR)���R-���R.���R5���R8���(����(����(����s,���/usr/lib64/python2.7/lib2to3/pgen2/driver.pyR�������s���0c���������C���sR���t��j�j�|����\�}�}�|�d�k�r-�d�}�n��|�|�d�j�t�t�t�j�����d�S(���Ns���.txtR���t���.s���.pickle(���t���ost���patht���splitextt���joint���mapt���strt���syst���version_info(���t���gtt���headt���tail(����(����s,���/usr/lib64/python2.7/lib2to3/pgen2/driver.pyt���_generate_pickle_namen���s���� s���Grammar.txtc���������C���s����|�d�k�r�t�j����}�n��|�d�k�r3�t�|����n�|�}�|�sO�t�|�|����r��|�j�d�|����t�j�|����}�|�r��|�j�d�|���y�|�j�|���Wq��t �k �r��}�|�j�d�|���q��Xq��n�t �j����}�|�j�|���|�S(���s'���Load the grammar (maybe from a pickle).s!���Generating grammar tables from %ss���Writing grammar tables to %ss���Writing failed: %sN( ���R���R���R ���RH���t���_newert���infoR���t���generate_grammart���dumpt���IOErrorR���t���Grammart���load(���RE���t���gpt���savet���forceR ���t���gt���e(����(����s,���/usr/lib64/python2.7/lib2to3/pgen2/driver.pyR���u���s���� c���������C���sN���t��j�j�|����s�t�St��j�j�|���s,�t�St��j�j�|����t��j�j�|���k�S(���s0���Inquire whether file a was written since file b.(���R=���R>���t���existsR;���t���Truet���getmtime(���t���at���b(����(����s,���/usr/lib64/python2.7/lib2to3/pgen2/driver.pyRI�������s ����c���������C���sc���t��j�j�|���r�t�|���St�t��j�j�|�����}�t�j�|��|���}�t�j ����}�|�j �|���|�S(���s���Normally, loads a pickled grammar by doing pkgutil.get_data(package, pickled_grammar) where *pickled_grammar* is computed from *grammar_source* by adding the Python version and using a ``.pickle`` extension. However, if *grammar_source* is an extant file, load_grammar(grammar_source) is called instead. This facilitates using a packaged grammar file when needed but preserves load_grammar's automatic regeneration behavior when possible. (���R=���R>���t���isfileR���RH���t���basenamet���pkgutilt���get_dataR���RN���t���loads(���t���packaget���grammar_sourcet���pickled_namet���dataRS���(����(����s,���/usr/lib64/python2.7/lib2to3/pgen2/driver.pyt���load_packaged_grammar����s���� c����������G���sc���|��s�t��j�d�}��n��t�j�d�t�j�d�t��j�d�d���x$�|��D]�}�t�|�d�t�d�t��q?�Wt�S(���s����Main program, when run as a script: produce grammar pickle files. Calls load_grammar for each argument, a path to a grammar text file. i���t���levelR,���t���formats���%(message)sRQ���RR���(���RC���t���argvR���t���basicConfigt���INFOt���stdoutR���RV���(���t���argsRE���(����(����s,���/usr/lib64/python2.7/lib2to3/pgen2/driver.pyt���main����s���� t���__main__(���t���__doc__t ���__author__t���__all__R0���R=���R���R\���R6���RC���R���R���R���R���R���R���t���objectR����RH���R���RV���R;���R���RI���Rc���Rk���R9���t���exitt���int(����(����(����s,���/usr/lib64/python2.7/lib2to3/pgen2/driver.pyt���<module>���s$���(P