<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>FAUST compiler: patternmatcher.hh Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.6.3 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>File Members</span></a></li> </ul> </div> <h1>patternmatcher.hh</h1><a href="patternmatcher_8hh.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <a name="l00002"></a>00002 <span class="preprocessor">#ifndef __PATTERNMATCHER__</span> <a name="l00003"></a>00003 <span class="preprocessor"></span><span class="preprocessor">#define __PATTERNMATCHER__</span> <a name="l00004"></a>00004 <span class="preprocessor"></span> <a name="l00005"></a>00005 <span class="keyword">using namespace </span>std; <a name="l00006"></a>00006 <span class="preprocessor">#include <vector></span> <a name="l00007"></a>00007 <span class="preprocessor">#include "<a class="code" href="tlib_8hh.html">tlib.hh</a>"</span> <a name="l00008"></a>00008 <a name="l00009"></a>00009 <span class="keyword">struct </span><a class="code" href="structAutomaton.html">Automaton</a>; <a name="l00010"></a>00010 <a name="l00011"></a>00011 <span class="comment">/* Create a pattern matching automaton from the given list of rules. */</span> <a name="l00012"></a>00012 <a name="l00013"></a>00013 <a class="code" href="structAutomaton.html">Automaton</a> *<a class="code" href="patternmatcher_8cpp.html#a81bb4084b45da5ba7e9bf6f562877543">make_pattern_matcher</a>(<a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> R); <a name="l00014"></a>00014 <a name="l00015"></a>00015 <span class="comment">/* Apply the pattern matcher to a single argument, starting from a given state</span> <a name="l00016"></a>00016 <span class="comment"> s. Returns the resulting state, modifies the variable bindings E</span> <a name="l00017"></a>00017 <span class="comment"> accordingly, and sets C to the resulting closure if a final state is</span> <a name="l00018"></a>00018 <span class="comment"> reached. Result will be -1 to indicate a matching failure, and C will be</span> <a name="l00019"></a>00019 <span class="comment"> set to nil if no final state has been reached yet. */</span> <a name="l00020"></a>00020 <a name="l00021"></a>00021 <span class="keywordtype">int</span> <a class="code" href="patternmatcher_8cpp.html#a9a0cd806f9df515fe14799df5760021b">apply_pattern_matcher</a>(<a class="code" href="structAutomaton.html">Automaton</a> *A, <span class="comment">// automaton</span> <a name="l00022"></a>00022 <span class="keywordtype">int</span> <a class="code" href="structAutomaton.html#a12b5aa75d9587716b139bc41fbb5d695">s</a>, <span class="comment">// start state</span> <a name="l00023"></a>00023 <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> X, <span class="comment">// arg to be matched</span> <a name="l00024"></a>00024 <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a>& C, <span class="comment">// output closure (if any)</span> <a name="l00025"></a>00025 vector<Tree>& E); <span class="comment">// modified output environments</span> <a name="l00026"></a>00026 <a name="l00027"></a>00027 <span class="preprocessor">#endif</span> </pre></div></div> <hr class="footer"/><address style="text-align: right;"><small>Generated on Wed Apr 28 23:59:59 2010 for FAUST compiler by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address> </body> </html>