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
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
NodeList_ptr
SymbCache_get_input_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
NodeList_ptr
SymbCache_get_state_input_symbols(
const SymbCache_ptr self
)
- Only DEFINEs whose body contains both state 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_state_symbols(
const SymbCache_ptr self
)
- Only state 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_vars(
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_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_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_var(
const SymbCache_ptr self,
const node_ptr name
)
- Returns true if the given symbol is either a state 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_var(
const SymbCache_ptr self,
const NodeList_ptr var_list
)
- The given list of variables is traversed until
a state 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_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_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_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_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
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_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_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_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_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_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
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_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
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_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
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
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
- 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_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_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_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_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
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
void
SymbTable_destroy(
SymbTable_ptr self
)
- Class destructor
- 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
node_ptr
SymbTable_get_define_body(
const SymbTable_ptr self,
const node_ptr name
)
- Returns the body of the given DEFINE name
- 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 name
- Defined in
SymbTable.c
int
SymbTable_get_defines_num(
const SymbTable_ptr self
)
- Returns the number of all DEFINEs
- 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
NodeList_ptr
SymbTable_get_input_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_input_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 terminated by NULL.
WARNING: The returned instance must be destroyed by the caller
- Defined in
SymbTable.c
NodeList_ptr
SymbTable_get_layers_state_input_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 terminated by NULL.
WARNING: The returned instance must be destroyed by the caller
- Defined in
SymbTable.c
NodeList_ptr
SymbTable_get_layers_state_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 terminated by NULL.
WARNING: The returned instance must be destroyed by the caller
- Defined in
SymbTable.c
NodeList_ptr
SymbTable_get_model_input_symbols(
SymbTable_ptr self
)
- The returned instance belongs to self. Everytime this
method is called, it will create and calculate a new list. The
existance of a layer called MODEL_LAYER_NAME will be checked, and if
not found, and empty list will be returned.
WARNING: The returned instance must be destroyed by the caller
- Defined in
SymbTable.c
NodeList_ptr
SymbTable_get_model_state_input_symbols(
SymbTable_ptr self
)
- The returned instance belongs to self. Everytime this
method is called, it will create and calculate a new list. The
existance of a layer called MODEL_LAYER_NAME will be checked, and if
not found, and empty list will be returned.
WARNING: The returned instance must be destroyed by the caller
- Defined in
SymbTable.c
NodeList_ptr
SymbTable_get_model_state_symbols(
SymbTable_ptr self
)
- Everytime this method is called, it will create and
calculate a new list. The existance of a layer called
MODEL_LAYER_NAME will be checked, and if not found, and empty list
will be returned.
WARNING: The returned instance must be destroyed by the caller
- Defined in
SymbTable.c
NodeList_ptr
SymbTable_get_state_input_symbols(
const SymbTable_ptr self
)
- Only DEFINEs whose body contains both state 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_state_symbols(
const SymbTable_ptr self
)
- Only state 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_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
- 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_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_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_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_var(
const SymbTable_ptr self,
const node_ptr name
)
- Returns true if the given symbol is either a state or
an input variable.
- 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_var(
const SymbTable_ptr self,
const NodeList_ptr var_list
)
- The given list of variables is traversed until
a state 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.
- 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
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(
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_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 "INT" or "REAL" the
body is unused, and set to Nil; for "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. 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_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
node_ptr
SymbType_generate_all_word_values(
SymbType_ptr self
)
- Genereate and returns a list of all possible values
of a particular Word type
- Defined in
SymbType.c
node_ptr
SymbType_get_enum_type_values(
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(
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.
- 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.
- Defined in
SymbType.c
SymbTypeTag
SymbType_get_tag(
SymbType_ptr self
)
- Returns the tag (the kind) of the type
- Defined in
SymbType.c
int
SymbType_get_word_line_number(
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(
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(
SymbType_ptr self
)
- .
- Defined in
SymbType.c
int
SymbType_get_wordarray_vwidth(
SymbType_ptr self
)
- .
- Defined in
SymbType.c
boolean
SymbType_is_back_comp(
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(
SymbType_ptr self
)
- The kind of enum-type is analysed in the constructor.
- See Also
SymbType_create
- Defined in
SymbType.c
boolean
SymbType_is_error(
SymbType_ptr self
)
- Error type is used to indicate an error
- See Also
SymbType_create
- Defined in
SymbType.c
boolean
SymbType_is_int_symbolic_enum(
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_int_enum(
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(
SymbType_ptr self
)
- The kind of enum-type is analysed in the constructor.
- See Also
SymbType_create
- Defined in
SymbType.c
boolean
SymbType_is_set(
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_statement(
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_word_1(
SymbType_ptr self
)
- Returns true, if the type is a Word type and the width of
the word is 1. Otherwise - returns false.
- See Also
SymbType_create
- Defined in
SymbType.c
boolean
SymbType_is_word(
SymbType_ptr self
)
- Returns true, if the type is a Word type
- See Also
SymbType_create
- Defined in
SymbType.c
SymbType_ptr
SymbType_make_from_set_type(
SymbType_ptr type
)
- 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 time
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(
SymbType_ptr type
)
- 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(
SymbType_ptr 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_type_from_set_type
- Defined in
SymbType.c
void
SymbType_print(
FILE* output_stream,
SymbType_ptr self
)
- 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 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, 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 void
symb_table_deinit(
SymbTable_ptr self
)
- Private deinitializer, called by the destructor only
- See Also
symb_table_init
- 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 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