Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r54340 - trunk/boost/spirit/home/support/detail/lexer/parser/tokeniser
From: jamin.hanson_at_[hidden]
Date: 2009-06-25 12:28:43


Author: ben_hanson
Date: 2009-06-25 12:28:42 EDT (Thu, 25 Jun 2009)
New Revision: 54340
URL: http://svn.boost.org/trac/boost/changeset/54340

Log:
Made chr() public for use by parsertl.
Text files modified:
   trunk/boost/spirit/home/support/detail/lexer/parser/tokeniser/re_tokeniser_helper.hpp | 128 ++++++++++++++++++++--------------------
   1 files changed, 64 insertions(+), 64 deletions(-)

Modified: trunk/boost/spirit/home/support/detail/lexer/parser/tokeniser/re_tokeniser_helper.hpp
==============================================================================
--- trunk/boost/spirit/home/support/detail/lexer/parser/tokeniser/re_tokeniser_helper.hpp (original)
+++ trunk/boost/spirit/home/support/detail/lexer/parser/tokeniser/re_tokeniser_helper.hpp 2009-06-25 12:28:42 EDT (Thu, 25 Jun 2009)
@@ -161,6 +161,70 @@
         }
     }
 
+ static CharT chr (state &state_)
+ {
+ CharT ch_ = 0;
+
+ // eos_ has already been checked for.
+ switch (*state_._curr)
+ {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ ch_ = decode_octal (state_);
+ break;
+ case 'a':
+ ch_ = '\a';
+ state_.increment ();
+ break;
+ case 'b':
+ ch_ = '\b';
+ state_.increment ();
+ break;
+ case 'c':
+ ch_ = decode_control_char (state_);
+ break;
+ case 'e':
+ ch_ = 27; // '\e' not recognised by compiler
+ state_.increment ();
+ break;
+ case 'f':
+ ch_ = '\f';
+ state_.increment ();
+ break;
+ case 'n':
+ ch_ = '\n';
+ state_.increment ();
+ break;
+ case 'r':
+ ch_ = '\r';
+ state_.increment ();
+ break;
+ case 't':
+ ch_ = '\t';
+ state_.increment ();
+ break;
+ case 'v':
+ ch_ = '\v';
+ state_.increment ();
+ break;
+ case 'x':
+ ch_ = decode_hex (state_);
+ break;
+ default:
+ ch_ = *state_._curr;
+ state_.increment ();
+ break;
+ }
+
+ return ch_;
+ }
+
 private:
     static const char *charset_shortcut (const char ch_,
         std::size_t &str_len_)
@@ -246,70 +310,6 @@
         return str_;
     }
 
- static CharT chr (state &state_)
- {
- CharT ch_ = 0;
-
- // eos_ has already been checked for.
- switch (*state_._curr)
- {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- ch_ = decode_octal (state_);
- break;
- case 'a':
- ch_ = '\a';
- state_.increment ();
- break;
- case 'b':
- ch_ = '\b';
- state_.increment ();
- break;
- case 'c':
- ch_ = decode_control_char (state_);
- break;
- case 'e':
- ch_ = 27; // '\e' not recognised by compiler
- state_.increment ();
- break;
- case 'f':
- ch_ = '\f';
- state_.increment ();
- break;
- case 'n':
- ch_ = '\n';
- state_.increment ();
- break;
- case 'r':
- ch_ = '\r';
- state_.increment ();
- break;
- case 't':
- ch_ = '\t';
- state_.increment ();
- break;
- case 'v':
- ch_ = '\v';
- state_.increment ();
- break;
- case 'x':
- ch_ = decode_hex (state_);
- break;
- default:
- ch_ = *state_._curr;
- state_.increment ();
- break;
- }
-
- return ch_;
- }
-
     static CharT decode_octal (state &state_)
     {
         std::size_t accumulator_ = 0;


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