|
Boost-Commit : |
From: andreas.pokorny_at_[hidden]
Date: 2007-09-07 06:43:11
Author: mumiee
Date: 2007-09-07 06:43:08 EDT (Fri, 07 Sep 2007)
New Revision: 39152
URL: http://svn.boost.org/trac/boost/changeset/39152
Log:
* adding regex_id and name lookup functions.
Text files modified:
branches/xpressive/nested_dynamic_regex/boost/xpressive/nested_dynamic_compiler.hpp | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
Modified: branches/xpressive/nested_dynamic_regex/boost/xpressive/nested_dynamic_compiler.hpp
==============================================================================
--- branches/xpressive/nested_dynamic_regex/boost/xpressive/nested_dynamic_compiler.hpp (original)
+++ branches/xpressive/nested_dynamic_regex/boost/xpressive/nested_dynamic_compiler.hpp 2007-09-07 06:43:08 EDT (Fri, 07 Sep 2007)
@@ -113,6 +113,25 @@
return this->traits().start->regex;
}
+ regex_id_type const & regex_id(string_type const& name) const
+ {
+ basic_regex<BidiIter> * ptr = this->traits().get_reference(name);
+ return ptr?ptr->regex_id():0;
+ }
+
+ string_type const& regex_id( regex_id_type const& id) const
+ {
+ //TODO reimplement with some kind of bimap
+
+ for( typename table_type::const_iterator it = this->traits().table.begin(),
+ e = this->traits().table.end();it != e; ++it)
+ {
+ if( it->second.regex.regex_id() == id )
+ return it->first;
+ }
+ return string_type();
+ }
+
void add_start(string_type const& name, string_type const& regex)
{
this->traits().add_start( name, regex );
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk