dve_symbol_table_t Class Reference

Class which stores the declaration of symbols (see dve_symbol_t). More...

#include <dve_symbol_table.hh>

List of all members.

Public Member Functions

void add_channel (dve_symbol_t *const symbol)
 Appends a symbol of channel to the list of symbols of channels.
void add_process (dve_symbol_t *const symbol)
 Appends a symbol of process to the list of symbols of processes.
void add_state (dve_symbol_t *const symbol)
 Appends a symbol of state to the list of symbols of process states.
void add_variable (dve_symbol_t *const symbol)
 Appends a symbol of variable to the list of symbols of variables.
 dve_symbol_table_t (error_vector_t &evect)
std::size_t find_global_symbol (const char *name) const
 Searches for a symbol in the list of global symbols.
std::size_t find_symbol (const char *name, const std::size_t proc_gid) const
 Searches for a symbol in a given process.
std::size_t find_visible_symbol (const char *name, const std::size_t proc_gid) const
bool found_global_symbol (const char *name) const
 Returns, whether there exists a global symbol of name `name'.
bool found_symbol (const char *name, const std::size_t proc_gid) const
 Returns, whether symbol exists.
const dve_symbol_tget_channel (const std::size_t gid) const
 Returns a pointer to the constant symbol of channel with GID `gid'.
dve_symbol_tget_channel (const std::size_t gid)
 Returns a pointer to the symbol of channel with GID `gid'.
std::size_t get_channel_count () const
 Returns a count of all channels.
const dve_symbol_tget_process (const std::size_t gid) const
 Returns a pointer to the constant symbol of process with GID `gid'.
dve_symbol_tget_process (const std::size_t gid)
 Returns a pointer to the symbol of process with GID `gid'.
std::size_t get_process_count () const
 Returns a count of all variables.
const dve_symbol_tget_state (const std::size_t gid) const
 Returns a pointer to the constant symbol of process state with GID `gid'.
dve_symbol_tget_state (const std::size_t gid)
 Returns a pointer to the symbol of process state with GID `gid'.
std::size_t get_state_count () const
 Returns a count of all variables.
const dve_symbol_tget_symbol (const std::size_t sid) const
dve_symbol_tget_symbol (const std::size_t sid)
 Returns the pointer on a symbol that has a given SID.
std::size_t get_symbol_count () const
 Returns the count of all symbols.
const dve_symbol_tget_variable (const std::size_t gid) const
 Returns a pointer to the constant symbol of variable with GID `gid'.
dve_symbol_tget_variable (const std::size_t gid)
 Returns a pointer to the symbol of variable with GID `gid'.
std::size_t get_variable_count () const
 Returns a count of all variables.
const char * save_token (const char *const token)

Protected Attributes

array_t< dve_symbol_t * > channel_symbs
array_t< dve_symbol_t * > global_symbols
array_t< dve_symbol_t * > process_symbs
array_t< std::size_t > processes_of_symbols
array_t< dve_symbol_t * > state_symbs
array_t< dve_symbol_t * > symbols
array_t< array_t< dve_symbol_t * > * > symbols_of_processes
error_vector_tterr
dve_token_vector_t token_vector
array_t< dve_symbol_t * > variable_symbs


Detailed Description

Class which stores the declaration of symbols (see dve_symbol_t).

Constructor & Destructor Documentation

dve_symbol_table_t ( error_vector_t evect  )  [inline]

METHODS: A constructor.


Member Function Documentation

void add_process ( dve_symbol_t *const   symbol  ) 

Appends a symbol of process to the list of symbols of processes.

Warning:
Important: If the symbol table is the part of system, DO NOT USE THIS METHOD. It would cause the inconsistencies. To avoid it, please use dve_system_t::add_process().

References dve_symbol_t::get_name(), array_t::push_back(), save_token(), dve_symbol_t::set_gid(), dve_symbol_t::set_name(), dve_symbol_t::set_sid(), and array_t::size().

std::size_t find_global_symbol ( const char *  name  )  const

Searches for a symbol in the list of global symbols.

Parameters:
name = name of symbol
Returns:
SID of symbol if the symbol exists in the list of global symbols, otherwise it returns NO_ID.

References find_visible_symbol(), and array_t::size().

Referenced by dve_parser_t::expr_array_mem(), dve_parser_t::expr_id(), dve_parser_t::expr_state_of_process(), dve_parser_t::expr_var_of_process(), find_visible_symbol(), dve_parser_t::system_property(), and dve_parser_t::trans_sync().

std::size_t find_symbol ( const char *  name,
const std::size_t  proc_gid 
) const

Searches for a symbol in a given process.

Parameters:
name = name of symbol
proc_gid = GID of process in which we look for a symbol
Returns:
SID of symbol if the symbol exists in a process with GID proc_gid, otherwise it returns NO_ID.

References array_t::size().

Referenced by dve_parser_t::assertion_create(), dve_parser_t::expr_state_of_process(), find_visible_symbol(), dve_parser_t::state_accept(), dve_parser_t::state_commit(), dve_parser_t::state_init(), and dve_parser_t::trans_create().

std::size_t find_visible_symbol ( const char *  name,
const std::size_t  proc_gid 
) const

Searches for a symbol in a given process and in the list of global symbols.

This method searches for a symbol visible from a process with GID proc_gid. First it searches in the list of symbols of a given process and only then it searches in the list of global symbols.

Parameters:
name = name of symbol
proc_gid = GID of process in which we look for a symbol
Returns:
SID of symbol if the symbol exists in a process or in the list of global symbols, otherwise it returns NO_ID.

References find_global_symbol(), and find_symbol().

Referenced by dve_parser_t::expr_array_mem(), dve_parser_t::expr_id(), and find_global_symbol().

bool found_global_symbol ( const char *  name  )  const

Returns, whether there exists a global symbol of name `name'.

Searches for a symbol in the list of global symbols.

Parameters:
name = name of symbol
Returns:
true iff symbol of name name exists and it is a global symbol

References array_t::size().

bool found_symbol ( const char *  name,
const std::size_t  proc_gid 
) const

Returns, whether symbol exists.

Searches for a symbol in a selected process

Parameters:
name = name of symbol
proc_gid = GID of process
Returns:
true iff symbol was found

References array_t::size().

std::size_t get_channel_count (  )  const [inline]

Returns a count of all channels.

The set of channels in a symbol table should be the same as the set of channels in the entire system that contains this symbol table (if there is such a system)

std::size_t get_process_count (  )  const [inline]

Returns a count of all variables.

The set of processes in a symbol table should be the same as the set of processes in the entire system that contains this symbol table (if there is such a system)

std::size_t get_state_count (  )  const [inline]

Returns a count of all variables.

The set of process states in a symbol table should be the same as the set of process states in the entire system that contains this symbol table (if there is such a system)

Referenced by por_t::init().

const dve_symbol_t* get_symbol ( const std::size_t  sid  )  const [inline]

The same as get_symbol() above, but this is used in a contant instances of dve_symbol_table_t

std::size_t get_symbol_count (  )  const [inline]

Returns the count of all symbols.

Returns the count of all symbols stored in a symbol table. The set of symbols in a symbol table should be the same as the union of sets of all variables, channels, processes and process states in the entire system that contains this symbol table (if there is such a system)

std::size_t get_variable_count (  )  const [inline]

Returns a count of all variables.

The set of variables in a symbol table should be the same as the set of variables in the entire system that contains this symbol table (if there is such a system)

const char* save_token ( const char *const   token  )  [inline]

Stores given string into the internal structure and returns the pointer to this (newly created) string.

Referenced by add_channel(), add_process(), add_state(), and add_variable().


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

Reference Manual for Library, 2006 developed in ParaDiSe laboratory, Faculty of Informatics, Masaryk University