Property definitions

nitc $ TestModelVisitor :: defaultinit
# Example visitor that just count kind of entities.
class TestModelVisitor
	super ModelVisitor

	redef fun visit(e) do
		cpt.inc(e.class_name)

		if not e isa Model then
			var name = e.full_name
			var old = names.get_or_null(name)
			if old != null then
				names[name + "!CONFLICT!" + old.class_name] = old
				name = name + "!CONFLICT!" + e.class_name
			end
			names[name] = e
		end

		e.visit_all(self)
	end

	# Counter of visited entities (by classnames)
	var cpt = new Counter[String]

	# Dictionary of full_names
	var names = new Map[String, MEntity]
end
src/test_model_visitor.nit:23,1--48,3