nitc :: AStdClassdef
nitc :: AStdClassdef :: _n_classkind
The class kind (interface, abstract class, etc.)nitc :: AStdClassdef :: _n_extern_code_block
The extern block codenitc :: AStdClassdef :: _n_formaldefs
The list of formal parameter typesnitc :: AStdClassdef :: defaultinit
nitc :: AStdClassdef :: how_serialize
Is this classed markedserialize
? in part or fully?
nitc :: AStdClassdef :: make
nitc :: AStdClassdef :: n_classkind
The class kind (interface, abstract class, etc.)nitc :: AStdClassdef :: n_classkind=
The class kind (interface, abstract class, etc.)nitc :: AStdClassdef :: n_extern_code_block
The extern block codenitc :: AStdClassdef :: n_extern_code_block=
The extern block codenitc :: AStdClassdef :: n_formaldefs
The list of formal parameter typesnitc :: AStdClassdef :: n_formaldefs=
The list of formal parameter typesnitc :: AStdClassdef :: n_superclasses
nitc $ AStdClassdef :: SELF
Type of this instance, automatically specialized in every classnitc :: pretty $ AStdClassdef :: accept_pretty_printer
Start visit ofself
using a PrettyPrinterVisitor
nitc :: htmlight $ AStdClassdef :: decorate_tag
Add aditionnal information on a child-token and return an additionnal HInfoBox on itnitc $ AStdClassdef :: hot_location
The location of the important part of the node (identifier or whatever)nitc :: pretty $ AStdClassdef :: is_inlinable
Isself
printable in one line?
nitc :: htmlight $ AStdClassdef :: make_tag
Optionally creates a tag that encapsulate the AST element on HTML renderingnitc :: parser_prod $ AStdClassdef :: n_classkind=
The class kind (interface, abstract class, etc.)nitc :: parser_prod $ AStdClassdef :: n_doc=
The documentationnitc :: parser_prod $ AStdClassdef :: n_extern_code_block=
The extern block codenitc :: parser_prod $ AStdClassdef :: n_kwredef=
Theredef
keyword
nitc :: parser_prod $ AStdClassdef :: n_qid=
The name of the classnitc :: parser_prod $ AStdClassdef :: n_visibility=
The declared visibilitynitc :: parser_prod $ AStdClassdef :: replace_child
Replace a child with an other node in the ASTnitc :: pretty $ AStdClassdef :: start_token
The token where the production really start (skipping ADoc).nitc :: parser_prod $ AStdClassdef :: visit_all
Visit all nodes in order.nitc :: AClassdef :: _build_properties_is_done
Marker used inModelBuilder::build_properties
nitc :: Prod :: _first_location
Location on the first token after the start of a productionnitc :: Prod :: _first_token
The first token of the production in the ASTnitc :: ANode :: _is_broken
The indication that the node did not pass some semantic verifications.nitc :: Prod :: _last_token
The last token of the production in the ASTnitc :: AClassdef :: _mclassdef
The associated MClassDef once build by aModelBuilder
nitc :: Prod :: _n_annotations
All the annotations attached directly to the nodenitc :: AStdClassdef :: _n_classkind
The class kind (interface, abstract class, etc.)nitc :: AStdClassdef :: _n_extern_code_block
The extern block codenitc :: AStdClassdef :: _n_formaldefs
The list of formal parameter typesnitc :: AClassdef :: _n_propdefs
All the declared properties (including the main method)nitc :: ADefinition :: _n_visibility
The declared visibilitynitc :: ANode :: accept_ast_validation
nitc :: ANode :: accept_auto_super_init
nitc :: ANode :: accept_flow_visitor
nitc :: ANode :: accept_forward_analysis
Apply the forward analysisv
to self
.
nitc :: ANode :: accept_literal
nitc :: ANode :: accept_post_typing
nitc :: ANode :: accept_pretty_printer
Start visit ofself
using a PrettyPrinterVisitor
nitc :: ANode :: accept_reaching_defs
Apply a ReachingDefsAnalysis toself
.
nitc :: ANode :: accept_regex_visitor
nitc :: ANode :: accept_scope_visitor
nitc :: ANode :: accept_simple_misc
nitc :: ANode :: accept_string_finder
nitc :: ANode :: after_simple_misc
nitc :: ANode :: bad_expr_message
An additional information message to explain the role of a child expression.nitc :: AClassdef :: build_properties_is_done
Marker used inModelBuilder::build_properties
nitc :: AClassdef :: build_properties_is_done=
Marker used inModelBuilder::build_properties
mpropdef
associated with the current node.
nitc :: ANode :: check_callsite
core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
nitc :: ANode :: collect_annotations_by_name
Do a deep search and return an array of node that are annotatednitc :: Prod :: collect_comments
Collect allTComment
contained in the production
nitc :: ANode :: collect_length
Collect the length (inChar
) of the node.
nitc :: ANode :: collect_tokens_by_text
Do a deep search and return an array of tokens that match a given textnitc :: ANode :: common_parent
The most specific common parent betweenself
and other
nitc :: AClassdef :: compile_to_c
nitc :: AClassdef :: compile_to_java
nitc :: ANode :: create_contracts
nitc :: ANode :: decorate_tag
Add aditionnal information on a child-token and return an additionnal HInfoBox on itnitc :: AClassdef :: defaultinit
nitc :: Prod :: defaultinit
nitc :: AStdClassdef :: defaultinit
core :: Cloneable :: defaultinit
nitc :: ADefinition :: defaultinit
nitc :: ANode :: defaultinit
core :: Object :: defaultinit
nitc :: ANode :: do_cloneable
nitc :: Prod :: first_location
Location on the first token after the start of a productionnitc :: Prod :: first_location=
Location on the first token after the start of a productionnitc :: Prod :: first_token
The first token of the production in the ASTnitc :: Prod :: first_token=
The first token of the production in the ASTnitc :: ANode :: force_block=
Forceself
to be rendered as a block.
nitc :: ANode :: force_inline=
Forceself
to be rendered as a line.
nitc :: ANode :: full_transform_visitor
nitc :: Prod :: get_annotations
Return all its annotations of a given name in the order of their declarationnitc :: Prod :: get_single_annotation
Try to get its single annotation with a given namenitc :: ANode :: hot_location
The location of the important part of the node (identifier or whatever)nitc :: AStdClassdef :: how_serialize
Is this classed markedserialize
? in part or fully?
nitc :: ANode :: is_broken=
The indication that the node did not pass some semantic verifications.nitc :: ANode :: is_noserialize
Is this node annotated to not be made serializable?core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
nitc :: ANode :: is_serialize
Is this node annotated to be made serializable?nitc :: ANode :: is_structural
Isself
a token or a pure-structural production like AQId
?
nitc :: Prod :: last_token
The last token of the production in the ASTnitc :: Prod :: last_token=
The last token of the production in the ASTnitc :: AStdClassdef :: make
nitc :: AClassdef :: mclassdef=
The associated MClassDef once build by aModelBuilder
nitc :: ANode :: must_be_block
Doesself
have to be rendered as a block?
nitc :: ANode :: must_be_inline
Doesself
have be rendered as a line?
nitc :: Prod :: n_annotations
All the annotations attached directly to the nodenitc :: Prod :: n_annotations=
All the annotations attached directly to the nodenitc :: AStdClassdef :: n_classkind
The class kind (interface, abstract class, etc.)nitc :: AStdClassdef :: n_classkind=
The class kind (interface, abstract class, etc.)nitc :: AStdClassdef :: n_extern_code_block
The extern block codenitc :: AStdClassdef :: n_extern_code_block=
The extern block codenitc :: AStdClassdef :: n_formaldefs
The list of formal parameter typesnitc :: AStdClassdef :: n_formaldefs=
The list of formal parameter typesnitc :: AClassdef :: n_propdefs
All the declared properties (including the main method)nitc :: AClassdef :: n_propdefs=
All the declared properties (including the main method)nitc :: AStdClassdef :: n_superclasses
nitc :: ADefinition :: n_visibility=
The declared visibilitycore :: Object :: native_class_name
The class name of the object in CString format.core :: Object :: output_class_name
Display class name on stdout (debug only).nitc :: ANode :: parentize_tokens
Visit the AST and computes advanced AST attributes on Tokens and Prodnitc :: ANode :: replace_child
Replace a child with an other node in the ASTnitc :: ANode :: replace_with
Replace itself with an other node in the ASTnitc :: Prod :: start_token
The token where the production really start (skipping ADoc).nitc :: ANode :: was_inline
Doesself
was written in one line before transformation?
# A standard class definition with a name, superclasses and properties
class AStdClassdef
super AClassdef
super ADefinition
# The class kind (interface, abstract class, etc.)
var n_classkind: AClasskind is writable, noinit
# The name of the class
var n_qid: nullable AQclassid = null is writable
# The `[` symbol
var n_obra: nullable TObra = null is writable
# The list of formal parameter types
var n_formaldefs = new ANodes[AFormaldef](self)
# The `]` symbol
var n_cbra: nullable TCbra = null is writable
# The extern block code
var n_extern_code_block: nullable AExternCodeBlock = null is writable
# The `end` keyword
var n_kwend: TKwend is writable, noinit
fun n_superclasses: Array[ASuperPropdef] do
return [for d in n_propdefs do if d isa ASuperPropdef then d]
end
redef fun hot_location do return n_qid.location
end
src/parser/parser_nodes.nit:1247,1--1278,3
redef class AStdClassdef
init init_astdclassdef (
n_doc: nullable ADoc,
n_kwredef: nullable TKwredef,
n_visibility: nullable AVisibility,
n_classkind: nullable AClasskind,
n_qid: nullable AQclassid,
n_obra: nullable TObra,
n_formaldefs: Collection[Object], # Should be Collection[AFormaldef]
n_cbra: nullable TCbra,
n_extern_code_block: nullable AExternCodeBlock,
n_propdefs: Collection[Object], # Should be Collection[APropdef]
n_kwend: nullable TKwend
)
do
_n_doc = n_doc
if n_doc != null then n_doc.parent = self
_n_kwredef = n_kwredef
if n_kwredef != null then n_kwredef.parent = self
_n_visibility = n_visibility.as(not null)
n_visibility.parent = self
_n_classkind = n_classkind.as(not null)
n_classkind.parent = self
_n_qid = n_qid
if n_qid != null then n_qid.parent = self
_n_obra = n_obra
if n_obra != null then n_obra.parent = self
self.n_formaldefs.unsafe_add_all(n_formaldefs)
_n_cbra = n_cbra
if n_cbra != null then n_cbra.parent = self
_n_extern_code_block = n_extern_code_block
if n_extern_code_block != null then n_extern_code_block.parent = self
self.n_propdefs.unsafe_add_all(n_propdefs)
_n_kwend = n_kwend.as(not null)
n_kwend.parent = self
end
redef fun replace_child(old_child: ANode, new_child: nullable ANode)
do
if _n_doc == old_child then
n_doc = new_child.as(nullable ADoc)
return
end
if _n_kwredef == old_child then
n_kwredef = new_child.as(nullable TKwredef)
return
end
if _n_visibility == old_child then
n_visibility = new_child.as(AVisibility)
return
end
if _n_classkind == old_child then
n_classkind = new_child.as(AClasskind)
return
end
if _n_qid == old_child then
n_qid = new_child.as(nullable AQclassid)
return
end
if _n_obra == old_child then
n_obra = new_child.as(nullable TObra)
return
end
if n_formaldefs.replace_child(old_child, new_child) then return
if _n_cbra == old_child then
n_cbra = new_child.as(nullable TCbra)
return
end
if _n_extern_code_block == old_child then
n_extern_code_block = new_child.as(nullable AExternCodeBlock)
return
end
if n_propdefs.replace_child(old_child, new_child) then return
if _n_kwend == old_child then
n_kwend = new_child.as(TKwend)
return
end
end
redef fun n_doc=(node)
do
_n_doc = node
if node != null then node.parent = self
end
redef fun n_kwredef=(node)
do
_n_kwredef = node
if node != null then node.parent = self
end
redef fun n_visibility=(node)
do
_n_visibility = node
node.parent = self
end
redef fun n_classkind=(node)
do
_n_classkind = node
node.parent = self
end
redef fun n_qid=(node)
do
_n_qid = node
if node != null then node.parent = self
end
redef fun n_obra=(node)
do
_n_obra = node
if node != null then node.parent = self
end
redef fun n_cbra=(node)
do
_n_cbra = node
if node != null then node.parent = self
end
redef fun n_extern_code_block=(node)
do
_n_extern_code_block = node
if node != null then node.parent = self
end
redef fun n_kwend=(node)
do
_n_kwend = node
node.parent = self
end
redef fun visit_all(v: Visitor)
do
v.enter_visit(_n_doc)
v.enter_visit(_n_kwredef)
v.enter_visit(_n_visibility)
v.enter_visit(_n_classkind)
v.enter_visit(_n_qid)
v.enter_visit(_n_obra)
n_formaldefs.visit_all(v)
v.enter_visit(_n_cbra)
v.enter_visit(_n_extern_code_block)
n_propdefs.visit_all(v)
v.enter_visit(_n_kwend)
end
end
src/parser/parser_prod.nit:383,1--523,3
redef class AStdClassdef
redef fun accept_pretty_printer(v) do
v.visit n_doc
var can_inline = v.can_inline(self)
if not n_visibility isa APublicVisibility then
v.visit n_visibility
v.adds
end
if n_kwredef != null then
v.visit n_kwredef
v.adds
end
v.visit n_classkind
v.adds
v.visit n_qid
if not n_formaldefs.is_empty then
v.consume "["
v.visit_list n_formaldefs
v.consume "]"
end
if n_extern_code_block != null then
v.adds
v.visit n_extern_code_block
end
if can_inline then
v.adds
if not n_propdefs.is_empty then
for n_superclass in n_propdefs do
v.visit n_superclass
v.adds
end
end
else
v.finish_line
if v.skip_empty then v.addn
v.indent += 1
super
v.catch_up n_kwend
v.indent -= 1
end
v.visit n_kwend
v.finish_line
if v.skip_empty then v.addn
assert v.indent == 0
end
redef fun is_inlinable do
if not super then return false
# FIXME: repair pretty-printing one-liner classes
if n_propdefs.length > 0 then return false
#if n_propdefs.length == 1 and not n_propdefs.first isa ASuperPropdef then return false
if not collect_comments.is_empty then return false
return true
end
redef fun start_token do
if not n_visibility isa APublicVisibility then return n_visibility.first_token
if n_kwredef != null then return n_kwredef
return n_classkind.first_token
end
end
src/pretty.nit:683,1--752,3
redef class AStdClassdef
private fun deserializer_npropdef: nullable AMethPropdef
do
for npropdef in n_propdefs do if npropdef isa AMethPropdef then
var id = npropdef.n_methid
if id isa AIdMethid and id.n_id.text == "deserialize_class_intern" then
return npropdef
end
end
return null
end
# Is this classed marked `serialize`? in part or fully?
#
# This method returns 3 possible values:
# * `null`, this class is not to be serialized.
# * `true`, the attributes of this class are to be serialized by default.
# * `false`, the attributes of this class are to be serialized on demand only.
fun how_serialize: nullable Bool
do
# Is there a declaration on the classdef or the module?
var serialize = is_serialize
if not serialize and not is_noserialize then
# Is the module marked serialize?
serialize = parent.as(AModule).is_serialize
end
if serialize then return true
if not serialize then
# Is there an attribute marked serialize?
for npropdef in n_propdefs do
if npropdef.is_serialize then
return false
end
end
end
return null
end
end
src/frontend/serialization_model_phase.nit:322,1--364,3
redef class AStdClassdef
private init make(mclassdef: nullable MClassDef,
n_visibility: nullable AVisibility,
n_formaldefs : Collection[Object],
n_extern_code_block : nullable AExternCodeBlock,
n_propdefs : Collection[Object],
n_classkind: nullable AClasskind)
do
if n_visibility == null then n_visibility = new APublicVisibility
if n_classkind == null then n_classkind = new AConcreteClasskind.init_aconcreteclasskind(new TKwclass)
var n_qid = new AQclassid.init_aqclassid(null, new TClassid)
init_astdclassdef(null, null, n_visibility, n_classkind, n_qid, null, n_formaldefs, null, n_extern_code_block, n_propdefs, new TKwend)
_mclassdef = mclassdef
_mclass = mclassdef.mclass
end
end
src/astbuilder.nit:318,1--333,3
redef class AStdClassdef
redef fun make_tag(v)
do
var res = new HTMLTag("span")
res.add_class("nc_cdef")
var md = mclassdef
if md != null then res.attr("id", md.to_s)
return res
end
redef fun decorate_tag(v, res, token)
do
if not token isa TClassid then return null
res.add_class("nc_def")
var md = mclassdef
if md == null then return null
return md.infobox(v)
end
end
src/htmlight.nit:760,1--778,3