tcalc 0.2.0
 
Loading...
Searching...
No Matches
tcalc::ast::ProgramNode Class Reference

Program node. More...

#include <program.hpp>

Inheritance diagram for tcalc::ast::ProgramNode:
tcalc::ast::Node

Public Member Functions

 ProgramNode ()
 Construct a new Program Node object without statements.
 
 ProgramNode (std::vector< NodePtr<> > statements)
 Construct a new Program Node object with statements.
 
TCALC_INLINE auto & statements () const noexcept
 Get statements.
 
TCALC_INLINE auto & statements () noexcept
 Get statements.
 
TCALC_INLINE void push_statement (NodePtr<> statement)
 Push a statement.
 
- Public Member Functions inherited from tcalc::ast::Node
 Node (NodeType type)
 Construct a new Node object.
 
TCALC_INLINE auto type () const noexcept
 Get the node type.
 

Detailed Description

Program node.

Constructor & Destructor Documentation

◆ ProgramNode()

tcalc::ast::ProgramNode::ProgramNode ( std::vector< NodePtr<> >  statements)
inlineexplicit

Construct a new Program Node object with statements.

Parameters
statementsStatements.

Member Function Documentation

◆ push_statement()

TCALC_INLINE void tcalc::ast::ProgramNode::push_statement ( NodePtr<>  statement)
inline

Push a statement.

Parameters
statementStatement.

◆ statements() [1/2]

TCALC_INLINE auto & tcalc::ast::ProgramNode::statements ( ) const
inlinenoexcept

Get statements.

Returns
const std::vector<NodePtr<>>& Statements.

◆ statements() [2/2]

TCALC_INLINE auto & tcalc::ast::ProgramNode::statements ( )
inlinenoexcept

Get statements.

Returns
std::vector<NodePtr<>>& Statements.

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