self
Allows the creation of an AST node from a model entity.
# 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:961,2--964,82
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:972,2--982,4
redef fun create_ast_representation(astbuilder: nullable ASTBuilder): AType do
return new AType.make(self)
end
src/astbuilder.nit:1044,2--1046,4
redef fun create_ast_representation(astbuilder: nullable ASTBuilder): APropdef is abstract
src/astbuilder.nit:968,2--91
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:1019,2--1025,4
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:1037,2--1040,4
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:986,2--991,4
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:995,2--1001,4