def all_children(flag=nil)
		also_foreign = (flag==:also_foreign)
		arr = []
		ecore = self.class.ecore
		# Awful hack to forbid the same reference is visited twice when
		# two references with the same name are found
		already_used_references = []
		ecore.eAllReferences.sort_by{|r| r.name}.select {|r| r.containment}.each do |ref|
			unless already_used_references.include?(ref.name)
				res = self.send(ref.name.to_sym)
				if ref.many
					d = arr.count
					res.each do |el|
						arr << el unless res==nil
					end
				elsif res!=nil
					d = arr.count
					arr << res
				end
				already_used_references << ref.name
			end
		end
		if also_foreign
			arr.concat(self.foreign_asts)
		end
		arr
	end
def all_children(flag=nil)
		also_foreign = (flag==:also_foreign)
		arr = []
		ecore = self.class.ecore
		# Awful hack to forbid the same reference is visited twice when
		# two references with the same name are found
		already_used_references = []
		ecore.eAllReferences.sort_by{|r| r.name}.select {|r| r.containment}.each do |ref|
			unless already_used_references.include?(ref.name)
				res = self.send(ref.name.to_sym)
				if ref.many
					d = arr.count
					res.each do |el|
						arr << el unless res==nil
					end
				elsif res!=nil
					d = arr.count
					arr << res
				end
				already_used_references << ref.name
			end
		end
		if also_foreign
			arr.concat(self.foreign_asts)
		end
		arr
	end
All direct children