FAUST compiler  0.9.9.6b8
Public Member Functions | Public Attributes | List of all members
Automaton Struct Reference

Public Member Functions

 Automaton ()
 
int n_rules ()
 
const list< Rule > & rules (int s)
 
const list< Trans > & trans (int s)
 
bool final (int s)
 
void build (State *st)
 

Public Attributes

vector< State * > state
 
vector< Treerhs
 
int s
 

Detailed Description

Definition at line 187 of file patternmatcher.cpp.

Constructor & Destructor Documentation

Automaton::Automaton ( )
inline

Definition at line 191 of file patternmatcher.cpp.

191 : state(vector<State*>()), rhs(vector<Tree>()), s(0) {}
vector< Tree > rhs
vector< State * > state

Member Function Documentation

void Automaton::build ( State st)

Definition at line 211 of file patternmatcher.cpp.

References isBoxInt(), isBoxReal(), State::match_num, State::s, s, state, and State::trans.

Referenced by make_pattern_matcher().

212 {
213  state.push_back(st);
214  st->s = s++;
215  list<Trans>::const_iterator t;
216  for (t = st->trans.begin(); t != st->trans.end(); t++) {
217  Tree x;
218  double f;
219  int i;
220  if (t->is_cst_trans(x) &&
221  (isBoxInt(x, &i) || isBoxReal(x, &f)))
222  st->match_num = true;
223  build(t->state);
224  }
225 }
bool isBoxInt(Tree t)
Definition: boxes.cpp:78
A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches.
Definition: tree.hh:109
bool match_num
bool isBoxReal(Tree t)
Definition: boxes.cpp:79
vector< State * > state
void build(State *st)
list< Trans > trans

Here is the call graph for this function:

Here is the caller graph for this function:

bool Automaton::final ( int  s)
inline

Definition at line 200 of file patternmatcher.cpp.

References s, and trans().

Referenced by apply_pattern_matcher(), and make_pattern_matcher().

200 { return trans(s).empty(); }
const list< Trans > & trans(int s)

Here is the call graph for this function:

Here is the caller graph for this function:

int Automaton::n_rules ( )
inline

Definition at line 194 of file patternmatcher.cpp.

References rhs.

Referenced by apply_pattern_matcher().

194 { return (int)rhs.size(); }
vector< Tree > rhs

Here is the caller graph for this function:

const list<Rule>& Automaton::rules ( int  s)
inline

Definition at line 196 of file patternmatcher.cpp.

References s, and state.

Referenced by add_subst(), apply_pattern_matcher(), and make_pattern_matcher().

196 { return state[s]->rules; }
vector< State * > state

Here is the caller graph for this function:

const list<Trans>& Automaton::trans ( int  s)
inline

Definition at line 198 of file patternmatcher.cpp.

References s, and state.

Referenced by apply_pattern_matcher_internal(), and final().

198 { return state[s]->trans; }
vector< State * > state

Here is the caller graph for this function:

Member Data Documentation

vector<Tree> Automaton::rhs

Definition at line 189 of file patternmatcher.cpp.

Referenced by apply_pattern_matcher(), make_pattern_matcher(), and n_rules().

int Automaton::s

Definition at line 203 of file patternmatcher.cpp.

Referenced by build(), final(), infereBoxType(), rules(), and trans().

vector<State*> Automaton::state

Definition at line 188 of file patternmatcher.cpp.

Referenced by apply_pattern_matcher_internal(), build(), rules(), and trans().


The documentation for this struct was generated from the following file: