Ejemplo n.º 1
0
	def __init__(self, struct, fields, value):
		self.struct = struct
		self.fields = fields
		self.value = value
		
		self.needs = needs(value)
		if fields:
			self.needs.update(needs(struct))
Ejemplo n.º 2
0
	def __init__(self, name, args, assigns, expr):
		self.args = args
		self.assigns = assigns
		self.expr = expr
		self.name = name
		
		self.needs = set()
		
		already_defined = set(args)
		if name:
			already_defined.add(name)
		
		for assign in self.assigns:
			for need in needs(assign):
				if need not in already_defined:
					self.needs.add(need)
			already_defined.add(assign.name)
		for need in needs(expr):
			if need not in already_defined:
				self.needs.add(need)
Ejemplo n.º 3
0
	def __init__(self, *args, **kwargs):
		super(structure, self).__init__(*args, **kwargs)
		self.needs = set().union(*map(lambda k: needs(self[k]), list(self)))
Ejemplo n.º 4
0
	def __init__(self, function_expr, act_args):
		self.function_expr = function_expr
		self.act_args = act_args
		
		self.needs = needs(function_expr).union(*map(needs, act_args))
Ejemplo n.º 5
0
	def __init__(self, condition, if_true, if_false):
		self.condition = condition
		self.if_true = if_true
		self.if_false = if_false
		self.needs = needs(condition) | needs(if_true) | needs(if_false)
Ejemplo n.º 6
0
	def __init__(self, struct, field_name):
		self.struct = struct
		self.field_name = field_name
		self.needs = needs(struct)
Ejemplo n.º 7
0
	def __init__(self, value):
		self.value = value
		self.needs = needs(value)
Ejemplo n.º 8
0
	def __init__(self, v1, v2):
		self.v1 = v1
		self.v2 = v2
		self.needs = needs(v1) | needs(v2)