def setmember(line): id = lexer.getident(line) if not vclass.has_key(id): # either a global (static) variable or an error if not lexer.isstatic(line): print "* member", id, "not in directory" return line classname = vclass[id] member = lexer.makemethod(line, classname) #print "line", line j = string.find(member, "=") if j != -1: id = member[:j] + ";" else: id = member if DEBUG: print "definition:", id return member # A definition of an attribute
def setmethod(line): id = lexer.getident(line) # Is it in the dictionary of classes as a method? if not fclass.has_key(id): print "* method", id, "not in directory" return line, "" classname = fclass[id] # Is it a function? if not lexer.isfunction(line): print "Error,", line, "not a function" sys.exit(0) method = lexer.makemethod(line, classname) #print "line", line if DEBUG: print "method:", method method = lexer.removestatic(method) return method, classname # Adding tail part, returning also class