Ejemplo n.º 1
0
Archivo: cpp.py Proyecto: bl0b/cppy
 def __init__(self, f):
     #Scope.__init__(self)
     self.parent = None
     lines = cpp_read(f)
     start = 0
     self.sub = []
     #self.root = Namespace()
     self.root = namespace.root()
     #self.root.enter()
     for t in ('int', 'float', 'double', 'char', 'wchar_t'):
         #self[tuple(tokenize(t))] = 'type'
         #Namespace.current().add_type(('symbol', t))
         namespace.add_type((('symbol', t),))
     #print self
     #print str(namespace.current())
     while start < len(lines):
         statement, start = Cpp.parse(self, lines, start, 0)
         self.sub.append(statement)
     namespace.leave(self.root)
Ejemplo n.º 2
0
 def post_sub(self):
     #print "POST SUB FuncDeclStatement"
     namespace.leave(self.ns)
Ejemplo n.º 3
0
 def post_sub(self):
     #print "POST SUB VarDeclAnonStrucStatement"
     #self.ns.leave()
     namespace.leave(self.ns)
Ejemplo n.º 4
0
 def post_sub(self):
     namespace.leave(self.ns)
Ejemplo n.º 5
0
 def post_sub(self):
     #print "POST SUB TypedefStructStatement"
     #self.ns.leave()
     namespace.leave(self.ns)
Ejemplo n.º 6
0
Archivo: parser.py Proyecto: bl0b/cppy
 def struc_decl_leave(self, ast):
     ns.leave(self.ns)
     print "Leaving struct/union/class"
     return True
Ejemplo n.º 7
0
Archivo: parser.py Proyecto: bl0b/cppy
 def namespace_leave(self, ast):
     ns.leave(self.ns)
     print "Leaving namespace"
     return True