예제 #1
0
 def filter(self):
     if self.name.generate_code() in scope.get_available_types():
         return True
     if self.name.generate_code() in scope.get_available_variables():
         return True
     if self.name.generate_code() in scope.get_available_states():
         return True
     return False
예제 #2
0
	def randomize(self):
		common.usedRandomize()
		while True:
			self.type_ref = type_ref(force_type=0)
			self.type_ref.randomize()
			available_variables = scope.get_available_variables(only_types=self.type_ref.get_ref_type())
			if len(available_variables):
				self.lvalue = available_variables.keys()[randomizer.randint(0, len(available_variables) - 1)]
				self.expression = self.type_ref.value.generate_literal()
				if not self.filter():
					break
예제 #3
0
 def filter(self):
     from header_type_declaration import header_type_declaration
     from struct_type_declaration import struct_type_declaration
     if self.type_ref.get_type() == 'specializedType':
         return True
     if self.type_ref.get_type() == 'headerStackType':
         return True
     if self.name.generate_code() in scope.get_available_types(
     ) or self.name.generate_code() in scope.get_available_variables():
         return True
     if isinstance(self.fromObj, header_type_declaration):
         if self.type_ref.get_ref_type(
         ) in self.__class__.header_banned_types:
             return True
     return False
예제 #4
0
	def filter(self):
		if self.non_type_name is not None and self.non_type_name.generate_code() in scope.get_available_types() or self.non_type_name.generate_code() in scope.get_available_variables():
			return True
		if self.opt_type_parameters.type_parameter_list is not None:
			for parameter in self.opt_type_parameters.type_parameter_list.parameter_list:
				if parameter.generate_code() in scope.get_available_types() or parameter.generate_code() in scope.get_available_variables():
					return True
		return False
예제 #5
0
	def filter(self):
		if self.type_ref.get_type() == "baseType":
			return True
		if self.type_ref.get_type() == "typeName":
			if self.type_ref.get_ref_type() == "extern":
				return True
		if self.type_ref.get_type() == "specializedType":
			return True
		if self.type_ref.get_type() == "headerStackType":
			return True
		if self.name.generate_code() in scope.get_available_types() or self.name.generate_code() in scope.get_available_variables():
			return True
		return False