CBMC
symbolt Class Reference

Symbol table entry. More...

#include <symbol.h>

+ Inheritance diagram for symbolt:
+ Collaboration diagram for symbolt:

Public Member Functions

const irep_idtdisplay_name () const
 Return language specific display name if present. More...
 
 symbolt ()
 
 symbolt (const irep_idt &_name, typet _type, const irep_idt &_mode)
 
void swap (symbolt &b)
 Swap values between two symbols. More...
 
void show (std::ostream &out) const
 Dump the state of a symbol object to a given output stream. More...
 
class symbol_exprt symbol_expr () const
 Produces a symbol_exprt for a symbol. More...
 
bool is_shared () const
 
bool is_function () const
 
bool is_compiled () const
 Returns true iff the the symbol's value has been compiled to a goto program. More...
 
void set_compiled ()
 Set the symbol's value to "compiled"; to be used once the code-typed value has been converted to a goto program. More...
 
bool is_well_formed () const
 Check that a symbol is well formed. More...
 
bool operator== (const symbolt &other) const
 
bool operator!= (const symbolt &other) const
 

Public Attributes

typet type
 Type of symbol. More...
 
exprt value
 Initial value of symbol. More...
 
source_locationt location
 Source code location of definition of symbol. More...
 
irep_idt name
 The unique identifier. More...
 
irep_idt module
 Name of module the symbol belongs to. More...
 
irep_idt base_name
 Base (non-scoped) name. More...
 
irep_idt mode
 Language mode. More...
 
irep_idt pretty_name
 Language-specific display name. More...
 
bool is_type = false
 
bool is_macro = false
 
bool is_exported = false
 
bool is_input = false
 
bool is_output = false
 
bool is_state_var = false
 
bool is_property = false
 
bool is_static_lifetime = false
 
bool is_thread_local = false
 
bool is_lvalue = false
 
bool is_file_local = false
 
bool is_extern = false
 
bool is_volatile = false
 
bool is_parameter = false
 
bool is_auxiliary = false
 
bool is_weak = false
 

Detailed Description

Symbol table entry.

This is a symbol in the symbol table, stored in an object of type symbol_tablet.

Definition at line 27 of file symbol.h.

Constructor & Destructor Documentation

◆ symbolt() [1/2]

symbolt::symbolt ( )
inline

Definition at line 80 of file symbol.h.

◆ symbolt() [2/2]

symbolt::symbolt ( const irep_idt _name,
typet  _type,
const irep_idt _mode 
)
inline

Definition at line 87 of file symbol.h.

Member Function Documentation

◆ display_name()

const irep_idt& symbolt::display_name ( ) const
inline

Return language specific display name if present.

Definition at line 55 of file symbol.h.

◆ is_compiled()

bool symbolt::is_compiled ( ) const
inline

Returns true iff the the symbol's value has been compiled to a goto program.

Definition at line 113 of file symbol.h.

◆ is_function()

bool symbolt::is_function ( ) const
inline

Definition at line 106 of file symbol.h.

◆ is_shared()

bool symbolt::is_shared ( ) const
inline

Definition at line 101 of file symbol.h.

◆ is_well_formed()

bool symbolt::is_well_formed ( ) const

Check that a symbol is well formed.

Check that the instance object is well formed.

Returns
true if well-formed; false otherwise.

Definition at line 128 of file symbol.cpp.

◆ operator!=()

bool symbolt::operator!= ( const symbolt other) const

Definition at line 233 of file symbol.cpp.

◆ operator==()

bool symbolt::operator== ( const symbolt other) const

Definition at line 202 of file symbol.cpp.

◆ set_compiled()

void symbolt::set_compiled ( )
inline

Set the symbol's value to "compiled"; to be used once the code-typed value has been converted to a goto program.

Definition at line 120 of file symbol.h.

◆ show()

void symbolt::show ( std::ostream &  out) const

Dump the state of a symbol object to a given output stream.

Parameters
outThe stream to output object state to.

Definition at line 19 of file symbol.cpp.

◆ swap()

void symbolt::swap ( symbolt b)

Swap values between two symbols.

Parameters
bThe second symbol to swap values with.

Definition at line 85 of file symbol.cpp.

◆ symbol_expr()

symbol_exprt symbolt::symbol_expr ( ) const

Produces a symbol_exprt for a symbol.

Returns
A new symbol_exprt with the name and type of the symbol object.

Definition at line 121 of file symbol.cpp.

Member Data Documentation

◆ base_name

irep_idt symbolt::base_name

Base (non-scoped) name.

Definition at line 46 of file symbol.h.

◆ is_auxiliary

bool symbolt::is_auxiliary = false

Definition at line 77 of file symbol.h.

◆ is_exported

bool symbolt::is_exported = false

Definition at line 63 of file symbol.h.

◆ is_extern

bool symbolt::is_extern = false

Definition at line 74 of file symbol.h.

◆ is_file_local

bool symbolt::is_file_local = false

Definition at line 73 of file symbol.h.

◆ is_input

bool symbolt::is_input = false

Definition at line 64 of file symbol.h.

◆ is_lvalue

bool symbolt::is_lvalue = false

Definition at line 72 of file symbol.h.

◆ is_macro

bool symbolt::is_macro = false

Definition at line 62 of file symbol.h.

◆ is_output

bool symbolt::is_output = false

Definition at line 65 of file symbol.h.

◆ is_parameter

bool symbolt::is_parameter = false

Definition at line 76 of file symbol.h.

◆ is_property

bool symbolt::is_property = false

Definition at line 67 of file symbol.h.

◆ is_state_var

bool symbolt::is_state_var = false

Definition at line 66 of file symbol.h.

◆ is_static_lifetime

bool symbolt::is_static_lifetime = false

Definition at line 70 of file symbol.h.

◆ is_thread_local

bool symbolt::is_thread_local = false

Definition at line 71 of file symbol.h.

◆ is_type

bool symbolt::is_type = false

Definition at line 61 of file symbol.h.

◆ is_volatile

bool symbolt::is_volatile = false

Definition at line 75 of file symbol.h.

◆ is_weak

bool symbolt::is_weak = false

Definition at line 78 of file symbol.h.

◆ location

source_locationt symbolt::location

Source code location of definition of symbol.

Definition at line 37 of file symbol.h.

◆ mode

irep_idt symbolt::mode

Language mode.

Definition at line 49 of file symbol.h.

◆ module

irep_idt symbolt::module

Name of module the symbol belongs to.

Definition at line 43 of file symbol.h.

◆ name

irep_idt symbolt::name

The unique identifier.

Definition at line 40 of file symbol.h.

◆ pretty_name

irep_idt symbolt::pretty_name

Language-specific display name.

Definition at line 52 of file symbol.h.

◆ type

typet symbolt::type

Type of symbol.

Definition at line 31 of file symbol.h.

◆ value

exprt symbolt::value

Initial value of symbol.

Definition at line 34 of file symbol.h.


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