/opt/imh-python/lib/python3.9/lib2to3/pgen2/__pycache__
NameSizeModeActions
conv.cpython-39.opt-1.pyc61430644editdlrm
conv.cpython-39.opt-2.pyc36610644editdlrm
conv.cpython-39.pyc70040644editdlrm
driver.cpython-39.opt-1.pyc51060644editdlrm
driver.cpython-39.opt-2.pyc41100644editdlrm
driver.cpython-39.pyc51380644editdlrm
grammar.cpython-39.opt-1.pyc57160644editdlrm
grammar.cpython-39.opt-2.pyc25650644editdlrm
grammar.cpython-39.pyc57160644editdlrm
literals.cpython-39.opt-1.pyc13730644editdlrm
literals.cpython-39.opt-2.pyc12960644editdlrm
literals.cpython-39.pyc15400644editdlrm
parse.cpython-39.opt-1.pyc64750644editdlrm
parse.cpython-39.opt-2.pyc32510644editdlrm
parse.cpython-39.pyc64890644editdlrm
pgen.cpython-39.opt-1.pyc93280644editdlrm
pgen.cpython-39.opt-2.pyc93280644editdlrm
pgen.cpython-39.pyc97310644editdlrm
token.cpython-39.opt-1.pyc18980644editdlrm
token.cpython-39.opt-2.pyc18480644editdlrm
token.cpython-39.pyc18980644editdlrm
tokenize.cpython-39.opt-1.pyc151330644editdlrm
tokenize.cpython-39.opt-2.pyc112390644editdlrm
tokenize.cpython-39.pyc151820644editdlrm
__init__.cpython-39.opt-1.pyc1760644editdlrm
__init__.cpython-39.opt-2.pyc1480644editdlrm
__init__.cpython-39.pyc1760644editdlrm
Edit: /opt/imh-python/lib/python3.9/lib2to3/pgen2/__pycache__/grammar.cpython-39.pyc (5716B)
a ch@s`dZddlZddlmZGdddeZdZiZeD]"Z e r8e \Z Z e ee ee <q8dS)aThis module defines the data structures used to represent a grammar. These are a bit arcane because they are derived from the data structures used by Python's 'pgen' parser generator. There's also a table here mapping operators to their names in the token module; the Python tokenize module reports all operators as the fallback token code OP, but the parser needs the actual token code. N)tokenc@s@eZdZdZddZddZddZdd Zd d Zd d Z dS)Grammara Pgen parsing tables conversion class. Once initialized, this class supplies the grammar tables for the parsing engine implemented by parse.py. The parsing engine accesses the instance variables directly. The class here does not provide initialization of the tables; several subclasses exist to do this (see the conv and pgen modules). The load() method reads the tables from a pickle file, which is much faster than the other ways offered by subclasses. The pickle file is written by calling dump() (after loading the grammar tables using a subclass). The report() method prints a readable representation of the tables to stdout, for debugging. The instance variables are as follows: symbol2number -- a dict mapping symbol names to numbers. Symbol numbers are always 256 or higher, to distinguish them from token numbers, which are between 0 and 255 (inclusive). number2symbol -- a dict mapping numbers to symbol names; these two are each other's inverse. states -- a list of DFAs, where each DFA is a list of states, each state is a list of arcs, and each arc is a (i, j) pair where i is a label and j is a state number. The DFA number is the index into this list. (This name is slightly confusing.) Final states are represented by a special arc of the form (0, j) where j is its own state number. dfas -- a dict mapping symbol numbers to (DFA, first) pairs, where DFA is an item from the states list above, and first is a set of tokens that can begin this grammar rule (represented by a dict whose values are always 1). labels -- a list of (x, y) pairs where x is either a token number or a symbol number, and y is either None or a string; the strings are keywords. The label number is the index in this list; label numbers are used to mark state transitions (arcs) in the DFAs. start -- the number of the grammar's start symbol. keywords -- a dict mapping keyword strings to arc labels. tokens -- a dict mapping token numbers to arc labels. cCs<i|_i|_g|_i|_dg|_i|_i|_i|_d|_dS)N)rZEMPTY) symbol2number number2symbolstatesdfaslabelskeywordstokens symbol2labelstart)selfr6/opt/imh-python/lib/python3.9/lib2to3/pgen2/grammar.py__init__LszGrammar.__init__cCs@t|d"}t|j|tjWdn1s20YdS)z)Dump the grammar tables to a pickle file.wbN)openpickledump__dict__HIGHEST_PROTOCOL)rfilenamefrrrrWs z Grammar.dumpcCsDt|d}t|}Wdn1s*0Y|j|dS)z+Load the grammar tables from a pickle file.rbN)rrloadrupdate)rrrdrrrr\s (z Grammar.loadcCs|jt|dS)z3Load the grammar tables from a pickle bytes object.N)rrrloads)rZpklrrrrbsz Grammar.loadscCsT|}dD]}t||t||q |jdd|_|jdd|_|j|_|S)z# Copy the grammar. )rrr r r r N) __class__setattrgetattrcopyr rr)rnewZ dict_attrrrrr#fsz Grammar.copycCsvddlm}td||jtd||jtd||jtd||jtd||jtd|jd S) z:Dump the grammar tables to standard output, for debugging.r)pprintZs2nZn2srr r rN)r%printrrrr r r)rr%rrrreportss      zGrammar.reportN) __name__ __module__ __qualname____doc__rrrrr#r'rrrrrs5  ra ( LPAR ) RPAR [ LSQB ] RSQB : COLON , COMMA ; SEMI + PLUS - MINUS * STAR / SLASH | VBAR & AMPER < LESS > GREATER = EQUAL . DOT % PERCENT ` BACKQUOTE { LBRACE } RBRACE @ AT @= ATEQUAL == EQEQUAL != NOTEQUAL <> NOTEQUAL <= LESSEQUAL >= GREATEREQUAL ~ TILDE ^ CIRCUMFLEX << LEFTSHIFT >> RIGHTSHIFT ** DOUBLESTAR += PLUSEQUAL -= MINEQUAL *= STAREQUAL /= SLASHEQUAL %= PERCENTEQUAL &= AMPEREQUAL |= VBAREQUAL ^= CIRCUMFLEXEQUAL <<= LEFTSHIFTEQUAL >>= RIGHTSHIFTEQUAL **= DOUBLESTAREQUAL // DOUBLESLASH //= DOUBLESLASHEQUAL -> RARROW := COLONEQUAL )r+rrobjectrZ opmap_rawZopmap splitlineslinesplitopnamer"rrrrs  o3