File: patternmatcher.hh

package info (click to toggle)
faust 0.9.46-2
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 15,256 kB
  • ctags: 9,961
  • sloc: cpp: 47,746; sh: 2,254; ansic: 1,503; makefile: 1,211; ruby: 950; yacc: 468; objc: 459; lex: 200; xml: 177
file content (27 lines) | stat: -rw-r--r-- 859 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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