Nearly CC
An educational compiler skeleton
Public Types | Public Member Functions | List of all members
Symbol Class Reference
Inheritance diagram for Symbol:
Inheritance graph
[legend]
Collaboration diagram for Symbol:
Collaboration graph
[legend]

Public Types

enum  Kind {
  VAR_DEF , FUNC_DEF , FUNC_DECL , STRUCT_TYPE_DEF ,
  UNION_TYPE_DEF
}
 
enum  StorageClass {
  STATIC , EXTERN , AUTO , GLOBAL ,
  NONE
}
 

Public Member Functions

 Symbol (const std::string &name, Kind kind, StorageClass storage_class, const Type *type)
 
const std::string & get_name () const
 
Kind get_kind () const
 
StorageClass get_storage_class () const
 
const Typeget_type () const
 
void promote_fn_decl_to_def ()
 
void set_codegen_name (const std::string &codegen_name)
 
std::string get_codegen_name () const
 
void set_offset (unsigned offset)
 
unsigned get_offset () const
 
 Symbol (SymbolKind kind, const std::string &name, const std::shared_ptr< Type > &type, SymbolTable *symtab, bool is_defined)
 
void set_is_defined (bool is_defined)
 
SymbolKind get_kind () const
 
const std::string & get_name () const
 
std::shared_ptr< Typeget_type () const
 
SymbolTableget_symtab () const
 
bool is_defined () const
 
void set_operand (const Operand &op)
 Set the Node's Operand. More...
 
bool has_operand () const
 Check whether this Node has a valid Operand. More...
 
const Operand get_operand () const
 Get this Node's Operand. More...
 

Member Function Documentation

◆ get_operand()

const Operand HasOperand::get_operand ( ) const
inlineinherited

Get this Node's Operand.

Returns
this Node's Operand

◆ has_operand()

bool HasOperand::has_operand ( ) const
inlineinherited

Check whether this Node has a valid Operand.

Returns
true if the Node has a valid Operand, false otherwise

◆ set_operand()

void HasOperand::set_operand ( const Operand op)
inlineinherited

Set the Node's Operand.

Parameters
opthe Operand to set

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