MCPcopy Create free account
hub / github.com/dabeaz/python-cookbook / binop

Method binop

src/8/implementing_the_visitor_pattern/example.py:80–83  ·  view source on GitHub ↗
(self, node, instruction)

Source from the content-addressed store, hash-verified

78 self.instructions.append(('PUSH', node.value))
79
80 def binop(self, node, instruction):
81 self.visit(node.left)
82 self.visit(node.right)
83 self.instructions.append((instruction,))
84
85 def visit_Add(self, node):
86 self.binop(node, 'ADD')

Callers 4

visit_AddMethod · 0.95
visit_SubMethod · 0.95
visit_MulMethod · 0.95
visit_DivMethod · 0.95

Calls 1

visitMethod · 0.45

Tested by

no test coverage detected