/opt/alt/python27/lib64/python2.7/lib2to3/pgen2
NameSizeModeActions
conv.py96270644editdlrm
conv.pyc82670644editdlrm
conv.pyo71150644editdlrm
driver.py60410644editdlrm
driver.pyc66320644editdlrm
driver.pyo65690644editdlrm
grammar.py65940644editdlrm
grammar.pyc78270644editdlrm
grammar.pyo78270644editdlrm
literals.py16140644editdlrm
literals.pyc20700644editdlrm
literals.pyo18380644editdlrm
parse.py80530644editdlrm
parse.pyc73920644editdlrm
parse.pyo73530644editdlrm
pgen.py138260644editdlrm
pgen.pyc126540644editdlrm
pgen.pyo120410644editdlrm
token.py12530755editdlrm
token.pyc23550644editdlrm
token.pyo23550644editdlrm
tokenize.py192440644editdlrm
tokenize.pyc172310644editdlrm
tokenize.pyo171420644editdlrm
__init__.py1430644editdlrm
__init__.pyc1870644editdlrm
__init__.pyo1870644editdlrm
Edit: /opt/alt/python27/lib64/python2.7/lib2to3/pgen2/conv.pyc (8267B)
ó Þ[ bc@sEdZddlZddlmZmZdejfd„ƒYZdS(sýConvert graminit.[ch] spit out by pgen to Python code. Pgen is the Python parser generator. It is useful to quickly create a parser from a grammar file in Python's grammar notation. But I don't want my parsers to be written in C (yet), so I'm translating the parsing tables to Python data structures and writing a Python parse engine. Note that the token numbers are constants determined by the standard Python tokenizer. The standard token module defines these numbers and their names (the names are not used much). The token numbers are hardcoded into the Python tokenizer and into pgen. A Python implementation of the Python tokenizer is also available, in the standard tokenize module. On the other hand, symbol numbers (representing the grammar's non-terminals) are assigned by pgen based on the actual grammar input. Note: this module is pretty much obsolete; the pgen module generates equivalent grammar tables directly from the Grammar.txt input file without having to invoke the Python pgen C program. iÿÿÿÿN(tgrammarttokent ConvertercBs2eZdZd„Zd„Zd„Zd„ZRS(s2Grammar subclass that reads classic pgen output files. The run() method reads the tables as produced by the pgen parser generator, typically contained in two C files, graminit.h and graminit.c. The other methods are for internal use only. See the base class for more documentation. cCs(|j|ƒ|j|ƒ|jƒdS(s<Load the grammar tables from the text files written by pgen.N(tparse_graminit_htparse_graminit_ct finish_off(tselft graminit_ht graminit_c((s7/opt/alt/python27/lib64/python2.7/lib2to3/pgen2/conv.pytrun/s  c Csyt|ƒ}Wn#tk r5}d||fGHtSXi|_i|_d}xº|D]²}|d7}tjd|ƒ}| r¥|jƒr¥d|||jƒfGHqU|jƒ\}}t |ƒ}||jksØt ‚||jksít ‚||j|<||j|@r¦d||d|_[] = { {, }, ... }; - followed by a state array, of the form: static state states_[] = { {, arcs__}, ... }; sCan't open %s: %siis#include "pgenheaders.h" s#include "grammar.h" s static arc s)static arc arcs_(\d+)_(\d+)\[(\d+)\] = {$s\s+{(\d+), (\d+)},$s}; s'static state states_(\d+)\[(\d+)\] = {$s\s+{(\d+), arcs_(\d+)_(\d+)},$sstatic dfa dfas\[(\d+)\] = {$s0\s+{(\d+), "(\w+)", (\d+), (\d+), states_(\d+),$iiiis\s+("(?:\\\d\d\d)*")},$is!static label labels\[(\d+)\] = {$s\s+{(\d+), (0|"\w+")},$t0sgrammar _PyParser_Grammar = { s \s+(\d+),$s dfas, s\s+{(\d+), labels},$s \s+(\d+)$N(R R R tnextRt startswithRRtmapRRtrangetappendtlentstatestgroupR Rtevalt enumeratetordtdfastNonetlabelststartt StopIteration(!RRRRRRtallarcsR%Rtntmtktarcst_titjtstttstateR*tndfasRRtxtytztfirstt rawbitsettctbyteR,tnlabelsR-((s7/opt/alt/python27/lib64/python2.7/lib2to3/pgen2/conv.pyRTsö  $$    -%% $       '!  cCsƒi|_i|_xjt|jƒD]Y\}\}}|tjkr_|dk r_||j|s