Rename interpretor to interpreter.
[Faustine.git] / interpreter / preprocessor / faust-0.9.47mr3 / compiler / patternmatcher / patternmatcher.hh
diff --git a/interpreter/preprocessor/faust-0.9.47mr3/compiler/patternmatcher/patternmatcher.hh b/interpreter/preprocessor/faust-0.9.47mr3/compiler/patternmatcher/patternmatcher.hh
new file mode 100644 (file)
index 0000000..006d55a
--- /dev/null
@@ -0,0 +1,27 @@
+
+#ifndef __PATTERNMATCHER__
+#define __PATTERNMATCHER__
+
+using namespace std;
+#include <vector>
+#include "tlib.hh"
+
+struct Automaton;
+
+/* Create a pattern matching automaton from the given list of rules. */
+
+Automaton *make_pattern_matcher(Tree R);
+
+/* Apply the pattern matcher to a single argument, starting from a given state
+   s. Returns the resulting state, modifies the variable bindings E
+   accordingly, and sets C to the resulting closure if a final state is
+   reached. Result will be -1 to indicate a matching failure, and C will be
+   set to nil if no final state has been reached yet. */
+
+int apply_pattern_matcher(Automaton *A,                // automaton
+                          int s,               // start state
+                         Tree X,               // arg to be matched
+                         Tree& C,              // output closure (if any)
+                         vector<Tree>& E);     // modified output environments
+
+#endif