tan  0.0.1
tanlang::CompoundStmt Class Reference
Inheritance diagram for tanlang::CompoundStmt:
Collaboration diagram for tanlang::CompoundStmt:

Public Member Functions

void set_child_at (size_t idx, ASTBase *node)
 
void append_child (ASTBase *node)
 
void clear_children ()
 
size_t get_children_size () const
 
vector< ASTBase * > get_children () const override
 Get a ordered list of child nodes. More...
 
vector< ASTBase * > & get_children ()
 
str terminal_token () const override
 Which terminal token is expected immediately after this node. More...
 
- Public Member Functions inherited from tanlang::Stmt
bool is_stmt () const override
 
bool is_expr () const override
 
- Public Member Functions inherited from tanlang::ASTBase
 ASTBase (ASTNodeType node_type, TokenizedSourceFile *src, int bp)
 
ASTNodeType get_node_type () const
 
void set_node_type (ASTNodeType node_type)
 
int get_bp () const
 
Contextctx ()
 
str repr (const str &prefix="-") const
 AST tree string representation. More...
 
- Public Member Functions inherited from tanlang::SourceTraceable
 SourceTraceable (TokenizedSourceFile *src)
 
uint32_t start () const
 
uint32_t end () const
 
void set_start (uint32_t val)
 
void set_end (uint32_t val)
 
TokenizedSourceFilesrc () const
 

Static Public Member Functions

static CompoundStmtCreate (TokenizedSourceFile *src)
 

Protected Member Functions

 CompoundStmt (TokenizedSourceFile *src)
 
str to_string (bool=false) const override
 Different from repr, to_string output doesn't include child nodes. More...
 
- Protected Member Functions inherited from tanlang::Stmt
 Stmt (ASTNodeType type, TokenizedSourceFile *src)
 
- Protected Member Functions inherited from tanlang::ASTBase
virtual ASTBaseget () const
 Get the "actual" this. Used for implementing proxy classes. More...
 

Protected Attributes

vector< ASTBase * > _children {}
 

Additional Inherited Members

- Static Public Attributes inherited from tanlang::ASTBase
static umap< ASTNodeType, str > ASTTypeNames
 string representation of ASTNodeType More...
 
static umap< ASTNodeType, int > OpPrecedence
 operator precedence of tokens More...
 

Detailed Description

Definition at line 24 of file stmt.h.

Member Function Documentation

◆ Create()

CompoundStmt * CompoundStmt::Create ( TokenizedSourceFile src)
static

statement

Definition at line 14 of file stmt.cpp.

◆ get_children()

vector< ASTBase * > CompoundStmt::get_children ( ) const
overridevirtual

Get a ordered list of child nodes.

Reimplemented from tanlang::Stmt.

Definition at line 31 of file stmt.cpp.

◆ terminal_token()

str tanlang::CompoundStmt::terminal_token ( ) const
inlineoverridevirtual

Which terminal token is expected immediately after this node.

Reimplemented from tanlang::ASTBase.

Definition at line 38 of file stmt.h.

◆ to_string()

str tanlang::CompoundStmt::to_string ( bool  include_source_code = false) const
inlineoverrideprotectedvirtual

Different from repr, to_string output doesn't include child nodes.

Reimplemented from tanlang::ASTBase.

Definition at line 41 of file stmt.h.

References tanlang::ASTBase::to_string().


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