def visitMacroEnd(self, node, env): if self.inDef: Macro.endMacro() node.nodetype = "None" node.data = [] self.inDef = False elif not self.nestedError: Err.log("Unmatched .macend")
def visitMacroBegin(self, node, env): if self.inDef: Err.log("Nested macro definition") self.nestedError = True else: Macro.newMacro(node.data[0]) node.nodetype = "None" node.data = [] self.inDef = True
def visitMacroInvoke(self, node, env): replacement = Macro.expandMacro(node.ppt, node.data[0], node.data[1:]) node.nodetype = replacement.nodetype node.data = replacement.data self.changed = True
def visitUnknown(self, node, env): if self.inDef: Macro.registerNode(node) node.nodetype = "None" node.data = []
def postPass(self): if self.inDef: Err.log("Unmatched .macro") elif Cmd.print_ir: print>>sys.stderr, "Macro definitions:" Macro.dump()
def postPass(self): if self.inDef: Err.log("Unmatched .macro") elif Cmd.verbose > 2: print "Macro definitions:" Macro.dump()