Gyoji Compiler
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Gyoji::frontend::tree::StatementWhile Class Reference

Represents a 'while' statement in a function or scope. More...

#include <tree.hpp>

Inheritance diagram for Gyoji::frontend::tree::StatementWhile:
Inheritance graph
[legend]
Collaboration diagram for Gyoji::frontend::tree::StatementWhile:
Collaboration graph
[legend]

Public Member Functions

 ~StatementWhile ()
 
const Expression & get_expression () const
 
- Public Member Functions inherited from Gyoji::frontend::ast::SyntaxNode
 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 SyntaxNodeget_syntax_node () const
 
const Gyoji::context::SourceReferenceget_source_ref () const
 

Detailed Description

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;
       }
   }

Constructor & Destructor Documentation

◆ ~StatementWhile()

StatementWhile::~StatementWhile ( )

Destructor, nothing special.

Member Function Documentation

◆ get_expression()

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'.


The documentation for this class was generated from the following files: