chomik 0.2.1
experimental and minimalistic programming language

My name is Pawel Biernacki.
I am a software engineer.
This site is my hobby project.

Loading...
Searching...
No Matches
chomik::assignment_statement Class Reference

#include <chomik.h>

Inheritance diagram for chomik::assignment_statement:
Collaboration diagram for chomik::assignment_statement:

Public Member Functions

 assignment_statement (generic_name *const n, generic_value *const v, unsigned new_line_number)
 
 assignment_statement (const generic_value &gv, unsigned new_line_number)
 
 assignment_statement (const generic_name &gn, const generic_value &gv, unsigned new_line_number)
 
virtual statement_type get_statement_type () const override
 
virtual void report (std::ostream &s) const override
 
virtual void execute (machine &m, std::shared_ptr< const statement > &&i, std::shared_ptr< basic_generator > father=nullptr) const override
 
virtual void add_placeholders_to_generator (basic_generator &g) const override
 
virtual void make_copy_with_replacements (const machine &m, const basic_generator &g, const replacing_policy &p, std::shared_ptr< statement > &target) const override
 
virtual void get_copy (std::shared_ptr< statement > &target) const override
 
virtual bool get_is_code_assignment (machine &m) const override
 
- Public Member Functions inherited from chomik::statement
 statement (unsigned l)
 
virtual ~statement ()
 
virtual void expand (machine &m, int depth) const
 
void get_actual_code_value (const machine &m, const basic_generator &g, const replacing_policy &p, code &target) const
 
virtual const std::vector< std::shared_ptr< type_definition > > & get_vector_of_type_definitions () const
 

Additional Inherited Members

- Public Types inherited from chomik::statement
enum class  statement_type {
  NONE , TYPE_DEFINITION , VARIABLE_DEFINITION , ASSIGNMENT ,
  EXECUTE , EXPAND
}
 
- Protected Attributes inherited from chomik::statement
unsigned line_number
 
- Static Protected Attributes inherited from chomik::statement
static const std::vector< std::shared_ptr< type_definition > > dummy
 

Detailed Description

This class represents an assignment, i.e. instruction that assignes a value to a variable defined by a generic name. It may also be a loop of assignments, with the placeholders replaced by their actual values.

Constructor & Destructor Documentation

◆ assignment_statement() [1/3]

chomik::assignment_statement::assignment_statement ( generic_name *const n,
generic_value *const v,
unsigned new_line_number )
inline

This constructor owns both parameters, they must not be destroyed by the parser!

◆ assignment_statement() [2/3]

chomik::assignment_statement::assignment_statement ( const generic_value & gv,
unsigned new_line_number )
inline

◆ assignment_statement() [3/3]

chomik::assignment_statement::assignment_statement ( const generic_name & gn,
const generic_value & gv,
unsigned new_line_number )

Member Function Documentation

◆ add_placeholders_to_generator()

virtual void chomik::assignment_statement::add_placeholders_to_generator ( basic_generator & g) const
inlineoverridevirtual

Implements chomik::statement.

◆ execute()

virtual void chomik::assignment_statement::execute ( machine & m,
std::shared_ptr< const statement > && i,
std::shared_ptr< basic_generator > father = nullptr ) const
overridevirtual

Implements chomik::statement.

◆ get_copy()

virtual void chomik::assignment_statement::get_copy ( std::shared_ptr< statement > & target) const
overridevirtual

Implements chomik::statement.

◆ get_is_code_assignment()

virtual bool chomik::assignment_statement::get_is_code_assignment ( machine & m) const
inlineoverridevirtual

Reimplemented from chomik::statement.

◆ get_statement_type()

virtual statement_type chomik::assignment_statement::get_statement_type ( ) const
inlineoverridevirtual

Implements chomik::statement.

◆ make_copy_with_replacements()

virtual void chomik::assignment_statement::make_copy_with_replacements ( const machine & m,
const basic_generator & g,
const replacing_policy & p,
std::shared_ptr< statement > & target ) const
overridevirtual

Implements chomik::statement.

◆ report()

virtual void chomik::assignment_statement::report ( std::ostream & s) const
overridevirtual

Implements chomik::statement.


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

copyright by Pawel Biernacki

Vantaa 2022