Gyoji Compiler
|
Represents a 'while' statement in a function or scope. More...
#include <tree.hpp>
Public Member Functions | |
~StatementWhile () | |
const Expression & | get_expression () const |
![]() | |
SyntaxNode (Gyoji::context::TokenID _type, specific_type_t _data, const Gyoji::context::SourceReference &_source_ref) | |
const std::vector< std::reference_wrapper< const SyntaxNode > > & | get_children () const |
const Gyoji::context::TokenID & | get_type () const |
template<class T > | |
bool | has_data () const |
template<class T > | |
const T & | get_data () const |
const SyntaxNode & | get_syntax_node () const |
const Gyoji::context::SourceReference & | get_source_ref () const |
Represents a 'while' statement in a function or scope.
This represents a 'while' statement indicating that the specified scope block should be executed as long as the given boolean expression evaluates to 'true'. This represents the typical pattern:
boolean running = true; while (running) { if (input()) { running = false; } }
StatementWhile::~StatementWhile | ( | ) |
Destructor, nothing special.
const Expression & StatementWhile::get_expression | ( | ) | const |
This is the expression that is evaluated each time the loop is evaluated. If this expression returns 'true' then the scope is executed and the expression is evaluated again. This happens until the expression evaluates to 'false'.