Lines Matching refs:macros
718 def optimize_node(self, e, macros=None): argument
719 if macros is None:
720 macros = {}
725 if macros.has_key(name):
726 if macros[name] == kCppUndefinedMacro:
730 value = int(macros[name])
733 return ("defined", macros[name])
742 if macros.has_key(name):
744 value = int(macros[name])
747 expanded = ("ident", macros[name])
748 return self.optimize_node(expanded, macros)
753 v = self.optimize_node(v, macros)
763 l = self.optimize_node(l, macros)
764 r = self.optimize_node(r, macros)
781 l = self.optimize_node(l, macros)
782 r = self.optimize_node(r, macros)
800 def optimize(self, macros=None): argument
801 if macros is None:
802 macros = {}
803 self.expr = self.optimize_node(self.expr, macros)
838 def get_expr_optimize(self, expr, macros=None): argument
839 if macros is None:
840 macros = {}
842 e.optimize(macros)
1192 def optimizeMacros(self, macros): argument
1196 b.expr.optimize(macros)
1244 def optimizeAll(self, macros): argument
1245 self.optimizeMacros(macros)
1295 macros = set()
1303 macros.add(macro_name)
1305 macros.add(macro_name[0:paren_index])
1349 block.tokens[i-1].id in macros):
1798 def parse(self, text, macros=None): argument
1801 blocks.optimizeAll(macros)
1952 macros = {"__KERNEL__": kCppUndefinedMacro}
1953 self.assertEqual(self.parse(text, macros), expected)
1966 macros = {"__KERNEL__": kCppUndefinedMacro}
1967 self.assertEqual(self.parse(text, macros), expected)