示例#1
0
文件: Passes.py 项目: cjhurst/Ophis
 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")
示例#2
0
文件: Passes.py 项目: cjhurst/Ophis
 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
示例#3
0
文件: Passes.py 项目: cjhurst/Ophis
 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
示例#4
0
文件: Passes.py 项目: cjhurst/Ophis
 def visitUnknown(self, node, env):
     if self.inDef:
         Macro.registerNode(node)
         node.nodetype = "None"
         node.data = []
示例#5
0
文件: Passes.py 项目: cjhurst/Ophis
 def postPass(self):
     if self.inDef:
         Err.log("Unmatched .macro")
     elif Cmd.print_ir:
         print>>sys.stderr, "Macro definitions:"
         Macro.dump()
示例#6
0
文件: Passes.py 项目: cbmeeks/Ophis
 def postPass(self):
     if self.inDef:
         Err.log("Unmatched .macro")
     elif Cmd.print_ir:
         print>>sys.stderr, "Macro definitions:"
         Macro.dump()
示例#7
0
	def postPass(self):
		if self.inDef:
			Err.log("Unmatched .macro")
		elif Cmd.verbose > 2:
			print "Macro definitions:"
			Macro.dump()