Moved the ply module around
This commit is contained in:
parent
bfe427b69d
commit
653a5a6575
|
@ -22,20 +22,15 @@
|
|||
#-----------------------------------------------------------------
|
||||
import sys
|
||||
|
||||
# This is not required if you've installed pycparser into
|
||||
# your site-packages/ with setup.py
|
||||
#
|
||||
sys.path.insert(0, '..')
|
||||
|
||||
from pycparser import c_parser, c_ast
|
||||
|
||||
|
||||
def explain_c_declaration(c_decl):
|
||||
def explain_c_declaration(c_decl):
|
||||
""" Parses the declaration in c_decl and returns a text
|
||||
explanation as a string.
|
||||
|
||||
The last external node of the string is used, to allow
|
||||
earlier typedefs for used types.
|
||||
earlier typedefs for used types.
|
||||
"""
|
||||
parser = c_parser.CParser()
|
||||
|
||||
|
@ -51,9 +46,9 @@ def explain_c_declaration(c_decl):
|
|||
return _explain_decl_node(node.ext[-1])
|
||||
|
||||
|
||||
def _explain_decl_node(decl_node):
|
||||
def _explain_decl_node(decl_node):
|
||||
""" Receives a c_ast.Decl note and returns its explanation in
|
||||
English.
|
||||
English.
|
||||
"""
|
||||
#~ print decl_node.show()
|
||||
storage = ' '.join(decl_node.storage) + ' ' if decl_node.storage else ''
|
||||
|
@ -64,8 +59,8 @@ def _explain_decl_node(decl_node):
|
|||
_explain_type(decl_node.type))
|
||||
|
||||
|
||||
def _explain_type(decl):
|
||||
""" Recursively explains a type decl node
|
||||
def _explain_type(decl):
|
||||
""" Recursively explains a type decl node
|
||||
"""
|
||||
typ = type(decl)
|
||||
|
||||
|
|
Loading…
Reference in New Issue