tan  0.0.1
tanlang::BinaryOrUnary Class Reference

#include <expr.h>

Inheritance diagram for tanlang::BinaryOrUnary:
Collaboration diagram for tanlang::BinaryOrUnary:

Public Types

enum  BinaryOrUnaryKind { UNKNOWN , BINARY , UNARY }
 

Public Member Functions

void set_bop (BinaryOperator *bop)
 
void set_uop (UnaryOperator *uop)
 
Exprget_expr_ptr () const
 
ASTBaseget () const override
 Get the "actual" this. Used for implementing proxy classes. More...
 
Typeget_type () const override
 
void set_type (Type *type) override
 
vector< ASTBase * > get_children () const override
 Get a ordered list of child nodes. More...
 
bool is_lvalue () override
 
void set_lvalue (bool is_lvalue) override
 
- Public Member Functions inherited from tanlang::Expr
virtual bool is_comptime_known ()
 
bool is_expr () const override
 
bool is_stmt () 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...
 
virtual str terminal_token () const
 Which terminal token is expected immediately after this node. 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 BinaryOrUnaryCreate (TokenizedSourceFile *src, int bp)
 

Protected Member Functions

 BinaryOrUnary (TokenizedSourceFile *src, int bp)
 
- Protected Member Functions inherited from tanlang::Expr
 Expr (ASTNodeType type, TokenizedSourceFile *src, int bp)
 
- Protected Member Functions inherited from tanlang::ASTBase
virtual str to_string (bool include_source_code=false) const
 Different from repr, to_string output doesn't include child nodes. More...
 

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...
 
- Protected Attributes inherited from tanlang::Expr
bool _is_lvalue = false
 

Detailed Description

Note
Once BinaryOrUnary::set_bop() or BinaryOrUnary::set_uop() is called, the object is not allowed to change anymore

Definition at line 280 of file expr.h.

Member Function Documentation

◆ get()

ASTBase * BinaryOrUnary::get ( ) const
overridevirtual

Get the "actual" this. Used for implementing proxy classes.

Reimplemented from tanlang::ASTBase.

Definition at line 332 of file expr.cpp.

◆ get_children()

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

Get a ordered list of child nodes.

Reimplemented from tanlang::Expr.

Definition at line 338 of file expr.cpp.

References tanlang::Expr::get_children().


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