ESCGrammarStmts.While
Extends: ESCGrammarStmt
Description
Represents a while loop. Uses the form:
while <condition>:
<block>
Members
Methods
init
func init(condition: ESCGrammarExpr, body: ESCGrammarStmt) -> void
Initialization method. Must be called after instantiation.
Parameters
Name |
Type |
Description |
Required? |
|---|---|---|---|
condition |
|
the expression to be evaluated and tested in order for the |
yes |
body |
|
the block of statements to be executed should |
yes |
Returns
Returns nothing.
get_condition
func get_condition() -> ESCGrammarExpr
The expression/predicate to be evaluated for the while block.
Parameters
None.
Returns
Returns the expression/predicate to be evaluated for the while block. (ESCGrammarExpr)
get_body
func get_body() -> ESCGrammarStmt
The block of statements to be executed should condition evaluate to true.
Parameters
None.
Returns
Returns the block of statements to be executed should condition evaluate to true. (ESCGrammarStmt)
accept
func accept(visitor: Variant) -> Variant
Method to invoke visitor-specific code.
Parameters
Name |
Type |
Description |
Required? |
|---|---|---|---|
visitor |
|
Visitor instance invoked to process this statement. |
yes |
Returns
Returns nothing.