A set of variable names, with indices associated to each type.
More...
#include </home/werner/origo/vish/ocean/parzival/Context.hpp>
List of all members.
Classes
Public Types
Public Member Functions
- virtual bool accessVariable (const type_info &type, const Context::id_t &id, const string &name)
- Allow a derived parser context to determine if a specific variable has actually been used in the parsing process at all.
-
size_t findNumberOfVariables (const type_info &type) const
- Inspect how many variables exist of the given type.
-
id_t findVariable (const type_info &type, const string &s) const
- Find a variable of the given type and name.
-
virtual string getToken () const =0
- Get the currently processed token.
-
id_t insertVariable (const type_info &type, const string &s)
-
int iterate (const type_info &type, Iterator &it)
- Iterate over all variables of a specific type.
Static Public Member Functions
- template<class Type > static bool isVariable (Context &C, id_t &id)
- Look up the current getToken() of the Context if it is known as a valid variable in this Context, and of the certain type.
-
static bool valid (id_t id)
Detailed Description
Member Function Documentation
bool Eagle::Context::accessVariable |
( |
const type_info & |
type, |
|
|
const Context::id_t & |
id, |
|
|
const string & |
name |
|
) |
| [virtual] |
Allow a derived parser context to determine if a specific variable has actually been used in the parsing process at all.
A typical scenario where this is useful is when the value of a variable would be effortsome to compute, or involves retrieving data from disk or network, etc.
- Parameters:
-
type | The type of the variable |
id | The variable identification number |
name | The textual name of the variable |
- Note:
- A future version could allow a derived parser to declare a specific variable as being "unavailable", depending on external circumstances. If so, it could trigger a syntax error. It needs to be investigated if such could be a useful scenario.
- Returns:
- Should return always true, otherwise indicates the variable shall not be used.
template<class Type >
static bool Eagle::Context::isVariable |
( |
Context & |
C, |
|
|
id_t & |
id |
|
) |
| [inline, static] |
The documentation for this class was generated from the following files:
- ocean/parzival/Context.hpp
- ocean/parzival/Context.cpp