SymbCache_ptr 
SymbCache_create(
  SymbTable_ptr  symb_table 
)
Callable only by the SymbTable instance that owns self. The caller keeps the ownership of given SymbTable instance

Defined in SymbCache.c

void 
SymbCache_destroy(
  SymbCache_ptr  self 
)
Callable only by the SymbTable instance that owns self.

Defined in SymbCache.c

node_ptr 
SymbCache_get_actual_parameter_context(
  const SymbCache_ptr  self, 
  const node_ptr  name 
)
Returns the context of the actual parameter associated with the given formal parameter

Defined in SymbCache.c

node_ptr 
SymbCache_get_actual_parameter(
  const SymbCache_ptr  self, 
  const node_ptr  name 
)
Returns the actual param of the given formal parameter

Defined in SymbCache.c

NodeList_ptr 
SymbCache_get_constants(
  const SymbCache_ptr  self 
)
Returned instance belongs to self, do not destroy or change it

Defined in SymbCache.c

node_ptr 
SymbCache_get_define_body(
  const SymbCache_ptr  self, 
  const node_ptr  name 
)
Returns the body of the given DEFINE name

Defined in SymbCache.c

node_ptr 
SymbCache_get_define_context(
  const SymbCache_ptr  self, 
  const node_ptr  name 
)
Returns the context of the given DEFINE name

Defined in SymbCache.c

node_ptr 
SymbCache_get_define_flatten_body(
  const SymbCache_ptr  self, 
  const node_ptr  name 
)
Returns the flattenized body of the given DEFINE name

Defined in SymbCache.c

NodeList_ptr 
SymbCache_get_defines(
  const SymbCache_ptr  self 
)
Returned instance belongs to self, do not destroy or change it

Defined in SymbCache.c

node_ptr 
SymbCache_get_flatten_actual_parameter(
  const SymbCache_ptr  self, 
  const node_ptr  name 
)
Returns the flattenized actual parameter of the given formal parameter

Defined in SymbCache.c

NodeList_ptr 
SymbCache_get_frozen_vars(
  const SymbCache_ptr  self 
)
Returned instance belongs to self, do not destroy or change it

Defined in SymbCache.c

node_ptr 
SymbCache_get_function_context(
  SymbCache_ptr  self, 
  node_ptr  name 
)
Returns the context of the given NFunction

Defined in SymbCache.c

NodeList_ptr 
SymbCache_get_functions(
  const SymbCache_ptr  self 
)
Returned instance belongs to self, do not destroy or change it

Defined in SymbCache.c

NFunction_ptr 
SymbCache_get_function(
  SymbCache_ptr  self, 
  node_ptr  name 
)
Returns the NFunction instance of the given function name

Defined in SymbCache.c

NodeList_ptr 
SymbCache_get_i_symbols(
  const SymbCache_ptr  self 
)
Only input variables and DEFINEs can occur within the returned list. Returned list belongs to self, do not destroy it

Defined in SymbCache.c

NodeList_ptr 
SymbCache_get_input_vars(
  const SymbCache_ptr  self 
)
Returned instance belongs to self, do not destroy or change it

Defined in SymbCache.c

node_ptr 
SymbCache_get_matrix_define_body(
  const SymbCache_ptr  self, 
  const node_ptr  name 
)
Returns the body of the given MDEFINE name

Defined in SymbCache.c

node_ptr 
SymbCache_get_matrix_define_context(
  const SymbCache_ptr  self, 
  const node_ptr  name 
)
Returns the context of the given MDEFINE name

Defined in SymbCache.c

NodeList_ptr 
SymbCache_get_matrix_defines(
  const SymbCache_ptr  self 
)
Returned instance belongs to self, do not destroy or change it

Defined in SymbCache.c

NodeList_ptr 
SymbCache_get_parameters(
  const SymbCache_ptr  self 
)
Returned instance belongs to self, do not destroy or change it

Defined in SymbCache.c

NodeList_ptr 
SymbCache_get_sf_i_symbols(
  const SymbCache_ptr  self 
)
Only DEFINEs whose body contains both state(or frozen) and input vars can occur within the returned list. Returned list belongs to self, do not destroy it

Defined in SymbCache.c

NodeList_ptr 
SymbCache_get_sf_symbols(
  const SymbCache_ptr  self 
)
Only state and frozen variables and DEFINEs can occur within the returned list. Returned list belongs to self, do not destroy it

Defined in SymbCache.c

NodeList_ptr 
SymbCache_get_state_frozen_vars(
  const SymbCache_ptr  self 
)
Returned instance belongs to self, do not destroy or change it. This list is just a concatenation of SymbCache_get_frozen_vars(self) and SymbCache_get_state_vars(self).

Defined in SymbCache.c

NodeList_ptr 
SymbCache_get_state_vars(
  const SymbCache_ptr  self 
)
Returned instance belongs to self, do not destroy or change it

Defined in SymbCache.c

SymbType_ptr 
SymbCache_get_symbol_type_type(
  const SymbCache_ptr  self, 
  const node_ptr  name 
)
Returns the type of array variable, i.e. of symbol_type

Defined in SymbCache.c

NodeList_ptr 
SymbCache_get_symbol_types(
  const SymbCache_ptr  self 
)
Returned instance belongs to self, do not destroy or change it

Defined in SymbCache.c

SymbType_ptr 
SymbCache_get_var_type(
  const SymbCache_ptr  self, 
  const node_ptr  name 
)
Returns the type of a given variable

Defined in SymbCache.c

NodeList_ptr 
SymbCache_get_vars(
  const SymbCache_ptr  self 
)
Returned instance belongs to self, do not destroy or change it

Defined in SymbCache.c

boolean 
SymbCache_is_symbol_constant(
  const SymbCache_ptr  self, 
  const node_ptr  name 
)
Returns true if the given symbol is a declared constant

Defined in SymbCache.c

boolean 
SymbCache_is_symbol_declared(
  const SymbCache_ptr  self, 
  const node_ptr  name 
)
Returns true if the given symbol is declared

Defined in SymbCache.c

boolean 
SymbCache_is_symbol_define(
  const SymbCache_ptr  self, 
  const node_ptr  name 
)
Returns true if the given symbol is a declared DEFINE

Defined in SymbCache.c

boolean 
SymbCache_is_symbol_frozen_var(
  const SymbCache_ptr  self, 
  const node_ptr  name 
)
A variable is frozen if it is known that the var cannot change its value during transitions.

Defined in SymbCache.c

boolean 
SymbCache_is_symbol_function(
  const SymbCache_ptr  self, 
  const node_ptr  name 
)
Returns true if the given symbol is a declared NFunction

Defined in SymbCache.c

boolean 
SymbCache_is_symbol_input_var(
  const SymbCache_ptr  self, 
  const node_ptr  name 
)
Returns true if the given symbol is an input variable.

Defined in SymbCache.c

boolean 
SymbCache_is_symbol_matrix_define(
  const SymbCache_ptr  self, 
  const node_ptr  name 
)
Returns true if the given symbol is a declared MDEFINE

Defined in SymbCache.c

boolean 
SymbCache_is_symbol_parameter(
  const SymbCache_ptr  self, 
  const node_ptr  name 
)
Returns true if the given symbol is a declared formal parameter

Defined in SymbCache.c

boolean 
SymbCache_is_symbol_state_frozen_var(
  const SymbCache_ptr  self, 
  const node_ptr  name 
)
Returns true if the variable is a frozen or a state variable

Defined in SymbCache.c

boolean 
SymbCache_is_symbol_state_var(
  const SymbCache_ptr  self, 
  const node_ptr  name 
)
Returns true if the given symbol is a state variable.

Defined in SymbCache.c

boolean 
SymbCache_is_symbol_symbol_type(
  const SymbCache_ptr  self, 
  const node_ptr  name 
)
Returns true if the given symbol is a declared array variable, i.e symbol type

Defined in SymbCache.c

boolean 
SymbCache_is_symbol_var(
  const SymbCache_ptr  self, 
  const node_ptr  name 
)
Returns true if the given symbol is either a state, a frozen or an input variable.

Defined in SymbCache.c

boolean 
SymbCache_list_contains_input_var(
  const SymbCache_ptr  self, 
  const NodeList_ptr  var_list 
)
The given list of variables is traversed until an input variable is found

Defined in SymbCache.c

boolean 
SymbCache_list_contains_state_frozen_var(
  const SymbCache_ptr  self, 
  const NodeList_ptr  var_list 
)
The given list of variables is traversed until a state or frozen variable is found

Defined in SymbCache.c

boolean 
SymbCache_list_contains_undef_var(
  const SymbCache_ptr  self, 
  const NodeList_ptr  var_list 
)
Iterates through the elements in var_list checking each one to see if it is one undeclared variable.

Defined in SymbCache.c

void 
SymbCache_new_constant(
  SymbCache_ptr  self, 
  node_ptr  name 
)
This (private) method can be used only by SymbLayer, otherwise the resulting status will be corrupted. Multiple-time declared constant are accepted, and a reference count is kept to deal with them

Defined in SymbCache.c

void 
SymbCache_new_define(
  SymbCache_ptr  self, 
  node_ptr  name, 
  node_ptr  ctx, 
  node_ptr  definition 
)
This (private) method can be used only by SymbLayer, otherwise the resulting status will be corrupted.

Defined in SymbCache.c

void 
SymbCache_new_frozen_var(
  SymbCache_ptr  self, 
  node_ptr  var, 
  SymbType_ptr  type 
)
This (private) method can be used only by SymbLayer, otherwise the resulting status will be corrupted.

See Also SymbCache_redeclare_state_as_frozen_var
Defined in SymbCache.c

void 
SymbCache_new_function(
  SymbCache_ptr  self, 
  node_ptr  name, 
  node_ptr  ctx, 
  NFunction_ptr  fun 
)
This (private) method can be used only by SymbLayer, otherwise the resulting status will be corrupted.

Defined in SymbCache.c

void 
SymbCache_new_input_var(
  SymbCache_ptr  self, 
  node_ptr  var, 
  SymbType_ptr  type 
)
This (private) method can be used only by SymbLayer, otherwise the resulting status will be corrupted.

Defined in SymbCache.c

void 
SymbCache_new_matrix_define(
  SymbCache_ptr  self, 
  node_ptr  name, 
  node_ptr  ctx, 
  node_ptr  definition 
)
This (private) method can be used only by SymbLayer, otherwise the resulting status will be corrupted. Internally we use ARRAY_DEF node to recognize a MDEFINE.

Defined in SymbCache.c

void 
SymbCache_new_parameter(
  SymbCache_ptr  self, 
  node_ptr  formal, 
  node_ptr  ctx, 
  node_ptr  actual 
)
This (private) method can be used only by SymbLayer, otherwise the resulting status will be corrupted.

Defined in SymbCache.c

void 
SymbCache_new_state_var(
  SymbCache_ptr  self, 
  node_ptr  var, 
  SymbType_ptr  type 
)
This (private) method can be used only by SymbLayer, otherwise the resulting status will be corrupted.

Defined in SymbCache.c

void 
SymbCache_new_symbol_type(
  SymbCache_ptr  self, 
  node_ptr  name, 
  SymbType_ptr  type 
)
This (private) method can be used only by SymbLayer, otherwise the resulting status will be corrupted.

Defined in SymbCache.c

void 
SymbCache_redeclare_state_as_frozen_var(
  SymbCache_ptr  self, 
  node_ptr  name 
)
A variable is frozen if it is known that its value cannot be changed during transitions. The given 'name' has to be already declared state variable and not yet redeclared as frozen.

See Also SymbCache_new_frozen_var
Defined in SymbCache.c

void 
SymbCache_remove_constant(
  SymbCache_ptr  self, 
  node_ptr  constant 
)
Removal is performed taking into account of reference counting, as constants can be shared among several layers. This (private) method can be used only by SymbLayer, otherwise the resulting status will be corrupted.

Defined in SymbCache.c

void 
SymbCache_remove_define(
  SymbCache_ptr  self, 
  node_ptr  define 
)
This (private) method can be used only by SymbLayer, otherwise the resulting status will be corrupted.

Defined in SymbCache.c

void 
SymbCache_remove_function(
  SymbCache_ptr  self, 
  node_ptr  fun 
)
This (private) method can be used only by SymbLayer, otherwise the resulting status will be corrupted.

Defined in SymbCache.c

void 
SymbCache_remove_parameter(
  SymbCache_ptr  self, 
  node_ptr  formal 
)
This (private) method can be used only by SymbLayer, otherwise the resulting status will be corrupted.

Defined in SymbCache.c

void 
SymbCache_remove_var(
  SymbCache_ptr  self, 
  node_ptr  var 
)
This (private) method can be used only by SymbLayer, otherwise the resulting status will be corrupted.

Defined in SymbCache.c

node_ptr 
SymbCache_resolve_define_chain(
  const SymbCache_ptr  self, 
  const node_ptr  define 
)
Give a chain of defines, it returns the last no atomic element of the chain. E.g. DEFINE a := b; b := c; c := expr; then in this case the call on

Defined in SymbCache.c

boolean 
SymbLayer_can_declare_constant(
  const SymbLayer_ptr  self, 
  const node_ptr  name 
)
Since more than one layer can declare the same constants, this method might return true even if another layer already contain the given constant. If the constant had already been declared within self, false is returned.

Defined in SymbLayer.c

boolean 
SymbLayer_can_declare_define(
  const SymbLayer_ptr  self, 
  const node_ptr  name 
)
Returns true if the given symbol does not exist within the symbol table which self belongs to. Returns false if the symbol was already declared.

Defined in SymbLayer.c

boolean 
SymbLayer_can_declare_function(
  const SymbLayer_ptr  self, 
  const node_ptr  name 
)
Since more than one layer can declare the same NFunctions, this method might return true even if another layer already contain the given NFunction. If the NFunction had already been declared within self, false is returned.

Defined in SymbLayer.c

boolean 
SymbLayer_can_declare_matrix_define(
  const SymbLayer_ptr  self, 
  const node_ptr  name 
)
Returns true if the given symbol does not exist within the symbol table which self belongs to. Returns false if the symbol was already declared.

Defined in SymbLayer.c

boolean 
SymbLayer_can_declare_parameter(
  const SymbLayer_ptr  self, 
  const node_ptr  name 
)
Returns true if the given symbol does not exist within the symbol table which self belongs to. Returns false if the symbol was already declared.

Defined in SymbLayer.c

boolean 
SymbLayer_can_declare_symbol_type(
  const SymbLayer_ptr  self, 
  const node_ptr  name 
)
Returns true if the given symbol does not exist within the symbol table which self belongs to. Returns false if the symbol was already declared.

Defined in SymbLayer.c

boolean 
SymbLayer_can_declare_var(
  const SymbLayer_ptr  self, 
  const node_ptr  name 
)
Returns true if the given symbol does not exist within the symbol table which self belongs to. Returns false if the symbol was already declared.

Defined in SymbLayer.c

void 
SymbLayer_committed_to_enc(
  SymbLayer_ptr  self 
)
This method is part of a private registration protocol between encodings and layers, and must be considered as a private method. Every time a layer is registered (committed) within an enconding, the layer is notified with a call to this method from the encoding instance which the layer is committed to. This mechanism helps to detect errors when a layer in use by an encoding is removed and destroyed from within a symbol table. The destructor will always check that self is not in use by any encoding when it is invoked.

See Also removed_from_enc
Defined in SymbLayer.c

SymbLayer_ptr 
SymbLayer_create(
  const char* name, 
  const LayerInsertPolicy  policy, 
  SymbCache_ptr  cache 
)
name is copied, the caller keeps ownership of cache.

Defined in SymbLayer.c

void 
SymbLayer_declare_constant(
  SymbLayer_ptr  self, 
  node_ptr  name 
)
A new constant is created

See Also SymbLayer_can_declare_constant
Defined in SymbLayer.c

void 
SymbLayer_declare_define(
  SymbLayer_ptr  self, 
  node_ptr  name, 
  node_ptr  context, 
  node_ptr  definition 
)
A new DEFINE of a given value is created. name must be contestualized, context is provided as a separated information

Defined in SymbLayer.c

void 
SymbLayer_declare_frozen_var(
  SymbLayer_ptr  self, 
  node_ptr  var_name, 
  SymbType_ptr  type 
)
A new frozen variable is created of a given type. The variable type can be created with SymbType_create or returned by funtions SymbTablePkg_..._type. The layer is responsible for destroying the variable's type.

Defined in SymbLayer.c

void 
SymbLayer_declare_function(
  SymbLayer_ptr  self, 
  node_ptr  name, 
  node_ptr  ctx, 
  NFunction_ptr  fun 
)
A new NFunction is declared within the layer. Name must be contestualized, context is provided as a separated information

See Also SymbLayer_can_declare_function
Defined in SymbLayer.c

void 
SymbLayer_declare_input_var(
  SymbLayer_ptr  self, 
  node_ptr  var_name, 
  SymbType_ptr  type 
)
A new input variable is created of a given type. The variable type can be created with SymbType_create or returned by funtions SymbTablePkg_..._type. The layer is responsible for destroying the variable's type.

Defined in SymbLayer.c

void 
SymbLayer_declare_matrix_define(
  SymbLayer_ptr  self, 
  node_ptr  name, 
  node_ptr  context, 
  node_ptr  definition 
)
A new MDEFINE of a given value is created. name must be contestualized, context is provided as a separated information

Defined in SymbLayer.c

void 
SymbLayer_declare_parameter(
  SymbLayer_ptr  self, 
  node_ptr  formal, 
  node_ptr  context, 
  node_ptr  actual 
)
A new parameter of a given value is created. name must be contestualized, context is provided as a separated information

Defined in SymbLayer.c

void 
SymbLayer_declare_state_var(
  SymbLayer_ptr  self, 
  node_ptr  var_name, 
  SymbType_ptr  type 
)
A new state variable is created of a given type. The variable type can be created with SymbType_create or returned by funtions SymbTablePkg_..._type. The layer is responsible for destroying the variable's type.

Defined in SymbLayer.c

void 
SymbLayer_declare_symbol_type(
  SymbLayer_ptr  self, 
  node_ptr  name, 
  SymbType_ptr  type 
)
The specified name will be associated to the give array type in the symbols collection

Defined in SymbLayer.c

void 
SymbLayer_destroy(
  SymbLayer_ptr  self 
)
Class SymbLayer destructor

Defined in SymbLayer.c

NodeList_ptr 
SymbLayer_get_all_symbols(
  const SymbLayer_ptr  self 
)
Self keeps the ownership of the returned instance

Defined in SymbLayer.c

NodeList_ptr 
SymbLayer_get_all_vars(
  const SymbLayer_ptr  self 
)
Self keeps the ownership of the returned instance

Defined in SymbLayer.c

int 
SymbLayer_get_bool_frozen_vars_num(
  const SymbLayer_ptr  self 
)
Returns the number of declared boolean frozen variables

Defined in SymbLayer.c

NodeList_ptr 
SymbLayer_get_bool_frozen_vars(
  const SymbLayer_ptr  self 
)
Self keeps the ownership of the returned instance

Defined in SymbLayer.c

int 
SymbLayer_get_bool_input_vars_num(
  const SymbLayer_ptr  self 
)
Returns the number of declared boolean input variables

Defined in SymbLayer.c

NodeList_ptr 
SymbLayer_get_bool_input_vars(
  const SymbLayer_ptr  self 
)
Self keeps the ownership of the returned instance

Defined in SymbLayer.c

int 
SymbLayer_get_bool_state_vars_num(
  const SymbLayer_ptr  self 
)
Returns the number of declared boolean state variables

Defined in SymbLayer.c

NodeList_ptr 
SymbLayer_get_bool_state_vars(
  const SymbLayer_ptr  self 
)
Self keeps the ownership of the returned instance

Defined in SymbLayer.c

NodeList_ptr 
SymbLayer_get_bool_vars(
  const SymbLayer_ptr  self 
)
WARNING: The *caller* is responsible for destroying the returned instance

Defined in SymbLayer.c

int 
SymbLayer_get_constants_num(
  const SymbLayer_ptr  self 
)
Returns the number of declared contants

Defined in SymbLayer.c

NodeList_ptr 
SymbLayer_get_constants(
  const SymbLayer_ptr  self 
)
Self keeps the ownership of the returned instance

Defined in SymbLayer.c

int 
SymbLayer_get_defines_num(
  const SymbLayer_ptr  self 
)
Returns the number of DEFINEs.

Defined in SymbLayer.c

NodeList_ptr 
SymbLayer_get_defines(
  const SymbLayer_ptr  self 
)
Self keeps the ownership of the returned instance

Defined in SymbLayer.c

int 
SymbLayer_get_frozen_vars_num(
  const SymbLayer_ptr  self 
)
Returns the number of declared frozen variables.

Defined in SymbLayer.c

NodeList_ptr 
SymbLayer_get_frozen_vars(
  const SymbLayer_ptr  self 
)
Self keeps the ownership of the returned instance

Defined in SymbLayer.c

int 
SymbLayer_get_functions_num(
  const SymbLayer_ptr  self 
)
Returns the number of NFunctions.

Defined in SymbLayer.c

NodeList_ptr 
SymbLayer_get_functions(
  const SymbLayer_ptr  self 
)
Self keeps the ownership of the returned instance

Defined in SymbLayer.c

int 
SymbLayer_get_input_vars_num(
  const SymbLayer_ptr  self 
)
Returns the number of declared input variables

Defined in SymbLayer.c

NodeList_ptr 
SymbLayer_get_input_vars(
  const SymbLayer_ptr  self 
)
Self keeps the ownership of the returned instance

Defined in SymbLayer.c

LayerInsertPolicy 
SymbLayer_get_insert_policy(
  const SymbLayer_ptr  self 
)
This method is thought to be used exclusively by class SymbTable

Defined in SymbLayer.c

int 
SymbLayer_get_matrix_defines_num(
  const SymbLayer_ptr  self 
)
Returns the number of MDEFINEs.

Defined in SymbLayer.c

NodeList_ptr 
SymbLayer_get_matrix_defines(
  const SymbLayer_ptr  self 
)
Self keeps the ownership of the returned instance

Defined in SymbLayer.c

const char* 
SymbLayer_get_name(
  const SymbLayer_ptr  self 
)
Returned string must not be freed, it belongs to self

Defined in SymbLayer.c

int 
SymbLayer_get_parameters_num(
  const SymbLayer_ptr  self 
)
Returns the number of parameters.

Defined in SymbLayer.c

NodeList_ptr 
SymbLayer_get_parameters(
  const SymbLayer_ptr  self 
)
Self keeps the ownership of the returned instance

Defined in SymbLayer.c

NodeList_ptr 
SymbLayer_get_state_frozen_vars(
  const SymbLayer_ptr  self 
)
Self keeps the ownership of the returned instance. Returned list is just a concatenation of SymbLayer_get_frozen_vars(self) and SymbLayer_get__state_vars(self).

Defined in SymbLayer.c

int 
SymbLayer_get_state_vars_num(
  const SymbLayer_ptr  self 
)
Returns the number of declared state variables.

Defined in SymbLayer.c

NodeList_ptr 
SymbLayer_get_state_vars(
  const SymbLayer_ptr  self 
)
Self keeps the ownership of the returned instance

Defined in SymbLayer.c

int 
SymbLayer_get_symbol_types_num(
  const SymbLayer_ptr  self 
)
Returns the number of Symbol Types.

Defined in SymbLayer.c

NodeList_ptr 
SymbLayer_get_symbol_types(
  const SymbLayer_ptr  self 
)
Self keeps the ownership of the returned instance

Defined in SymbLayer.c

boolean 
SymbLayer_is_symbol_in_layer(
  SymbLayer_ptr  self, 
  node_ptr  name 
)
Returns true if the symbol is defined in the layer.

Defined in SymbLayer.c

boolean 
SymbLayer_is_variable_in_layer(
  SymbLayer_ptr  self, 
  node_ptr  name 
)
Returns true if the variable is defined in the layer.

Defined in SymbLayer.c

boolean 
SymbLayer_must_insert_before(
  const SymbLayer_ptr  self, 
  const SymbLayer_ptr  other 
)
Compares the insertion policies of self and other, and returns true if self must be inserted *before* other.

Defined in SymbLayer.c

EXTERN void 
SymbLayer_redeclare_state_as_frozen_var(
  SymbLayer_ptr  self, 
  node_ptr  var 
)
A variable is frozen if it is known then the var's value cannot change in transitions. 'var' must be a state variable already defined and not redeclared as frozen.

Defined in SymbLayer.c

void 
SymbLayer_remove_define(
  SymbLayer_ptr  self, 
  node_ptr  name 
)
This method can be called only if self is not currently commited to any encoding. It is not allowed to remove symbols from layers that are committed to any encoder. This is required as caches and other mechanisms may fail to work correctly otherwise.

Defined in SymbLayer.c

void 
SymbLayer_remove_function(
  SymbLayer_ptr  self, 
  node_ptr  name 
)
This method can be called only if self is not currently commited to any encoding. It is not allowed to remove symbols from layers that are committed to any encoder. This is required as caches and other mechanisms may fail to work correctly otherwise.

Defined in SymbLayer.c

void 
SymbLayer_remove_var(
  SymbLayer_ptr  self, 
  node_ptr  name 
)
This method can be called only if self is not currently commited to any encoding. It is not allowed to remove symbols from layers that are committed to any encoder. This is required as caches and other mechanisms may fail to work correctly otherwise.

Defined in SymbLayer.c

void 
SymbLayer_removed_from_enc(
  SymbLayer_ptr  self 
)
This method is part of a private registration protocol between encodings and layers, and must be considered as a private method. Every time a layer is removed (uncommitted) from an enconding, the layer is notified with a call to this method from the encoding instance which the layer is being removed from. This mechanism helps to detect errors when a layer in use by an encoding is removed and destroyed from within a symbol table. The destructor will always check that self is not in use by any encoding when it is invoked.

See Also commit_to_enc
Defined in SymbLayer.c

void 
SymbLayer_set_name(
  SymbLayer_ptr  self, 
  const char* new_name 
)
This method is protected (not usable by users, only used by the symbol table when renaming a layer

Defined in SymbLayer.c

SymbType_ptr 
SymbTablePkg_array_type(
  SymbType_ptr  subtype, 
  int  lower_bound, 
  int  upper_bound 
)
The memory is shared, so you can compare pointers to compare types. De-initialisation of the package destroys this type. PRECONDITION: subtype has to be created with one of SymbTypePkg_.._type function.

Defined in symb_table.c

SymbType_ptr 
SymbTablePkg_boolean_enum_type(
    
)
The memory is shared, so you can compare pointers to compare types. De-initialisation of the package destroys this type.

Defined in symb_table.c

SymbType_ptr 
SymbTablePkg_boolean_set_type(
    
)
The memory is shared, so you can compare pointers to compare types. De-initialisation of the package destroys this type.

Defined in symb_table.c

SymbType_ptr 
SymbTablePkg_error_type(
    
)
The memory is shared, so you can compare pointers to compare types. De-initialisation of the package destroys this type.

Defined in symb_table.c

void 
SymbTablePkg_init(
    
)
This initialisation can be performed only after the Node package and the variable boolean_range have been initialised.

Defined in symb_table.c

SymbType_ptr 
SymbTablePkg_int_symbolic_enum_type(
    
)
The memory is shared, so you can compare pointers to compare types. De-initialisation of the package destroys this type. Do not access the values contained in the type's body.

Defined in symb_table.c

SymbType_ptr 
SymbTablePkg_integer_set_type(
    
)
The memory is shared, so you can compare pointers to compare types. De-initialisation of the package destroys this type.

Defined in symb_table.c

SymbType_ptr 
SymbTablePkg_integer_symbolic_set_type(
    
)
The memory is shared, so you can compare pointers to compare types. De-initialisation of the package destroys this type.

Defined in symb_table.c

SymbType_ptr 
SymbTablePkg_integer_type(
    
)
The memory is shared, so you can compare pointers to compare types. De-initialisation of the package destroys this type.

Defined in symb_table.c

SymbType_ptr 
SymbTablePkg_no_type(
    
)
This type is a type of correct expressions which normally do not have any time. The memory is shared, so you can compare pointers to compare types. De-initialisation of the package destroys this type.

Defined in symb_table.c

SymbType_ptr 
SymbTablePkg_pure_int_enum_type(
    
)
The memory is shared, so you can compare pointers to compare types. De-initialisation of the package destroys this type. Do not access the values contained in the type's body.

Defined in symb_table.c

SymbType_ptr 
SymbTablePkg_pure_symbolic_enum_type(
    
)
The memory is shared, so you can compare pointers to compare types. De-initialisation of the package destroys this type. Do not access the values contained in the type's body.

Defined in symb_table.c

void 
SymbTablePkg_quit(
    
)
WARNING: the package de-initialisation destroys types created with the function SymbTablePkg_..._type. NB: The reason behind this constrain is the following: these functions exploit memory sharing, and this memory is freed during de-initialisation. In any case, the de-initialisation is performed by system "reset" command, and this command also frees all node_ptr, so in any case the symbolic types will be unusable, because they use node_ptr inside. SO, DESTROY ALL SYMBOLIC TYPES CREATED SO FAR BEFORE THE symb_table PACKAGE DE-INITIALISATION!

Defined in symb_table.c

SymbType_ptr 
SymbTablePkg_real_type(
    
)
The memory is shared, so you can compare pointers to compare types. De-initialisation of the package destroys this type.

Defined in symb_table.c

SymbType_ptr 
SymbTablePkg_signed_word_type(
  int  width 
)
The memory is shared, so you can compare pointers to compare types. De-initialisation of the package destroys this type.

Defined in symb_table.c

SymbType_ptr 
SymbTablePkg_statement_type(
    
)
This type is a type of correct expressions which are statements, like assignments, or high-level nodes like TRANS, INIT, etc. The memory is shared, so you can compare pointers to compare types. De-initialisation of the package destroys this type.

Defined in symb_table.c

SymbType_ptr 
SymbTablePkg_string_type(
    
)
The memory is shared, so you can compare pointers to compare types. De-initialisation of the package destroys this type.

Defined in symb_table.c

SymbType_ptr 
SymbTablePkg_symbolic_set_type(
    
)
The memory is shared, so you can compare pointers to compare types. De-initialisation of the package destroys this type.

Defined in symb_table.c

SymbType_ptr 
SymbTablePkg_unsigned_word_type(
  int  width 
)
The memory is shared, so you can compare pointers to compare types. De-initialisation of the package destroys this type.

Defined in symb_table.c

SymbType_ptr 
SymbTablePkg_wordarray_type(
  int  awidth, 
  int  vwidth 
)
The memory is shared, so you can compare pointers to compare types. The association is done based on the cons of awidth and vwidth. De-initialisation of the package destroys this type.

Defined in symb_table.c

SymbTable_ptr 
SymbTable_copy(
  const SymbTable_ptr  self, 
  Set_t  blacklist 
)
Returned ST is allocated and has to be released by caller. The copy is performed iterating over each layer in the Symbol Table. The new ST contains a copy of each layer of the given Symbol Table

See Also SymbTable_create SymbTable_destroy
Defined in SymbTable.c

void 
SymbTable_create_layer_class(
  SymbTable_ptr  self, 
  const char* class_name 
)
This method creates a new class of layers. The class must be not existing. The method can be used to create a class of layers that might be empty. It is not required to create a class before calling methods that use that class, like e.g. SymbTable_layer_add_to_class that wll create the class when not existing. class_name can be NULL to create the default class (whose name must have been previously specified with SymbTable_set_default_layers_class_name)

See Also SymbTable_layer_add_to_class
Defined in SymbTable.c

SymbLayer_ptr 
SymbTable_create_layer(
  SymbTable_ptr  self, 
  const char* layer_name, 
  const LayerInsertPolicy  ins_policy 
)
The created layer is returned. Do not destroy the layer, since it belongs to self. if layer name is NULL, then a temporary name will be searched and a new layer will be created. To retrieve the layer name, query the returned SymbLayer instance.

See Also remove_layer
Defined in SymbTable.c

SymbTable_ptr 
SymbTable_create(
    
)
Class constructor

Defined in SymbTable.c

SymbLayer_ptr 
SymbTable_define_get_layer(
  SymbTable_ptr  self, 
  node_ptr  name 
)
Returns the layer a DEFINE is defined in, NULL if there is no layer containing it.

Defined in SymbTable.c

void 
SymbTable_destroy(
  SymbTable_ptr  self 
)
Class destructor

Defined in SymbTable.c

SymbLayer_ptr 
SymbTable_function_get_layer(
  SymbTable_ptr  self, 
  node_ptr  name 
)
Returns the layer a NFunction is defined in, NULL if there is no layer containing it.

Defined in SymbTable.c

node_ptr 
SymbTable_get_actual_parameter_context(
  const SymbTable_ptr  self, 
  const node_ptr  name 
)
Returns the context of the actual parameter associated with the given formal one

Defined in SymbTable.c

node_ptr 
SymbTable_get_actual_parameter(
  const SymbTable_ptr  self, 
  const node_ptr  name 
)
Returns the actual param of the given formal parameter

Defined in SymbTable.c

array_t* 
SymbTable_get_class_layer_names(
  SymbTable_ptr  self, 
  const char* class_name 
)
Specified class must be existing, or if NULL is specified a default class must have been defined. Returned array belongs to self and has NOT to be destroyed or changed by the caller.

Defined in SymbTable.c

const char* 
SymbTable_get_class_of_layer(
  const SymbTable_ptr  self, 
  const char* layer_name 
)
Returns the name of the class in which the given layer is declared or NULL if there is no such a class.

Defined in SymbTable.c

int 
SymbTable_get_constants_num(
  const SymbTable_ptr  self 
)
Returns the number of all declared constants

Defined in SymbTable.c

NodeList_ptr 
SymbTable_get_constants(
  const SymbTable_ptr  self 
)
Returned instance belongs to self, do not destroy or change it

Defined in SymbTable.c

const char* 
SymbTable_get_default_layers_class_name(
  const SymbTable_ptr  self 
)
Returned string belongs to self, and must be NOT destroyed or changed. Returned string is NULL if not previously set.

See Also SymbTable_set_default_layers_class_name
Defined in SymbTable.c

node_ptr 
SymbTable_get_define_body(
  const SymbTable_ptr  self, 
  const node_ptr  name 
)
Returns the body of the given DEFINE

Defined in SymbTable.c

node_ptr 
SymbTable_get_define_context(
  const SymbTable_ptr  self, 
  const node_ptr  name 
)
Returns the context of the given DEFINE name

Defined in SymbTable.c

node_ptr 
SymbTable_get_define_flatten_body(
  const SymbTable_ptr  self, 
  const node_ptr  name 
)
Returns the flattenized body of the given define

Defined in SymbTable.c

NodeList_ptr 
SymbTable_get_defines(
  const SymbTable_ptr  self 
)
Returned instance belongs to self, do not destroy or change it

Defined in SymbTable.c

node_ptr 
SymbTable_get_determinization_var_name(
  const SymbTable_ptr  self 
)
Returns a valid name for a new determinization variable. Searches in the symbol table for a variable name which is not declared yet, and returns it. Warning: This method does not declare a new variable, it simply finds a valid name for a new determinization variable. If the returned variable name is not used later to declare a new variable, succeed calls to this method may not return a valid name.

See Also symb_table_deinit
Defined in SymbTable.c

node_ptr 
SymbTable_get_flatten_actual_parameter(
  const SymbTable_ptr  self, 
  const node_ptr  name 
)
Returns the flattenized actual parameter of the given formal parameter

Defined in SymbTable.c

node_ptr 
SymbTable_get_fresh_symbol_name(
  SymbTable_ptr  self, 
  const char* tplate 
)
If tplate is NULL then a valid fresh symbol is choosed. NB: here tplate actually means prefix.

Defined in SymbTable.c

int 
SymbTable_get_frozen_vars_num(
  const SymbTable_ptr  self 
)
Returns the number of all declared frozen variables

Defined in SymbTable.c

NodeList_ptr 
SymbTable_get_frozen_vars(
  const SymbTable_ptr  self 
)
Returned instance belongs to self, do not destroy or change it.

Defined in SymbTable.c

node_ptr 
SymbTable_get_function_context(
  const SymbTable_ptr  self, 
  const node_ptr  name 
)
Returns the context of the NFunction with the given name

Defined in SymbTable.c

int 
SymbTable_get_functions_num(
  const SymbTable_ptr  self 
)
Returns the number of all NFunctions

Defined in SymbTable.c

NodeList_ptr 
SymbTable_get_functions(
  const SymbTable_ptr  self 
)
Returned instance belongs to self, do not destroy or change it

Defined in SymbTable.c

NFunction_ptr 
SymbTable_get_function(
  const SymbTable_ptr  self, 
  const node_ptr  name 
)
Returns the NFunction with the given name

Defined in SymbTable.c

NodeList_ptr 
SymbTable_get_i_symbols(
  const SymbTable_ptr  self 
)
Only input variables and DEFINEs can occur within the returned list. Returned list belongs to self, do not destroy it

Defined in SymbTable.c

int 
SymbTable_get_input_vars_num(
  const SymbTable_ptr  self 
)
Returns the number of all declared input variables

Defined in SymbTable.c

NodeList_ptr 
SymbTable_get_input_vars(
  const SymbTable_ptr  self 
)
Returned instance belongs to self, do not destroy or change it

Defined in SymbTable.c

NodeList_ptr 
SymbTable_get_layers_i_symbols(
  SymbTable_ptr  self, 
  const array_t* layer_names 
)
Everytime this method is called, it will create and calculate a new list. layers is an array of strings. WARNING: The returned instance must be destroyed by the caller

Defined in SymbTable.c

NodeList_ptr 
SymbTable_get_layers_i_vars(
  SymbTable_ptr  self, 
  const array_t* layer_names 
)
Everytime this method is called, it will create and calculate a new list. layers is an array of strings. WARNING: The returned instance must be destroyed by the caller

Defined in SymbTable.c

NodeList_ptr 
SymbTable_get_layers_sf_i_symbols(
  SymbTable_ptr  self, 
  const array_t* layer_names 
)
Everytime this method is called, it will create and calculate a new list. layers is an array of strings. WARNING: The returned instance must be destroyed by the caller

Defined in SymbTable.c

NodeList_ptr 
SymbTable_get_layers_sf_i_vars(
  SymbTable_ptr  self, 
  const array_t* layer_names 
)
Everytime this method is called, it will create and calculate a new list. layers is an array of strings. WARNING: The returned instance must be destroyed by the caller

Defined in SymbTable.c

NodeList_ptr 
SymbTable_get_layers_sf_symbols(
  SymbTable_ptr  self, 
  const array_t* layer_names 
)
Everytime this method is called, it will create and calculate a new list. layers is an array of strings. WARNING: The returned instance must be destroyed by the caller. Note: state symbols include frozen variables.

Defined in SymbTable.c

NodeList_ptr 
SymbTable_get_layers_sf_vars(
  SymbTable_ptr  self, 
  const array_t* layer_names 
)
Everytime this method is called, it will create and calculate a new list. layers is an array of strings. WARNING: The returned instance must be destroyed by the caller

Defined in SymbTable.c

NodeList_ptr 
SymbTable_get_layers(
  const SymbTable_ptr  self 
)
The returned list belongs to self. Do not free or change it.

Defined in SymbTable.c

SymbLayer_ptr 
SymbTable_get_layer(
  const SymbTable_ptr  self, 
  const char* layer_name 
)
NULL is returned when the layer does not exist within self. Returned SymbLayer instance belongs to self.

Defined in SymbTable.c

node_ptr 
SymbTable_get_matrix_define_body(
  const SymbTable_ptr  self, 
  const node_ptr  name 
)
Returns the body of the given MDEFINE name

Defined in SymbTable.c

node_ptr 
SymbTable_get_matrix_define_context(
  const SymbTable_ptr  self, 
  const node_ptr  name 
)
Returns the context of the given MDEFINE name

Defined in SymbTable.c

node_ptr 
SymbTable_get_matrix_define_flatten_body(
  const SymbTable_ptr  self, 
  const node_ptr  name 
)
Returns the flattened body of the given MDEFINE name

Defined in SymbTable.c

NodeList_ptr 
SymbTable_get_matrix_defines(
  const SymbTable_ptr  self 
)
Returned instance belongs to self, do not destroy or change it

Defined in SymbTable.c

int 
SymbTable_get_parameters_num(
  const SymbTable_ptr  self 
)
Returns the number of all parameters

Defined in SymbTable.c

NodeList_ptr 
SymbTable_get_parameters(
  const SymbTable_ptr  self 
)
Returned instance belongs to self, do not destroy or change it

Defined in SymbTable.c

NodeList_ptr 
SymbTable_get_sf_i_symbols(
  const SymbTable_ptr  self 
)
Only DEFINEs whose body contains both state (or frozen) and input vars can occur within the returned list. Returned list belongs to self, do not destroy it

Defined in SymbTable.c

NodeList_ptr 
SymbTable_get_sf_symbols(
  const SymbTable_ptr  self 
)
Only state and frozen variables and DEFINEs can occur within the returned list. Returned list belongs to self, do not destroy it

Defined in SymbTable.c

hash_ptr 
SymbTable_get_simplification_hash(
  SymbTable_ptr  self 
)
See function Expr_simplify for more details.

Defined in SymbTable.c

NodeList_ptr 
SymbTable_get_state_frozen_vars(
  const SymbTable_ptr  self 
)
Returned instance belongs to self, do not destroy or change it. This list is just a concatenation of SymbTable_get_frozen_vars(self) and SymbTable_get_state_vars(self).

Defined in SymbTable.c

int 
SymbTable_get_state_vars_num(
  const SymbTable_ptr  self 
)
Returns the number of all declared state variables

Defined in SymbTable.c

NodeList_ptr 
SymbTable_get_state_vars(
  const SymbTable_ptr  self 
)
Returned instance belongs to self, do not destroy or change it. Frozen variables are *not* returned.

Defined in SymbTable.c

SymbCategory 
SymbTable_get_symbol_category(
  const SymbTable_ptr  self, 
  node_ptr  symbol 
)
Possible categories are: state vars, input vars, state only defines, input only defines, state-input defines, state-input-next defines. If a symbol is not properly recognized as one of the above, SYMBOL_INVALID is returned (for constants, for examples). An identifier is var or define. It is also allowed to have arrays with constant index, i.e. if V is identifier than V[5

Side Effects None

Defined in SymbTable.c

SymbType_ptr 
SymbTable_get_symbol_type_type(
  const SymbTable_ptr  self, 
  const node_ptr  name 
)
Returns the body of the given MDEFINE name

Defined in SymbTable.c

NodeList_ptr 
SymbTable_get_symbol_types(
  const SymbTable_ptr  self 
)
Returned instance belongs to self, do not destroy or change it

Defined in SymbTable.c

TypeChecker_ptr 
SymbTable_get_type_checker(
  const SymbTable_ptr  self 
)
Returned instance belongs to self

Defined in SymbTable.c

SymbType_ptr 
SymbTable_get_var_type(
  const SymbTable_ptr  self, 
  const node_ptr  name 
)
The type belongs to the layer, do not destroy it.

Defined in SymbTable.c

int 
SymbTable_get_vars_num(
  const SymbTable_ptr  self 
)
Returns the number of all declared variables

Defined in SymbTable.c

NodeList_ptr 
SymbTable_get_vars(
  const SymbTable_ptr  self 
)
Returned instance belongs to self, do not destroy or change it

Defined in SymbTable.c

boolean 
SymbTable_is_layer_in_class(
  SymbTable_ptr  self, 
  const char* layer_name, 
  const char* class_name 
)
If class_name is NULL, the default class will be checked

Defined in SymbTable.c

boolean 
SymbTable_is_symbol_bool_var(
  const SymbTable_ptr  self, 
  const node_ptr  name 
)
Returns true if the given symbol is a variable of enum type with the values 0 and 1 (boolean)

Defined in SymbTable.c

boolean 
SymbTable_is_symbol_constant(
  const SymbTable_ptr  self, 
  const node_ptr  name 
)
Returns true if the given symbol is a declared constant

Defined in SymbTable.c

boolean 
SymbTable_is_symbol_declared(
  const SymbTable_ptr  self, 
  const node_ptr  name 
)
Returns true if the given symbol is declared

Defined in SymbTable.c

boolean 
SymbTable_is_symbol_define(
  const SymbTable_ptr  self, 
  const node_ptr  name 
)
Returns true if the given symbol is a declared DEFINE

Defined in SymbTable.c

boolean 
SymbTable_is_symbol_frozen_var(
  const SymbTable_ptr  self, 
  const node_ptr  name 
)
Returns true if the given symbol is a frozen variable.

Defined in SymbTable.c

boolean 
SymbTable_is_symbol_function(
  const SymbTable_ptr  self, 
  const node_ptr  name 
)
Returns true if the given symbol is a declared NFunction

Defined in SymbTable.c

boolean 
SymbTable_is_symbol_input_var(
  const SymbTable_ptr  self, 
  const node_ptr  name 
)
Returns true if the given symbol is an input variable.

Defined in SymbTable.c

boolean 
SymbTable_is_symbol_matrix_define(
  const SymbTable_ptr  self, 
  const node_ptr  name 
)
Returns true if the given symbol is a declared MDEFINE

Defined in SymbTable.c

boolean 
SymbTable_is_symbol_parameter(
  const SymbTable_ptr  self, 
  const node_ptr  name 
)
Returns true if the given symbol is a declared parameter

Defined in SymbTable.c

boolean 
SymbTable_is_symbol_state_frozen_var(
  const SymbTable_ptr  self, 
  const node_ptr  name 
)
Returns true if the given symbol is a frozen or a state variable.

Defined in SymbTable.c

boolean 
SymbTable_is_symbol_state_var(
  const SymbTable_ptr  self, 
  const node_ptr  name 
)
Returns true if the given symbol is a state variable.

Defined in SymbTable.c

boolean 
SymbTable_is_symbol_symbol_type(
  const SymbTable_ptr  self, 
  const node_ptr  name 
)
Returns true if the given symbol is a declared Symbol Type

Defined in SymbTable.c

boolean 
SymbTable_is_symbol_var(
  const SymbTable_ptr  self, 
  const node_ptr  name 
)
Returns true if the given symbol is either a state, frozen or an input variable.

Defined in SymbTable.c

boolean 
SymbTable_is_var_finite(
  const SymbTable_ptr  self, 
  const node_ptr  name 
)
Returns true if the given variable has a finite domain

Defined in SymbTable.c

void 
SymbTable_layer_add_to_class(
  SymbTable_ptr  self, 
  const char* layer_name, 
  const char* class_name 
)
A new class will be created if given class does not exist yet. The given layer must be existing.

See Also SymbTable_layer_remove_from_class
Defined in SymbTable.c

boolean 
SymbTable_layer_class_exists(
  SymbTable_ptr  self, 
  const char* class_name 
)
This method checks if class 'class_name' has been previously created in the SymbTable.Returns true if the class exists, false otherwise.

Side Effects None

Defined in SymbTable.c

void 
SymbTable_layer_remove_from_class(
  SymbTable_ptr  self, 
  const char* layer_name, 
  const char* class_name 
)
Given class must be existing, or if NULL default class must be existing. If the layer is not found, nothing happens.

See Also SymbTable_layer_add_to_class
Defined in SymbTable.c

boolean 
SymbTable_list_contains_input_var(
  const SymbTable_ptr  self, 
  const NodeList_ptr  var_list 
)
The given list of variables is traversed until an input variable is found

Defined in SymbTable.c

boolean 
SymbTable_list_contains_state_frozen_var(
  const SymbTable_ptr  self, 
  const NodeList_ptr  var_list 
)
The given list of variables is traversed until a state or frozen variable is found

Defined in SymbTable.c

boolean 
SymbTable_list_contains_undef_var(
  const SymbTable_ptr  self, 
  const NodeList_ptr  var_list 
)
Iterates through the elements in var_list checking each one to see if it is one undeclared variable.

Defined in SymbTable.c

void 
SymbTable_remove_layer(
  SymbTable_ptr  self, 
  SymbLayer_ptr  layer 
)
The layer must be not in use by any encoding, so remove it from all encodings before calling this method. The removed layer will be no longer available after the invocation of this method. If given layer belongs to a set of layer classes, the layer will be removed from the classes as well (meaning that there is no need to remove the layer from the classes it belongs to)

See Also create_layer
Defined in SymbTable.c

void 
SymbTable_rename_layer(
  const SymbTable_ptr  self, 
  const char* layer_name, 
  const char* new_name 
)
Use to rename an existing layer. Useful for example to substitute an existing layer with another.

Defined in SymbTable.c

node_ptr 
SymbTable_resolve_define_chain(
  const SymbTable_ptr  self, 
  const node_ptr  name 
)
Returns the last element of a chain of define

Defined in SymbTable.c

void 
SymbTable_set_default_layers_class_name(
  SymbTable_ptr  self, 
  const char* class_name 
)
Given string is duplicated.

See Also SymbTable_get_default_layers_class_name
Defined in SymbTable.c

SymbLayer_ptr 
SymbTable_symbol_get_layer(
  SymbTable_ptr  self, 
  node_ptr  name 
)
Returns the layer a symbol is defined in, NULL if there is no layer containing it.

Defined in SymbTable.c

SymbLayer_ptr 
SymbTable_variable_get_layer(
  SymbTable_ptr  self, 
  node_ptr  name 
)
Returns the layer a variable is defined in, NULL if there is no layer containing it.

Defined in SymbTable.c

int 
SymbType_calculate_type_size(
  const SymbType_ptr  self 
)
This function can be invoked only on finite-precision valid type of variables. This means that such types as no-type or error-type or real or any memory-shared ones should not be given to this function.

See Also SymbType_create
Defined in SymbType.c

SymbType_ptr 
SymbType_convert_right_to_left(
  SymbType_ptr  leftType, 
  SymbType_ptr  rightType 
)
The implicit conversion is performed in accordance to the type order. NOTE: only memory-shared types can be given to this function.

Defined in SymbType.c

SymbType_ptr 
SymbType_copy(
  const SymbType_ptr  self 
)
This function takes one type and returns its copy. Note: the body of the type is not copied, i.e. just pointer is remembered. See SymbType_create for more info about body. Note: the input type should not be a memory-shared type (since there is no meaning in coping a memory sharing type).

Side Effects allocate memory

See Also SymbType_destroy
Defined in SymbType.c

SymbType_ptr 
SymbType_create_array(
  SymbType_ptr  subtype, 
  int  lower_bound, 
  int  upper_bound 
)
This is specialized version of SymbType_create which is designed for array types only. It is implemented as a special construtor because array types are quite different from all the others. Parameter subtype is the subtype of the array type. This type has to be not-memory-shared and its ownership is passed to created type. I.e. subtype will be destroyed when returned type is destroyed. lower_bound, upper-bound are the lower and upper bounds,resp, of the array. All the constrains about memory, lifetype, etc are the same as for SymbType_create.

Side Effects allocate memory

See Also SymbType_destroy
Defined in SymbType.c

SymbType_ptr 
SymbType_create_memory_sharing_array_type(
  SymbType_ptr  subtype, 
  int  lower_bound, 
  int  upper_bound 
)
The same as SymbType_create_memory_sharing_type but can be used to create array types. subtype has to be memory shared.

Side Effects allocate memory

See Also SymbType_create SymbType_destroy_memory_sharing_type
Defined in SymbType.c

SymbType_ptr 
SymbType_create_memory_sharing_type(
  SymbTypeTag  tag, 
  node_ptr  body 
)
The difference from the public constructor is that this constructor marks the created type as a memory sharing type. As result the public constructor will not be able to destroy memory sharing instance of a type. Use the private constructor SymbType_destroy_memory_sharing_type to destroy such instances.

Side Effects allocate memory

See Also SymbType_create SymbType_destroy_memory_sharing_type
Defined in SymbType.c

SymbType_ptr 
SymbType_create(
  SymbTypeTag  tag, 
  node_ptr  body 
)
The tag must be a correct tag. The 'body' is the additional info corresponding to a particular kind of the type: * for a enum type the body is the list of values; * for boolean type it is special variable boolean_range, * for "INT" or "REAL" the body is unused, and set to Nil; * for signed and unsigned "WORD" it is the NUMBER node defining the width of the type; * for "WORDARRAY", the body is a pair of NUMBER nodes, defining the width of the address, and the width of the value. * for everything else body is Nil; Note that array types have to be created with SymbType_create_array, not with this constructor. Set-types are used with expressions which represent a set values. "NO-TYPE" is used with expressions which normally do not have any type such as assignments. "ERROR" type indicates an error (not an actual type). No-type, error-type and all set-types (boolean-set, integer-set, symbolic-set, symbolic-integer-set) should not be created with this constructor, but only with memory-shared function SymbTablePkg_..._type. The reason behind this constrain is that only expressions (not variables) can have these types, therefore only memory-shared versions of these types are required. The constructor does not create a copy of the body, but just remember the pointer. NB: system "reset" command destroys all node_ptr objects, including those used in SymbType_ptr. So destroy all symbolic types before the destruction of node_ptr objects, i.e. before or during "reset"

Side Effects allocate memory

See Also SymbType_create_array SymbType_destroy
Defined in SymbType.c

void 
SymbType_destroy_memory_sharing_type(
  SymbType_ptr  self 
)
The same as the public destructor SymbType_destroy but 'self' has to be created by private constructor SymbType_create_memory_sharing_type only.

See Also SymbType_create_memory_sharing_type SymbType_create
Defined in SymbType.c

void 
SymbType_destroy(
  SymbType_ptr  self 
)
Deallocate the memory. The destructor does not deallocate memory from the type's body (since the constructor did not created the body). NOTE: If self is a memory sharing type instance, i.e. a type returned by SymbTablePkg_..._type functions then the destructor will not delete the type.

See Also SymbType_create
Defined in SymbType.c

boolean 
SymbType_equals(
  SymbType_ptr  self, 
  SymbType_ptr  oth 
)
True if and only if the given types are equal, the given types can be memory-sharing or not.

Defined in SymbType.c

node_ptr 
SymbType_generate_all_word_values(
  const SymbType_ptr  self 
)
Generates and returns a list of all possible values of a particular Unsigned Word type

Defined in SymbType.c

int 
SymbType_get_array_lower_bound(
  const SymbType_ptr  self 
)
Get array lower bound

Defined in SymbType.c

SymbType_ptr 
SymbType_get_array_subtype(
  const SymbType_ptr  self 
)
The returned pointer belongs to the ginven SymbType_ptr and must not be freed

Defined in SymbType.c

int 
SymbType_get_array_upper_bound(
  const SymbType_ptr  self 
)
Get array upper bound

Defined in SymbType.c

node_ptr 
SymbType_get_enum_type_values(
  const SymbType_ptr  self 
)
The given type has to be a ENUM type. The return list is a list of all possible values of a enum type. This list was provided during construction. NB: Memory sharing types do not have particular values, since they are "simplified".

Defined in SymbType.c

SymbType_ptr 
SymbType_get_greater(
  const SymbType_ptr  type1, 
  const SymbType_ptr  type2 
)
The implicit conversion is performed in accordance to the type order. NOTE: only memory-shared types can be given to this function.

Defined in SymbType.c

SymbType_ptr 
SymbType_get_minimal_common(
  SymbType_ptr  type1, 
  SymbType_ptr  type2 
)
The implicit conversion is performed in accordance to the type order. NOTE: only memory-shared types can be given to this function except for SYMB_TYPE_ARRAY which can be non-memory shared

Defined in SymbType.c

SymbTypeTag 
SymbType_get_tag(
  const SymbType_ptr  self 
)
Returns the tag (the kind) of the type

Defined in SymbType.c

int 
SymbType_get_word_line_number(
  const SymbType_ptr  self 
)
The body of the type, provided during construction, is a node NUMBER specifying the width of the Word or a node CONS specifying the address-value widths or WordArray. This node was create during parsing and contains the line number of the type declaration. NB: The type should not be memory-sharing. NB: Virtually this function is used only in TypeChecker_is_type_wellformed

See Also SymbType_create
Defined in SymbType.c

int 
SymbType_get_word_width(
  const SymbType_ptr  self 
)
The given type should be Word and the body of the type (given to the constructor) should be NUMBER node.

Defined in SymbType.c

int 
SymbType_get_wordarray_awidth(
  const SymbType_ptr  self 
)
.

Defined in SymbType.c

int 
SymbType_get_wordarray_vwidth(
  const SymbType_ptr  self 
)
.

Defined in SymbType.c

boolean 
SymbType_is_array(
  const SymbType_ptr  self 
)
Returns true if the type is an array-type, or else returns false

Defined in SymbType.c

boolean 
SymbType_is_back_comp(
  const SymbType_ptr  type 
)
We distinguish "old" types because we may want to turn off the type checking on these types for backward compatibility. Integer is also considered as "old", because an enum of integer values is always casted to Integer.

Defined in SymbType.c

boolean 
SymbType_is_boolean_enum(
  const SymbType_ptr  self 
)
The kind of enum-type is analysed in the constructor.

See Also SymbType_create
Defined in SymbType.c

boolean 
SymbType_is_enum(
  const SymbType_ptr  self 
)
Returns true if the type is a enum-type, or else returns false

Defined in SymbType.c

boolean 
SymbType_is_error(
  const SymbType_ptr  self 
)
Error type is used to indicate an error

See Also SymbType_create
Defined in SymbType.c

boolean 
SymbType_is_infinite_precision(
  const SymbType_ptr  self 
)
Inifinite-precision types are such as integer and real.

See Also SymbType_create
Defined in SymbType.c

boolean 
SymbType_is_int_symbolic_enum(
  const SymbType_ptr  self 
)
The kind of enum-type is analysed in the constructor.

See Also SymbType_create
Defined in SymbType.c

boolean 
SymbType_is_integer(
  const SymbType_ptr  self 
)
Returns true if the type is a integer-type, or else returns false

Defined in SymbType.c

boolean 
SymbType_is_memory_shared(
  SymbType_ptr  self 
)
True if and only if the given type is memory shared

Defined in SymbType.c

boolean 
SymbType_is_pure_int_enum(
  const SymbType_ptr  self 
)
The kind of enum-type is analysed in the constructor.

See Also SymbType_create
Defined in SymbType.c

boolean 
SymbType_is_pure_symbolic_enum(
  const SymbType_ptr  self 
)
The kind of enum-type is analysed in the constructor.

See Also SymbType_create
Defined in SymbType.c

boolean 
SymbType_is_real(
  const SymbType_ptr  self 
)
Returns true if the type is a real-type, or else returns false

Defined in SymbType.c

boolean 
SymbType_is_set(
  const SymbType_ptr  self 
)
Returns true, if the type is one of the set-types, i.e. boolean-set, integer-set, symbolic-set, integer-symbolic-set, and false otherwise.

See Also SymbType_create
Defined in SymbType.c

boolean 
SymbType_is_signed_word(
  const SymbType_ptr  self 
)
Returns true, if the type is a signed Word type

See Also SymbType_create
Defined in SymbType.c

boolean 
SymbType_is_statement(
  const SymbType_ptr  self 
)
Returns true, if the type is a statement-type, and false otherwise.

See Also SymbType_create
Defined in SymbType.c

boolean 
SymbType_is_string(
  const SymbType_ptr  self 
)
Returns true, if the type is a String type

See Also SymbType_create
Defined in SymbType.c

boolean 
SymbType_is_unsigned_word(
  const SymbType_ptr  self 
)
Returns true, if the type is an unsigned Word type

See Also SymbType_create
Defined in SymbType.c

boolean 
SymbType_is_word_1(
  const SymbType_ptr  self 
)
Returns true, if the type is a Unsigned Word type and the width of the word is 1. Otherwise - returns false.

See Also SymbType_create
Defined in SymbType.c

boolean 
SymbType_is_wordarray(
  const SymbType_ptr  self 
)
.

Defined in SymbType.c

boolean 
SymbType_is_word(
  const SymbType_ptr  self 
)
Returns true, if the type is a Word type (signed or unsigned)

See Also SymbType_create
Defined in SymbType.c

SymbType_ptr 
SymbType_make_from_set_type(
  const SymbType_ptr  self 
)
More precisely the following conversion takes place: boolean-set -> boolean integer-set ->integer symbolic-set -> symbolic-enum integer-symbolic-set -> integer-symbolic-set another type -> the same type The implicit conversion is performed in accordance to the type order. NOTE: only memory-shared types can be given to this function.

See Also SymbType_make_set_type
Defined in SymbType.c

SymbType_ptr 
SymbType_make_memory_shared(
  const SymbType_ptr  self 
)
The input type should have a corresponding memory shared type. For example, function type and error type do not have memory shared instances.

Defined in SymbType.c

SymbType_ptr 
SymbType_make_set_type(
  const SymbType_ptr  self 
)
The implicit conversion is performed in accordance to the type order. NOTE: only memory-shared types can be given to this function.

See Also SymbType_make_type_from_set_type
Defined in SymbType.c

void 
SymbType_print(
  const SymbType_ptr  self, 
  FILE* output_stream 
)
This function is made very similar to print_node. If a Enum type was created with SymbType_create then all its values will be printed, otherwise the type was created with SymbTablePkg_..._type and simplified type name (instead of actual type values) is printed.

Defined in SymbType.c

static boolean 
_resolve_define_chain_is_constant(
  SymbCache_ptr  self, 
  node_ptr  exp 
)
Returns true if the expression is a constant, otherwise it returns false

Defined in SymbCache.c

static node_ptr 
_resolve_define_chain(
  const SymbCache_ptr  self, 
  const node_ptr  expr 
)
Recursively get rid of chain of defines.

Defined in SymbCache.c

static assoc_retval 
class_layers_hash_free(
  char * key, 
  char * data, 
  char * arg 
)
Private destructor used by clas destroyer

See Also symb_table_deinit
Defined in SymbTable.c

static boolean 
node_equal(
  node_ptr  n1, 
  node_ptr  n2 
)
Equality function for node_ptr, used to compare bodies of types in SymbType_equal.

See Also SymbType_equal
Defined in SymbType.c

static void 
symb_cache_define_to_symbols_lists(
  SymbCache_ptr  self, 
  node_ptr  define 
)
This method must be called after all symbols occuring directly or indirectly within its body are all declared. If one or more are undeclared, an internal error occurs.

Defined in SymbCache.c

static void 
symb_cache_deinit(
  SymbCache_ptr  self 
)
Private deinitializer, called by the destructor

See Also symb_cache_init
Defined in SymbCache.c

static void 
symb_cache_init(
  SymbCache_ptr  self, 
  SymbTable_ptr  symb_table 
)
Private initializer, called by the constructor

See Also symb_cache_deinit
Defined in SymbCache.c

static node_ptr 
symb_cache_lookup_symbol(
  const SymbCache_ptr  self, 
  const node_ptr  name 
)
Returned node can be either VAR, FROZENVAR, IVAR or CONTEXT. Value is searched first in the cache, then in the symbol hash

Defined in SymbCache.c

static void 
symb_cache_new_symbol(
  SymbCache_ptr  self, 
  node_ptr  name, 
  node_ptr  value 
)
This takes into account also the caching of last accessed value

Defined in SymbCache.c

static void 
symb_cache_remove_symbol(
  SymbCache_ptr  self, 
  node_ptr  name 
)
A service of the remove_* private methods

Defined in SymbCache.c

static void 
symb_cache_resolve_pending_defines(
  SymbCache_ptr  self 
)
If there are pending DEFINEs that wait for an assignment within the lists of state, input and state-input symbols list, they are resolved and assigned.

Defined in SymbCache.c

static void 
symb_layer_deinit(
  SymbLayer_ptr  self 
)
Called by the destructor

Defined in SymbLayer.c

static void 
symb_layer_init(
  SymbLayer_ptr  self, 
  const char* name, 
  const LayerInsertPolicy  policy, 
  SymbCache_ptr  cache 
)
Called by the constructor

Defined in SymbLayer.c

static array_t* 
symb_table_create_layers_class(
  const SymbTable_ptr  self, 
  const char* class_name 
)
Returns the array of layer class, creating it when needed

Defined in SymbTable.c

static void 
symb_table_deinit(
  SymbTable_ptr  self 
)
Private deinitializer, called by the destructor only

See Also symb_table_init
Defined in SymbTable.c

static SymbCategory 
symb_table_detect_expr_category(
  const SymbTable_ptr  st, 
  const Expr_ptr  expr 
)
Returns the type of a define, for a discussion on symbol categories look the SymbCategory enum description in SymbTable.h

Defined in SymbTable.c

static NodeList_ptr 
symb_table_filter_layer_symbols(
  SymbTable_ptr  self, 
  const char* layer_name, 
  NodeList_ptr  symbols 
)
An empty list is returned if the model layer has not been created yet. The caller is responsible for destroying the returned list

Defined in SymbTable.c

static NodeList_ptr 
symb_table_filter_layers_symbols(
  SymbTable_ptr  self, 
  const array_t* layer_names, 
  NodeList_ptr  symbols 
)
The caller is responsible for destroying the returned list

Defined in SymbTable.c

static array_t* 
symb_table_get_layers_class(
  const SymbTable_ptr  self, 
  const char* class_name 
)
Returns the array of layer class, NULL if class does not exist.

Defined in SymbTable.c

static array_t* 
symb_table_get_layers_from_class(
  const SymbTable_ptr  self, 
  const char* class_name 
)
Returns the array of layer class, or NULL when not existing. Resolves NULL class_name to the default class

Defined in SymbTable.c

static void 
symb_table_init(
  SymbTable_ptr  self 
)
Private initializer, called by the constructor only

See Also symb_table_deinit
Defined in SymbTable.c

static boolean 
symb_table_layer_exists(
  const SymbTable_ptr  self, 
  const char* layer_name 
)
Returns true if the given name corresponds to an already registered layer.

Defined in SymbTable.c

static void 
symb_table_layer_rename_in_class(
  SymbTable_ptr  self, 
  const char* class_name, 
  const char* old_layer_name, 
  const char* new_layer_name 
)
Used internally by remove_layer and rename_layer. To remove, pass NULL as new_layer_name

Defined in SymbTable.c

static enum st_retval 
symb_table_types_hash_cleaner(
  char * c1, 
  char * c2, 
  char * c3 
)
The function is used to free the memory from memory-sharing Word/WordArray/Array types stored in the hash table symb_table_..._type_hash. Used in the SymbTablePkg_quit only

Defined in symb_table.c

 
(
    
)
Returns the flattened body of a mdefine

See Also SymbTable_get_matrix_define_flatten_body
Defined in SymbTable.c

Last updated on 2010/05/19 22h:25