Exemplo n.º 1
0
 def pre_sub(self):
     #print "PRE SUB FuncDeclStatement"
     self.ns = namespace.enter(self.ns_name, key='function')
     self.commit_template_args()
     for p in self.params:
         VarDeclStatement('', self, p.children).commit()
     namespace.add_func((('symbol', self.ns_name),), self.params, self)
Exemplo n.º 2
0
 def pre_sub(self):
     #print "PRE SUB VarDeclAnonStrucStatement"
     #self.ns_name = anon()
     #self.ns = Namespace(self.ns_name, Namespace.current())
     self.type = (('symbol', self.ns_name),)
     namespace.add_type(self.type, ns=self.ns_name)
     self.ns = namespace.enter(self.ns_name, key=self.ns_key)
     self.commit_template_args()
Exemplo n.º 3
0
 def validate(cls, scope, C, text, captures):
     print "     validating", C, text, scope, captures
     try:
         tmp = namespace.enter(anon())
         C(text, scope, captures)
     except InvalidStatement, ista:
         namespace.delete(tmp)
         return None
Exemplo n.º 4
0
Arquivo: parser.py Projeto: bl0b/cppy
 def struc_decl_enter(self, ast):
     key = ast[1][1]
     if len(ast) == 4:
         tag = ast[2][1]
     else:
         tag = make_anon()
     print "Entering", key, tag
     self.ns = ns.enter(tag, key=key)
     return True
Exemplo n.º 5
0
 def pre_sub(self):
     #print "PRE SUB TypedefStructStatement", self.key, self.tid_name,
     #print self.tid
     self.ns = namespace.enter(self.tid_name, key=self.key)
     self.commit_template_args()
     #Namespace.current().add_namespace(self.ns)
     #self.ns.enter()
     self.container.add_type(self.tid,
                             key=self.key, ns=self.tid)
     self.ns.add_type(self.tid, key=self.key, ns=self.tid)
Exemplo n.º 6
0
 def pre_sub(self):
     self.ns = namespace.enter(self.name)
Exemplo n.º 7
0
Arquivo: parser.py Projeto: bl0b/cppy
 def namespace_enter(self, ast):
     print "Entering namespace", ast[2][1]
     self.ns = ns.enter(ast[2][1])
     return True