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)
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()
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
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
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)
def pre_sub(self): self.ns = namespace.enter(self.name)
def namespace_enter(self, ast): print "Entering namespace", ast[2][1] self.ns = ns.enter(ast[2][1]) return True