FAUST compiler  0.9.9.6b8
patternmatcher.hh
Go to the documentation of this file.
1 
2 #ifndef __PATTERNMATCHER__
3 #define __PATTERNMATCHER__
4 
5 using namespace std;
6 #include <vector>
7 #include "tlib.hh"
8 
9 struct Automaton;
10 
11 /* Create a pattern matching automaton from the given list of rules. */
12 
14 
15 /* Apply the pattern matcher to a single argument, starting from a given state
16  s. Returns the resulting state, modifies the variable bindings E
17  accordingly, and sets C to the resulting closure if a final state is
18  reached. Result will be -1 to indicate a matching failure, and C will be
19  set to nil if no final state has been reached yet. */
20 
21 int apply_pattern_matcher(Automaton *A, // automaton
22  int s, // start state
23  Tree X, // arg to be matched
24  Tree& C, // output closure (if any)
25  vector<Tree>& E); // modified output environments
26 
27 #endif
Automaton * make_pattern_matcher(Tree R)
A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches.
Definition: tree.hh:109
int apply_pattern_matcher(Automaton *A, int s, Tree X, Tree &C, vector< Tree > &E)