Build a ANode from self

Allows the creation of an AST node from a model entity.

Property definitions

nitc :: astbuilder $ MEntity :: create_ast_representation
	# Build a ANode from `self`
	#
	# Allows the creation of an AST node from a model entity.
	fun create_ast_representation(astbuilder: nullable ASTBuilder): ANode is abstract
src/astbuilder.nit:950,2--953,82

nitc :: astbuilder $ MParameter :: create_ast_representation
	redef fun create_ast_representation(astbuilder: nullable ASTBuilder): AParam do
		var variable = new Variable(self.name)
		variable.declared_type = self.mtype
		return new AParam.make(variable, self.mtype.create_ast_representation(astbuilder))
	end
src/astbuilder.nit:1018,2--1022,4

nitc :: astbuilder $ MClassDef :: create_ast_representation
	redef fun create_ast_representation(astbuilder: nullable ASTBuilder): AStdClassdef do
		if astbuilder == null then astbuilder = new ASTBuilder(mmodule)
		var n_propdefs = new Array[APropdef]
		for mpropdef in self.mpropdefs do
			n_propdefs.add(mpropdef.create_ast_representation(astbuilder))
		end
		var n_formaldefs = new Array[AFormaldef]
		for mparameter in self.mclass.mparameters do n_formaldefs.add(mparameter.create_ast_representation(astbuilder))

		return astbuilder.make_class(self, visibility.create_ast_representation(astbuilder), n_formaldefs, null, n_propdefs, null)
	end
src/astbuilder.nit:961,2--971,4

nitc :: astbuilder $ MType :: create_ast_representation
	redef fun create_ast_representation(astbuilder: nullable ASTBuilder): AType do
		return new AType.make(self)
	end
src/astbuilder.nit:1033,2--1035,4

nitc :: astbuilder $ MPropDef :: create_ast_representation
	redef fun create_ast_representation(astbuilder: nullable ASTBuilder): APropdef is abstract
src/astbuilder.nit:957,2--91

nitc :: astbuilder $ MSignature :: create_ast_representation
	redef fun create_ast_representation(astbuilder: nullable ASTBuilder): ASignature do
		var nparams = new Array[AParam]
		for mparam in mparameters do nparams.add(mparam.create_ast_representation(astbuilder))
		var return_type = null
		if self.return_mtype != null then return_type = self.return_mtype.create_ast_representation(astbuilder)
		return new ASignature.init_asignature(null, nparams, null, return_type)
	end
src/astbuilder.nit:1008,2--1014,4

nitc :: astbuilder $ MParameterType :: create_ast_representation
	redef fun create_ast_representation(astbuilder: nullable ASTBuilder): AFormaldef do
		var n_type = super
		return new AFormaldef.make(self, n_type)
	end
src/astbuilder.nit:1026,2--1029,4

nitc :: astbuilder $ MAttributeDef :: create_ast_representation
	redef fun create_ast_representation(astbuilder: nullable ASTBuilder): AAttrPropdef do
		if astbuilder == null then astbuilder = new ASTBuilder(mclassdef.mmodule)
		var ntype = null
		if self.static_mtype != null then ntype = static_mtype.create_ast_representation(astbuilder)
		return astbuilder.make_attribute("_" + self.name, ntype, self.visibility.create_ast_representation(astbuilder), null, null, self, null, null)
	end
src/astbuilder.nit:975,2--980,4

nitc :: astbuilder $ MMethodDef :: create_ast_representation
	redef fun create_ast_representation(astbuilder: nullable ASTBuilder): AMethPropdef do
		if astbuilder == null then astbuilder = new ASTBuilder(mclassdef.mmodule)
		var tk_redef = null
		if self.mproperty.intro != self then tk_redef = new TKwredef
		var  n_signature = if self.msignature == null then new ASignature else self.msignature.create_ast_representation(astbuilder)
		return astbuilder.make_method(visibility.create_ast_representation(astbuilder), tk_redef, self, n_signature)
	end
src/astbuilder.nit:984,2--990,4