ceta::rule_t Class Reference

List of all members.

Detailed Description

Rule of the form "f(p1, ..., pn) -> q".

The kind of q should equal the output kind of f. If f is a binary operator, there must be at least two states on the left-hand-side and their kinds should equal the kinds of the operator. If f is not binary, then the number of states on the left-hand-side should equal the number of inputs on the operator, and the kind of the ith state should equal the ith input kind of f.

Definition at line 1137 of file ta.hh.

Public Types

typedef std::vector< state_t
>::const_iterator 
lhs_state_iterator
 Type of constant random-access-iterator that can be used to iterate through the left-hand-side states of a rule.

Public Member Functions

template<typename InputIterator>
 rule_t (const op_t &op, InputIterator lhs_states_begin, InputIterator lhs_states_end, const state_t &rhs)
 Constructs a new rule.

Friends

const op_top (const rule_t &rule)
 Returns the operator on left-hand side of rule.
const lhs_state_iterator lhs_states_begin (const rule_t &rule)
 Returns an iterator that points to first state on the left-hand-side of the rule.
const lhs_state_iterator lhs_states_end (const rule_t &rule)
 Returns an iterator that points one past the last state on the left-hand-side of the rule.
const state_trhs (const rule_t &rule)
 Returns the right-hand side of rule.
bool operator== (const rule_t &lhs, const rule_t &rhs)
 Returns true if x equals y.
bool operator< (const rule_t &lhs, const rule_t &rhs)
 Returns true if lhs is less than rhs.

Related Functions

(Note that these are not member functions.)

bool operator!= (const rule_t &lhs, const rule_t &rhs)
 Returns true if lhs does not equal rhs.
const state_tlhs_state (const rule_t &rule, size_t i)
 Returns the state with index i on the left-hand-side of the rule.
size_t lhs_state_count (const rule_t &rule)
 Returns number of states on the left-hand-side of the rule.


Constructor & Destructor Documentation

template<typename InputIterator>
ceta::rule_t::rule_t const op_t op,
InputIterator  lhs_states_begin,
InputIterator  lhs_states_end,
const state_t rhs
[inline]
 

Constructs a new rule.

Parameters:
op The operator on left-hand-side of rule.
lhs_states_begin An input iterator that points to the first state on the left-hand-side of the rule.
lhs_states_end An input iterator that points one past the last state on the left-hand-side of the rule.
rhs The state on the right-hand-side of the rule.

Definition at line 1154 of file ta.hh.


Friends And Related Function Documentation

const state_t & lhs_state const rule_t rule,
size_t  i
[related]
 

Returns the state with index i on the left-hand-side of the rule.

Parameters:
rule A rule.
i An index in the range 0 <= i < lhs_state_count(i)

Definition at line 1245 of file ta.hh.


The documentation for this class was generated from the following file:
Generated on Fri Mar 3 14:38:58 2006 for libceta by  doxygen 1.4.6