/usr/lib/python2.6/site-packages/pycparser
NameSizeModeActions
ply/-0755rm
ast_transforms.py35680644editdlrm
ast_transforms.pyc28160644editdlrm
c_ast.py233360644editdlrm
c_ast.pyc354570644editdlrm
c_generator.py135700644editdlrm
c_generator.pyc190180644editdlrm
c_lexer.py144470644editdlrm
c_lexer.pyc154670644editdlrm
c_parser.py622120644editdlrm
c_parser.pyc643850644editdlrm
lextab.py74570644editdlrm
lextab.pyc71090644editdlrm
plyparser.py15940644editdlrm
plyparser.pyc26580644editdlrm
yacctab.py1295680644editdlrm
yacctab.pyc1018460644editdlrm
_ast_gen.py86630644editdlrm
_ast_gen.pyc94800644editdlrm
_build_tables.py8510644editdlrm
_build_tables.pyc6370644editdlrm
_c_ast.cfg41800644editdlrm
__init__.py29030644editdlrm
__init__.pyc28970644editdlrm
Edit: /usr/lib/python2.6/site-packages/pycparser/_ast_gen.pyc (9480B)
Ñò KVc@s—ddkZddklZdefd„ƒYZdefd„ƒYZdZdZed jo2ddk Z ed ƒZ e i e d d ƒƒndS( i˙˙˙˙N(tTemplatetASTCodeGeneratorcBs)eZdd„Zdd„Zd„ZRS(s _c_ast.cfgcCsI||_g}|i|ƒD]\}}|t||ƒq~|_dS(sN Initialize the code generator from a configuration file. N(t cfg_filenamet parse_cfgfiletNodeCfgtnode_cfg(tselfRt_[1]tnametcontents((s6/usr/lib/python2.6/site-packages/pycparser/_ast_gen.pyt__init__s cCs^ttƒid|iƒ}|t7}x%|iD]}||iƒd7}q/W|i|ƒdS(s< Generates the code into file, an open file buffer. Rs N(Rt_PROLOGUE_COMMENTt substituteRt_PROLOGUE_CODERtgenerate_sourcetwrite(RtfiletsrcR((s6/usr/lib/python2.6/site-packages/pycparser/_ast_gen.pytgenerates   c cs>t|dƒiiƒ}z|~}x |D]}|iƒ}| p|idƒoq-n|idƒ}|idƒ}|idƒ}|djp||jp ||jotd||fƒ‚n|| }||d|!} | o1g} | idƒD]} | | iƒq~ ng} || fVq-WWd QXd S( se Parse the configuration file and yield pairs of (name, contents) for each node. trt#t:t[t]isInvalid line in %s: %s t,N(topent__exit__t __enter__tstript startswithtfindt RuntimeErrortsplit( RtfilenameRtftlinetcolon_it lbracket_it rbracket_iRtvalt_[2]tvtvallist((s6/usr/lib/python2.6/site-packages/pycparser/_ast_gen.pyR&s& ' >N(t__name__t __module__R tNoneRR(((s6/usr/lib/python2.6/site-packages/pycparser/_ast_gen.pyRs  RcBs;eZdZd„Zd„Zd„Zd„Zd„ZRS(sş Node configuration. name: node name contents: a list of contents - attributes and child nodes See comment at the top of the configuration file for details. cCsı||_g|_g|_g|_g|_x…|D]}}|idƒ}|ii|ƒ|idƒo|ii|ƒq4|idƒo|ii|ƒq4|ii|ƒq4WdS(Nt*s**(Rt all_entriestattrtchildt seq_childtrstriptappendtendswith(RRR tentryt clean_entry((s6/usr/lib/python2.6/site-packages/pycparser/_ast_gen.pyR Bs     cCs8|iƒ}|d|iƒ7}|d|iƒ7}|S(Ns (t _gen_initt _gen_childrent_gen_attr_names(RR((s6/usr/lib/python2.6/site-packages/pycparser/_ast_gen.pyRTs cCs¸d|i}|ioFdi|iƒ}did„|iDƒƒ}|d7}d|}n d}d}|d|7}|d |7}x,|id gD]}|d ||f7}q–W|S( Nsclass %s(Node): s, css"x|]}di|ƒVqWdS(s'{0}'N(tformat(t.0te((s6/usr/lib/python2.6/site-packages/pycparser/_ast_gen.pys _s s, 'coord', '__weakref__'s(self, %s, coord=None)s'coord', '__weakref__'s(self, coord=None)s __slots__ = (%s) s def __init__%s: tcoords self.%s = %s (RR/tjoin(RRtargstslotstarglistR((s6/usr/lib/python2.6/site-packages/pycparser/_ast_gen.pyR8Zs   cCsd}|ior|d7}x,|iD]!}|ddtd|ƒ7}q$Wx(|iD]}|dtd|ƒ7}qSW|d7}n |d7}|S( Ns def children(self): s nodelist = [] s& if self.%(child)s is not None:s0 nodelist.append(("%(child)s", self.%(child)s)) R1su for i, child in enumerate(self.%(child)s or []): nodelist.append(("%(child)s[%%d]" %% i, child)) s return tuple(nodelist) s return () (R/R1tdictR2(RRR1R2((s6/usr/lib/python2.6/site-packages/pycparser/_ast_gen.pyR9ns"     cCs(ddid„|iDƒƒd}|S(Ns attr_names = (tcssx|]}d|VqWdS(s%r, N((R<tnm((s6/usr/lib/python2.6/site-packages/pycparser/_ast_gen.pys ‡s t)(R?R0(RR((s6/usr/lib/python2.6/site-packages/pycparser/_ast_gen.pyR:†s$(R+R,t__doc__R RR8R9R:(((s6/usr/lib/python2.6/site-packages/pycparser/_ast_gen.pyR;s     sĥ#----------------------------------------------------------------- # ** ATTENTION ** # This code was automatically generated from the file: # $cfg_filename # # Do not modify it directly. Modify the configuration file and # run the generator again. # ** ** *** ** ** # # pycparser: c_ast.py # # AST Node classes. # # Copyright (C) 2008-2015, Eli Bendersky # License: BSD #----------------------------------------------------------------- s× import sys class Node(object): __slots__ = () """ Abstract base class for AST nodes. """ def children(self): """ A sequence of all children that are Nodes """ pass def show(self, buf=sys.stdout, offset=0, attrnames=False, nodenames=False, showcoord=False, _my_node_name=None): """ Pretty print the Node and all its attributes and children (recursively) to a buffer. buf: Open IO buffer into which the Node is printed. offset: Initial offset (amount of leading spaces) attrnames: True if you want to see the attribute names in name=value pairs. False to only see the values. nodenames: True if you want to see the actual node names within their parents. showcoord: Do you want the coordinates of each Node to be displayed. """ lead = ' ' * offset if nodenames and _my_node_name is not None: buf.write(lead + self.__class__.__name__+ ' <' + _my_node_name + '>: ') else: buf.write(lead + self.__class__.__name__+ ': ') if self.attr_names: if attrnames: nvlist = [(n, getattr(self,n)) for n in self.attr_names] attrstr = ', '.join('%s=%s' % nv for nv in nvlist) else: vlist = [getattr(self, n) for n in self.attr_names] attrstr = ', '.join('%s' % v for v in vlist) buf.write(attrstr) if showcoord: buf.write(' (at %s)' % self.coord) buf.write('\n') for (child_name, child) in self.children(): child.show( buf, offset=offset + 2, attrnames=attrnames, nodenames=nodenames, showcoord=showcoord, _my_node_name=child_name) class NodeVisitor(object): """ A base NodeVisitor class for visiting c_ast nodes. Subclass it and define your own visit_XXX methods, where XXX is the class name you want to visit with these methods. For example: class ConstantVisitor(NodeVisitor): def __init__(self): self.values = [] def visit_Constant(self, node): self.values.append(node.value) Creates a list of values of all the constant nodes encountered below the given node. To use it: cv = ConstantVisitor() cv.visit(node) Notes: * generic_visit() will be called for AST nodes for which no visit_XXX method was defined. * The children of nodes for which a visit_XXX was defined will not be visited - if you need this, call generic_visit() on the node. You can use: NodeVisitor.generic_visit(self, node) * Modeled after Python's own AST visiting facilities (the ast module of Python 3.0) """ def visit(self, node): """ Visit a node. """ method = 'visit_' + node.__class__.__name__ visitor = getattr(self, method, self.generic_visit) return visitor(node) def generic_visit(self, node): """ Called if no explicit visitor function exists for a node. Implements preorder visiting of the node. """ for c_name, c in node.children(): self.visit(c) t__main__s _c_ast.cfgsc_ast.pytw( tpprinttstringRtobjectRRR R R+tsystast_genRR(((s6/usr/lib/python2.6/site-packages/pycparser/_ast_gen.pyt s *br