Build a NeoNode representing self.

Property definitions

nitc :: neo $ MEntity :: to_node
	# Build a `NeoNode` representing `self`.
	private fun to_node(nodes: HashMap[MEntity, NeoNode], model_name: nullable String): NeoNode do
		if nodes.has_key(self) then return nodes[self]
		var node = make_node(nodes, model_name)
		node.labels.add self.class_name
		return node
	end
src/neo.nit:988,2--994,4

nitc :: neo $ MClass :: to_node
	redef fun to_node(nodes: HashMap[MEntity, NeoNode], model_name: nullable String): NeoNode do
		if nodes.has_key(self) then return nodes[self]
		var node = super
		node["kind"] = kind.to_s
		node["visibility"] = visibility.to_s
		if not mparameters.is_empty then
			var parameter_names = new Array[String]
			for p in mparameters do parameter_names.add(p.name)
			node["parameter_names"] = new JsonArray.from(parameter_names)
		end
		node.out_edges.add(new NeoEdge(node, "CLASSTYPE", mclass_type.to_node(nodes, model_name)))
		return node
	end
src/neo.nit:734,2--746,4

nitc :: neo $ MParameter :: to_node
	redef fun to_node(nodes: HashMap[MEntity, NeoNode], model_name: nullable String): NeoNode do
		if nodes.has_key(self) then return nodes[self]
		var node = super
		node["name"] = self.name
		node["is_vararg"] = self.is_vararg
		node.out_edges.add(new NeoEdge(node, "TYPE", self.mtype.to_node(nodes, model_name)))
		return node
	end
src/neo.nit:870,2--877,4

nitc :: neo $ MTypePart :: to_node
	redef fun to_node(nodes: HashMap[MEntity, NeoNode], model_name: nullable String): NeoNode do
		if nodes.has_key(self) then return nodes[self]
		var node = super
		if self.target != null then
			var target_node = self.target.as(not null).to_node(nodes, model_name)
			node.out_edges.add(new NeoEdge(node, "TARGET", target_node))
		end
		return node
	end
src/neo.nit:858,2--866,4

nitc :: neo $ MClassDef :: to_node
	redef fun to_node(nodes: HashMap[MEntity, NeoNode], model_name: nullable String): NeoNode do
		if nodes.has_key(self) then return nodes[self]
		var node = super
		node.out_edges.add(new NeoEdge(node, "BOUNDTYPE", bound_mtype.to_node(nodes, model_name)))
		node.out_edges.add(new NeoEdge(node, "MCLASS", mclass.to_node(nodes, model_name)))
		for mproperty in intro_mproperties do
			node.out_edges.add(new NeoEdge(node, "INTRODUCES", mproperty.to_node(nodes, model_name)))
		end
		for mpropdef in mpropdefs do
			node.out_edges.add(new NeoEdge(node, "DECLARES", mpropdef.to_node(nodes, model_name)))
		end
		for sup in supertypes do
			node.out_edges.add(new NeoEdge(node, "INHERITS", sup.to_node(nodes, model_name)))
		end
		return node
	end
src/neo.nit:750,2--765,4

nitc :: neo $ MPackage :: to_node
	redef fun to_node(nodes: HashMap[MEntity, NeoNode], model_name: nullable String): NeoNode do
		if nodes.has_key(self) then return nodes[self]
		var node = super
		var root = root
		if root != null then
			node.out_edges.add(new NeoEdge(node, "ROOT", root.to_node(nodes, model_name)))
		end
		return node
	end
src/neo.nit:686,2--694,4

nitc :: neo $ MGroup :: to_node
	redef fun to_node(nodes: HashMap[MEntity, NeoNode], model_name: nullable String): NeoNode do
		if nodes.has_key(self) then return nodes[self]
		var node = super
		var parent = parent
		node.out_edges.add(new NeoEdge(node, "PROJECT", mpackage.to_node(nodes, model_name)))
		if parent != null then
			node.out_edges.add(new NeoEdge(node, "PARENT", parent.to_node(nodes, model_name)))
		end
		for mmodule in mmodules do
			node.out_edges.add(new NeoEdge(node, "DECLARES", mmodule.to_node(nodes, model_name)))
		end
		for subgroup in in_nesting.direct_smallers do
			node.in_edges.add(new NeoEdge(node, "NESTS", subgroup.to_node(nodes, model_name)))
		end
		return node
	end
src/neo.nit:698,2--713,4

nitc :: neo $ MType :: to_node
	redef fun to_node(nodes: HashMap[MEntity, NeoNode], model_name: nullable String): NeoNode do
		if nodes.has_key(self) then return nodes[self]
		var node = make_node(nodes, model_name)
		node.labels.add "MType"
		return node
	end
src/neo.nit:979,2--984,4

nitc :: neo $ MProperty :: to_node
	redef fun to_node(nodes: HashMap[MEntity, NeoNode], model_name: nullable String): NeoNode do
		if nodes.has_key(self) then return nodes[self]
		var node = make_node(nodes, model_name)
		node.labels.add "MProperty"
		node["visibility"] = visibility.to_s
		node.out_edges.add(new NeoEdge(node, "INTRO_CLASSDEF", intro_mclassdef.to_node(nodes, model_name)))
		node.labels.add self.class_name
		return node
	end
src/neo.nit:769,2--777,4

nitc :: neo $ MPropDef :: to_node
	redef fun to_node(nodes: HashMap[MEntity, NeoNode], model_name: nullable String): NeoNode do
		if nodes.has_key(self) then return nodes[self]
		var node = make_node(nodes, model_name)
		node.labels.add "MPropDef"
		node.out_edges.add(new NeoEdge(node, "DEFINES", mproperty.to_node(nodes, model_name)))
		node.labels.add self.class_name
		return node
	end
src/neo.nit:799,2--806,4

nitc :: neo $ MModule :: to_node
	redef fun to_node(nodes: HashMap[MEntity, NeoNode], model_name: nullable String): NeoNode do
		if nodes.has_key(self) then return nodes[self]
		var node = super
		for parent in in_importation.direct_greaters do
			node.out_edges.add(new NeoEdge(node, "IMPORTS", parent.to_node(nodes, model_name)))
		end
		for mclass in intro_mclasses do
			node.out_edges.add(new NeoEdge(node, "INTRODUCES", mclass.to_node(nodes, model_name)))
		end
		for mclassdef in mclassdefs do
			node.out_edges.add(new NeoEdge(node, "DEFINES", mclassdef.to_node(nodes, model_name)))
		end
		return node
	end
src/neo.nit:717,2--730,4

nitc :: neo $ MClassType :: to_node
	redef fun to_node(nodes: HashMap[MEntity, NeoNode], model_name: nullable String): NeoNode do
		if nodes.has_key(self) then return nodes[self]
		var node = super
		node.labels.add "MClassType"
		node.out_edges.add(new NeoEdge(node, "CLASS", mclass.to_node(nodes, model_name)))
		for arg in arguments do
			node.out_edges.add(new NeoEdge(node, "ARGUMENT", arg.to_node(nodes, model_name)))
		end
		return node
	end
src/neo.nit:881,2--890,4

nitc :: neo $ MSignature :: to_node
	redef fun to_node(nodes: HashMap[MEntity, NeoNode], model_name: nullable String): NeoNode do
		if nodes.has_key(self) then return nodes[self]
		var node = super
		node.labels.add "MSignature"
		var names = new JsonArray
		var rank = 0
		for mparameter in mparameters do
			names.add mparameter.name
			var pnode = mparameter.to_node(nodes, model_name)
			pnode["rank"] = rank
			node.out_edges.add(new NeoEdge(node, "PARAMETER", pnode))
			rank += 1
		end
		if not names.is_empty then node["parameter_names"] = names
		var return_mtype = return_mtype
		if return_mtype != null then
			node.out_edges.add(new NeoEdge(node, "RETURNTYPE", return_mtype.to_node(nodes, model_name)))
		end
		return node
	end
src/neo.nit:935,2--954,4

nitc :: neo $ MInnerClass :: to_node
	redef fun to_node(nodes: HashMap[MEntity, NeoNode], model_name: nullable String): NeoNode do
		if nodes.has_key(self) then return nodes[self]
		var node = super
		node.out_edges.add(new NeoEdge(node, "NESTS", inner.to_node(nodes, model_name)))
		return node
	end
src/neo.nit:790,2--795,4

nitc :: neo $ MRawType :: to_node
	redef fun to_node(nodes: HashMap[MEntity, NeoNode], model_name: nullable String): NeoNode do
		if nodes.has_key(self) then return nodes[self]
		var node = super
		node.labels.add "MRawType"
		var text = new JsonArray
		var rank = 0
		for part in self.parts do
			text.add part.text
			if part.target != null then
				var pnode = part.to_node(nodes, model_name)
				pnode["rank"] = rank
				node.out_edges.add(new NeoEdge(node, "LINK", pnode))
			end
			rank += 1
		end
		if not text.is_empty then node["text"] = text
		return node
	end
src/neo.nit:958,2--975,4

nitc :: neo $ MGenericType :: to_node
	redef fun to_node(nodes: HashMap[MEntity, NeoNode], model_name: nullable String): NeoNode do
		if nodes.has_key(self) then return nodes[self]
		var node = super
		node.labels.add "MGenericType"
		return node
	end
src/neo.nit:895,2--900,4

nitc :: neo $ MVirtualType :: to_node
	redef fun to_node(nodes: HashMap[MEntity, NeoNode], model_name: nullable String): NeoNode do
		if nodes.has_key(self) then return nodes[self]
		var node = super
		node.labels.add "MVirtualType"
		node.out_edges.add(new NeoEdge(node, "PROPERTY", mproperty.to_node(nodes, model_name)))
		return node
	end
src/neo.nit:904,2--910,4

nitc :: neo $ MParameterType :: to_node
	redef fun to_node(nodes: HashMap[MEntity, NeoNode], model_name: nullable String): NeoNode do
		if nodes.has_key(self) then return nodes[self]
		var node = super
		node.labels.add "MParameterType"
		node["rank"] = rank
		node.out_edges.add(new NeoEdge(node, "CLASS", mclass.to_node(nodes, model_name)))
		return node
	end
src/neo.nit:914,2--921,4

nitc :: neo $ MNullableType :: to_node
	redef fun to_node(nodes: HashMap[MEntity, NeoNode], model_name: nullable String): NeoNode do
		if nodes.has_key(self) then return nodes[self]
		var node = super
		node.labels.add "MNullableType"
		node.out_edges.add(new NeoEdge(node, "TYPE", mtype.to_node(nodes, model_name)))
		return node
	end
src/neo.nit:925,2--931,4

nitc :: neo $ MMethod :: to_node
	redef fun to_node(nodes: HashMap[MEntity, NeoNode], model_name: nullable String): NeoNode do
		if nodes.has_key(self) then return nodes[self]
		var node = super
		node["is_init"] = is_init
		return node
	end
src/neo.nit:781,2--786,4

nitc :: neo $ MAttributeDef :: to_node
	redef fun to_node(nodes: HashMap[MEntity, NeoNode], model_name: nullable String): NeoNode do
		if nodes.has_key(self) then return nodes[self]
		var node = super
		var static_mtype = static_mtype
		if static_mtype != null then
			node.out_edges.add(new NeoEdge(node, "TYPE", static_mtype.to_node(nodes, model_name)))
		end
		return node
	end
src/neo.nit:825,2--833,4

nitc :: neo $ MVirtualTypeDef :: to_node
	redef fun to_node(nodes: HashMap[MEntity, NeoNode], model_name: nullable String): NeoNode do
		if nodes.has_key(self) then return nodes[self]
		var node = super
		var bound = bound
		if bound != null then
			node.out_edges.add(new NeoEdge(node, "BOUND", bound.to_node(nodes, model_name)))
		end
		return node
	end
src/neo.nit:837,2--845,4

nitc :: neo $ MInnerClassDef :: to_node
	redef fun to_node(nodes: HashMap[MEntity, NeoNode], model_name: nullable String): NeoNode do
		if nodes.has_key(self) then return nodes[self]
		var node = super
		node.out_edges.add(new NeoEdge(node, "NESTS", inner.to_node(nodes, model_name)))
		return node
	end
src/neo.nit:849,2--854,4

nitc :: neo $ MMethodDef :: to_node
	redef fun to_node(nodes: HashMap[MEntity, NeoNode], model_name: nullable String): NeoNode do
		if nodes.has_key(self) then return nodes[self]
		var node = super
		node["is_abstract"] = is_abstract
		node["is_intern"] = is_intern
		node["is_extern"] = is_extern
		var msignature = msignature
		if msignature != null then
			node.out_edges.add(new NeoEdge(node, "SIGNATURE", msignature.to_node(nodes, model_name)))
		end
		return node
	end
src/neo.nit:810,2--821,4