nitc :: AReturnExpr
return
statement. eg return x
nitc :: AReturnExpr :: defaultinit
nitc :: AReturnExpr :: init_areturnexpr
nitc :: AReturnExpr :: make
nitc :: AReturnExpr :: n_kwreturn=
Thereturn
keyword
nitc $ AReturnExpr :: SELF
Type of this instance, automatically specialized in every classnitc :: flow $ AReturnExpr :: accept_flow_visitor
nitc :: pretty $ AReturnExpr :: accept_pretty_printer
Start visit ofself
using a PrettyPrinterVisitor
nitc :: scope $ AReturnExpr :: accept_scope_visitor
nitc :: typing $ AReturnExpr :: accept_typing
nitc :: simple_misc_analysis $ AReturnExpr :: after_simple_misc
nitc :: ssa $ AReturnExpr :: generate_basic_blocks
Generate recursively basic block for this expressionnitc :: parser_prod $ AReturnExpr :: n_expr=
The return value, if nay (unused currently)nitc :: parser_prod $ AReturnExpr :: n_kwreturn=
Thereturn
keyword
nitc :: parser_prod $ AReturnExpr :: replace_child
Replace a child with an other node in the ASTnitc :: abstract_compiler $ AReturnExpr :: stmt
Try to compile self as a statementnitc :: java_compiler $ AReturnExpr :: stmt
Try to compile self as a statementnitc :: parser_prod $ AReturnExpr :: visit_all
Visit all nodes in order.nitc :: AExpr :: _after_flow_context
The flow after the full evaluation of the expression/statementnitc :: AExpr :: _comprehension
Is non-null ifself
is a leaf of a comprehension array construction.
nitc :: AEscapeExpr :: _escapemark
The escape mark associated with the break/continuenitc :: 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 :: AExpr :: _implicit_cast_to
If required, the following implicit cast.as(XXX)
nitc :: 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 :: Prod :: _n_annotations
All the annotations attached directly to the nodenitc :: AEscapeExpr :: _n_expr
The return value, if nay (unused currently)nitc :: ALabelable :: _n_label
The associated label declatationnitc :: AExpr :: _vararg_decl
It indicates the number of arguments collected as a vararg.nitc :: AExpr :: _variable_cache
nitc :: ANode :: accept_ast_validation
nitc :: ANode :: accept_auto_super_init
nitc :: AExpr :: accept_explain_assert
Fillv
to explain this node if the parent assert fails
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 :: AExpr :: accept_typing
nitc :: AExpr :: after_flow_context
The flow after the full evaluation of the expression/statementnitc :: AExpr :: after_flow_context=
The flow after the full evaluation of the expression/statementnitc :: ANode :: after_simple_misc
nitc :: AExpr :: allocate_mtype
Make themtype
of the expression live
nitc :: ANode :: bad_expr_message
An additional information message to explain the role of a child expression.nitc :: AEscapeExpr :: before_flow_context
The flow just before it become unreachablenitc :: 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 :: AExpr :: comprehension
Is non-null ifself
is a leaf of a comprehension array construction.
nitc :: AExpr :: comprehension=
Is non-null ifself
is a leaf of a comprehension array construction.
nitc :: ANode :: create_contracts
nitc :: ANode :: decorate_tag
Add aditionnal information on a child-token and return an additionnal HInfoBox on itnitc :: AExpr :: defaultinit
nitc :: Prod :: defaultinit
nitc :: AEscapeExpr :: defaultinit
nitc :: ANode :: defaultinit
nitc :: ALabelable :: defaultinit
core :: Object :: defaultinit
nitc :: AReturnExpr :: defaultinit
core :: Cloneable :: defaultinit
nitc :: AExpr :: detach_with_placeholder
Thedetach
method completely remove the node in the parent.
nitc :: ANode :: do_cloneable
nitc :: AEscapeExpr :: escapemark
The escape mark associated with the break/continuenitc :: AEscapeExpr :: escapemark=
The escape mark associated with the break/continuenitc :: 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 :: AExpr :: generate_basic_blocks
Generate recursively basic block for this expressionnitc :: 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 :: AExpr :: implicit_cast_to
If required, the following implicit cast.as(XXX)
nitc :: AExpr :: implicit_cast_to=
If required, the following implicit cast.as(XXX)
nitc :: AReturnExpr :: init_areturnexpr
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 :: AReturnExpr :: make
nitc :: AExpr :: make_var_read
Return a new variable read that contains the value of the expressionnitc :: 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 :: AEscapeExpr :: n_expr
The return value, if nay (unused currently)nitc :: AEscapeExpr :: n_expr=
The return value, if nay (unused currently)nitc :: AReturnExpr :: n_kwreturn=
Thereturn
keyword
nitc :: ALabelable :: n_label=
The associated label declatationcore :: 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 :: AExpr :: vararg_decl
It indicates the number of arguments collected as a vararg.nitc :: AExpr :: vararg_decl=
It indicates the number of arguments collected as a vararg.nitc :: AExpr :: variable_cache
nitc :: AExpr :: variable_cache=
nitc :: AExpr :: warn_parentheses
Warn in case of superfluous parenthesesnitc :: ANode :: was_inline
Doesself
was written in one line before transformation?
# A `return` statement. eg `return x`
class AReturnExpr
super AEscapeExpr
# The `return` keyword
var n_kwreturn: nullable TKwreturn = null is writable
end
src/parser/parser_nodes.nit:1879,1--1885,3
redef class AReturnExpr
init init_areturnexpr (
n_kwreturn: nullable TKwreturn,
n_expr: nullable AExpr
)
do
_n_kwreturn = n_kwreturn
if n_kwreturn != null then n_kwreturn.parent = self
_n_expr = n_expr
if n_expr != null then n_expr.parent = self
end
redef fun replace_child(old_child: ANode, new_child: nullable ANode)
do
if _n_kwreturn == old_child then
n_kwreturn = new_child.as(nullable TKwreturn)
return
end
if _n_expr == old_child then
n_expr = new_child.as(nullable AExpr)
return
end
end
redef fun n_kwreturn=(node)
do
_n_kwreturn = node
if node != null then node.parent = self
end
redef fun n_expr=(node)
do
_n_expr = node
if node != null then node.parent = self
end
redef fun visit_all(v: Visitor)
do
v.enter_visit(_n_kwreturn)
v.enter_visit(_n_expr)
end
end
src/parser/parser_prod.nit:2740,1--2781,3
redef class AReturnExpr
redef fun after_simple_misc(v)
do
var e = n_expr
if e != null then
e.warn_parentheses(v)
end
end
end
src/frontend/simple_misc_analysis.nit:126,1--134,3
redef class AReturnExpr
redef fun accept_scope_visitor(v)
do
super
var escapemark = v.propdef.return_mark
if escapemark == null then
escapemark = new EscapeMark
v.propdef.return_mark = escapemark
end
escapemark.escapes.add(self)
self.escapemark = escapemark
end
end
src/semantize/scope.nit:340,1--354,3
redef class AReturnExpr
redef fun accept_pretty_printer(v) do
v.visit n_kwreturn
if n_expr != null then
v.adds
v.visit n_expr
end
end
end
src/pretty.nit:1879,1--1888,3
redef class AReturnExpr
redef fun accept_flow_visitor(v)
do
super
v.make_unreachable_flow
end
end
src/semantize/flow.nit:314,1--320,3
redef class AReturnExpr
redef fun accept_typing(v)
do
var nexpr = self.n_expr
var ret_type
var mpropdef = v.mpropdef
if mpropdef isa MMethodDef then
ret_type = mpropdef.msignature.return_mtype
else if mpropdef isa MAttributeDef then
ret_type = mpropdef.static_mtype
else
abort
end
if nexpr != null then
if ret_type != null then
v.visit_expr_subtype(nexpr, ret_type)
else
v.visit_expr(nexpr)
v.error(nexpr, "Error: `return` with value in a procedure.")
return
end
else if ret_type != null then
v.error(self, "Error: `return` without value in a function.")
return
end
self.is_typed = true
end
end
src/semantize/typing.nit:1226,1--1253,3
redef class AReturnExpr
private init make(expr: nullable AExpr)
do
self.init_areturnexpr(null, expr)
end
end
src/astbuilder.nit:370,1--375,3
redef class AReturnExpr
redef fun stmt(v)
do
var nexpr = self.n_expr
if nexpr != null then
var returnvar = v.frame.returnvar.as(not null)
var i = v.expr(nexpr, returnvar.mtype)
v.assign(returnvar, i)
end
v.add("goto {v.frame.returnlabel.as(not null)};")
end
end
src/compiler/abstract_compiler.nit:3819,1--3830,3
redef class AReturnExpr
redef fun generate_basic_blocks(ssa, old_block)
do
# The return just set the current block and stop the recursion
if self.n_expr != null then
old_block = self.n_expr.generate_basic_blocks(ssa, old_block)
# Store the return expression in the dependences of the dedicated returnvar
ssa.propdef.returnvar.dep_exprs.add(n_expr.as(not null))
end
old_block.last = self
return old_block
end
end
src/ssa.nit:675,1--690,3