[pure-lang-svn] SF.net SVN: pure-lang:[606] pure/trunk
Status: Beta
Brought to you by:
agraef
From: <ag...@us...> - 2008-08-25 19:53:32
|
Revision: 606 http://pure-lang.svn.sourceforge.net/pure-lang/?rev=606&view=rev Author: agraef Date: 2008-08-25 19:53:35 +0000 (Mon, 25 Aug 2008) Log Message: ----------- Implement matching operation on expression lists. Modified Paths: -------------- pure/trunk/matcher.cc pure/trunk/matcher.hh Modified: pure/trunk/matcher.cc =================================================================== --- pure/trunk/matcher.cc 2008-08-25 10:25:09 UTC (rev 605) +++ pure/trunk/matcher.cc 2008-08-25 19:53:35 UTC (rev 606) @@ -126,6 +126,14 @@ return 0; } +state *matcher::match(state *st, const exprl& x) +{ + for (exprl::const_iterator it = x.begin(), end = x.end(); + it != end && st; it++) + st = match(st, *it); + return st; +} + /* TA construction algorithm. */ state *matcher::make(const rule& ru, uint32_t skip) Modified: pure/trunk/matcher.hh =================================================================== --- pure/trunk/matcher.hh 2008-08-25 10:25:09 UTC (rev 605) +++ pure/trunk/matcher.hh 2008-08-25 19:53:35 UTC (rev 606) @@ -161,7 +161,7 @@ state *match(const exprl& xs) { assert(start!=0); return match(start, xs); } state *match(state *st, expr x); - state *match(state *st, const exprl& x); // XXXTODO + state *match(state *st, const exprl& x); private: // these are used internally by the TA construction algorithm This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |