nitc :: AWhileExpr
while
statementnitc :: AWhileExpr :: _break_mark
The break escape mark associated with the 'while'nitc :: AWhileExpr :: _continue_mark
The continue escape mark associated with the 'while'nitc :: AWhileExpr :: _n_expr
The expression used as the condition of thewhile
nitc :: AWhileExpr :: break_mark
The break escape mark associated with the 'while'nitc :: AWhileExpr :: break_mark=
The break escape mark associated with the 'while'nitc :: AWhileExpr :: continue_mark
The continue escape mark associated with the 'while'nitc :: AWhileExpr :: continue_mark=
The continue escape mark associated with the 'while'nitc :: AWhileExpr :: defaultinit
nitc :: AWhileExpr :: init_awhileexpr
nitc :: AWhileExpr :: n_expr=
The expression used as the condition of thewhile
nitc $ AWhileExpr :: SELF
Type of this instance, automatically specialized in every classnitc :: flow $ AWhileExpr :: accept_flow_visitor
nitc :: saf_base $ AWhileExpr :: accept_forward_analysis
Apply the forward analysisv
to self
.
nitc :: pretty $ AWhileExpr :: accept_pretty_printer
Start visit ofself
using a PrettyPrinterVisitor
nitc :: scope $ AWhileExpr :: accept_scope_visitor
nitc :: typing $ AWhileExpr :: accept_typing
nitc :: simple_misc_analysis $ AWhileExpr :: after_simple_misc
nitc :: ssa $ AWhileExpr :: generate_basic_blocks
Generate recursively basic block for this expressionnitc :: saf_base $ AWhileExpr :: loop_block
The block contained by this loop.nitc :: pretty $ AWhileExpr :: loop_block
nitc :: pretty $ AWhileExpr :: loop_label
nitc :: parser_prod $ AWhileExpr :: n_block=
The body of the loopnitc :: parser_prod $ AWhileExpr :: n_expr=
The expression used as the condition of thewhile
nitc :: parser_prod $ AWhileExpr :: n_kwwhile=
Thewhile
keyword
nitc :: parser_prod $ AWhileExpr :: n_label=
The associated label declatationnitc :: variables_numbering $ AWhileExpr :: numbering
Give a position to each variable declared in the node.nitc :: parser_prod $ AWhileExpr :: replace_child
Replace a child with an other node in the ASTnitc :: naive_interpreter $ AWhileExpr :: stmt
Evaluate the node as a statement.nitc :: abstract_compiler $ AWhileExpr :: stmt
Try to compile self as a statementnitc :: java_compiler $ AWhileExpr :: stmt
Try to compile self as a statementnitc :: parser_prod $ AWhileExpr :: visit_all
Visit all nodes in order.nitc :: AExpr :: _after_flow_context
The flow after the full evaluation of the expression/statementnitc :: AWhileExpr :: _break_mark
The break escape mark associated with the 'while'nitc :: AExpr :: _comprehension
Is non-null ifself
is a leaf of a comprehension array construction.
nitc :: AWhileExpr :: _continue_mark
The continue escape mark associated with the 'while'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 :: 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 :: AWhileExpr :: _n_expr
The expression used as the condition of thewhile
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 :: ADoBlockHelper :: accept_loop_forward_analysis
Factorize loop forward analysis.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 :: AWhileExpr :: break_mark
The break escape mark associated with the 'while'nitc :: AWhileExpr :: break_mark=
The break escape mark associated with the 'while'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 :: 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 :: AWhileExpr :: continue_mark
The continue escape mark associated with the 'while'nitc :: AWhileExpr :: continue_mark=
The continue escape mark associated with the 'while'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
core :: Cloneable :: defaultinit
nitc :: ALabelable :: defaultinit
core :: Object :: defaultinit
nitc :: ALoopHelper :: defaultinit
nitc :: AWhileExpr :: defaultinit
nitc :: ADoBlockHelper :: defaultinit
nitc :: ANode :: defaultinit
nitc :: AExpr :: detach_with_placeholder
Thedetach
method completely remove the node in the parent.
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 :: 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 :: AWhileExpr :: init_awhileexpr
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 :: ALoopHelper :: loop_block
nitc :: ADoBlockHelper :: loop_block
The block contained by this loop.nitc :: ADoBlockHelper :: loop_fix_point
Lookup fix point for this loop.nitc :: ALoopHelper :: loop_label
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 :: AWhileExpr :: n_expr=
The expression used as the condition of thewhile
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 :: ALoopHelper :: visit_loop_block
nitc :: ALoopHelper :: visit_loop_inline
nitc :: AExpr :: warn_parentheses
Warn in case of superfluous parenthesesnitc :: ANode :: was_inline
Doesself
was written in one line before transformation?
# A `while` statement
class AWhileExpr
super AExpr
super ALabelable
# The `while` keyword
var n_kwwhile: TKwwhile is writable, noinit
# The expression used as the condition of the `while`
var n_expr: AExpr is writable, noinit
# The `do` keyword
var n_kwdo: TKwdo is writable, noinit
# The body of the loop
var n_block: nullable AExpr = null is writable
end
src/parser/parser_nodes.nit:2003,1--2019,3
redef class AWhileExpr
init init_awhileexpr (
n_kwwhile: nullable TKwwhile,
n_expr: nullable AExpr,
n_kwdo: nullable TKwdo,
n_block: nullable AExpr,
n_label: nullable ALabel
)
do
_n_kwwhile = n_kwwhile.as(not null)
n_kwwhile.parent = self
_n_expr = n_expr.as(not null)
n_expr.parent = self
_n_kwdo = n_kwdo.as(not null)
n_kwdo.parent = self
_n_block = n_block
if n_block != null then n_block.parent = self
_n_label = n_label
if n_label != null then n_label.parent = self
end
redef fun replace_child(old_child: ANode, new_child: nullable ANode)
do
if _n_kwwhile == old_child then
n_kwwhile = new_child.as(TKwwhile)
return
end
if _n_expr == old_child then
n_expr = new_child.as(AExpr)
return
end
if _n_kwdo == old_child then
n_kwdo = new_child.as(TKwdo)
return
end
if _n_block == old_child then
n_block = new_child.as(nullable AExpr)
return
end
if _n_label == old_child then
n_label = new_child.as(nullable ALabel)
return
end
end
redef fun n_kwwhile=(node)
do
_n_kwwhile = node
node.parent = self
end
redef fun n_expr=(node)
do
_n_expr = node
node.parent = self
end
redef fun n_kwdo=(node)
do
_n_kwdo = node
node.parent = self
end
redef fun n_block=(node)
do
_n_block = node
if node != null then node.parent = self
end
redef fun n_label=(node)
do
_n_label = node
if node != null then node.parent = self
end
redef fun visit_all(v: Visitor)
do
v.enter_visit(_n_kwwhile)
v.enter_visit(_n_expr)
v.enter_visit(_n_kwdo)
v.enter_visit(_n_block)
v.enter_visit(_n_label)
end
end
src/parser/parser_prod.nit:3206,1--3286,3
redef class AWhileExpr
redef fun after_simple_misc(v)
do
if n_expr isa ATrueExpr then
v.warning(self, "loop", "Warning: use `loop` instead of `while true do`.")
else
n_expr.warn_parentheses(v)
end
v.check_do_expr(n_block)
end
end
src/frontend/simple_misc_analysis.nit:146,1--156,3
redef class AWhileExpr
# The break escape mark associated with the 'while'
var break_mark: nullable EscapeMark
# The continue escape mark associated with the 'while'
var continue_mark: nullable EscapeMark
redef fun accept_scope_visitor(v)
do
var escapemark = v.make_escape_mark(n_label, true)
self.break_mark = escapemark
self.continue_mark = escapemark.continue_mark
v.enter_visit(n_expr)
v.enter_visit_block(n_block, escapemark)
end
end
src/semantize/scope.nit:377,1--392,3
redef class AWhileExpr
super ADoBlockHelper
redef fun loop_block do return self.n_block
redef fun accept_forward_analysis(v) do
v.enter_visit(n_expr)
accept_loop_forward_analysis(v)
end
end
src/saf/saf_base.nit:214,1--223,3
redef class AWhileExpr
redef fun accept_flow_visitor(v)
do
var before_loop = v.make_sub_flow
var after_expr = v.visit_expr(self.n_expr)
v.current_flow_context = after_expr.when_true
v.enter_visit(self.n_block)
var after_block = v.current_flow_context
before_loop.add_loop(after_block)
v.merge_continues_to(before_loop, self.continue_mark)
v.current_flow_context = after_expr.when_false
v.merge_breaks(self.break_mark)
end
end
src/semantize/flow.nit:401,1--418,3
redef class AWhileExpr
super ALoopHelper
redef fun loop_block do return n_block
redef fun loop_label do return n_label
redef fun accept_pretty_printer(v) do
var can_inline = v.can_inline(self)
v.visit n_kwwhile
v.adds
v.visit n_expr
v.adds
v.visit n_kwdo
if can_inline then visit_loop_inline v else visit_loop_block v
end
end
src/pretty.nit:1481,1--1496,3
redef class AWhileExpr
redef fun accept_typing(v)
do
v.has_loop = true
v.visit_expr_bool(n_expr)
v.visit_stmt(n_block)
self.is_typed = true
end
end
src/semantize/typing.nit:1307,1--1315,3
redef class AWhileExpr
redef fun stmt(v)
do
loop
var cond = v.expr(self.n_expr)
if cond == null then return
if not cond.is_true then return
v.stmt(self.n_block)
if v.is_escape(self.break_mark) then return
v.is_escape(self.continue_mark) # Clear the break
if v.is_escaping then return
end
end
end
src/interpreter/naive_interpreter.nit:1854,1--1867,3
redef class AWhileExpr
redef fun stmt(v)
do
v.add("for(;;) \{")
var cond = v.expr_bool(self.n_expr)
v.add("if (!{cond}) break;")
v.stmt(self.n_block)
v.add_escape_label(continue_mark)
v.add("\}")
v.add_escape_label(break_mark)
end
end
src/compiler/abstract_compiler.nit:3904,1--3915,3
redef class AWhileExpr
redef fun generate_basic_blocks(ssa, old_block)
do
old_block.last = self
# The beginning of the block is the test of the while
var block = new BasicBlock
block.first = self.n_expr
block.last = self.n_block.as(not null)
old_block.link(block)
self.n_expr.generate_basic_blocks(ssa, old_block)
self.n_block.generate_basic_blocks(ssa, block)
# Link the inside of the block to the previous block
block.link_special(old_block)
# Create a new Block after the while
var new_block = new BasicBlock
new_block.first = self
new_block.last = self
new_block.need_update = true
old_block.link_special(new_block)
return new_block
end
end
src/ssa.nit:1066,1--1094,3
redef class AWhileExpr
redef fun accept_transform_visitor(v)
do
var nloop = v.builder.make_loop
var nif = v.builder.make_if(n_expr, null)
nloop.add nif
var nblock = n_block
if nblock != null then nif.n_then.add nblock
var escapemark = self.break_mark.as(not null)
var nbreak = v.builder.make_break(escapemark)
nif.n_else.add nbreak
nloop.break_mark = self.break_mark
nloop.continue_mark = self.continue_mark
replace_with(nloop)
end
end
src/transform.nit:189,1--208,3
redef class AWhileExpr
redef fun stmt(v)
do
v.add_escape_label(break_mark)
v.add_escape_label(continue_mark)
v.add("for(;;) \{")
var cond = v.expr_bool(self.n_expr)
v.add("if (!{cond}) break;")
v.stmt(self.n_block)
v.add("\}")
end
end
src/compiler/java_compiler.nit:2097,1--2108,3