Update of /cvsroot/boost/boost/boost/wave/util
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8973/boost/wave/util

Modified Files:
        cpp_iterator.hpp 
Log Message:
Added new preprocessing hook function: found_line_directive() to be called when 
a #line directive is encountered.

Index: cpp_iterator.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/wave/util/cpp_iterator.hpp,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- cpp_iterator.hpp    24 Jun 2006 20:44:30 -0000      1.45
+++ cpp_iterator.hpp    25 Jun 2006 17:17:28 -0000      1.46
@@ -1744,13 +1744,14 @@
 
     template <typename IteratorT, typename StringT>
     bool retrieve_line_info (IteratorT first, IteratorT const &last,
-        int &line, StringT &file)
+        unsigned int &line, StringT &file)
     {
         using namespace boost::wave;
-        if (T_PP_NUMBER == token_id(*first)) {
+        token_id id = token_id(*first);
+        if (T_PP_NUMBER == id || T_INTLIT == id) {
         // extract line number
             using namespace std;    // some systems have atoi in namespace std
-            line = atoi((*first).get_value().c_str());
+            line = (unsigned int)atoi((*first).get_value().c_str());
             
         // extract file name (if it is given)
             while (++first != last && IS_CATEGORY(*first, 
WhiteSpaceTokenType)) 
@@ -1797,15 +1798,13 @@
     
 // try to interpret the #line body as a number followed by an optional
 // string literal
-int line = 0;
+unsigned int line = 0;
 string_type file_name;
+token_sequence_type toexpand;
 
+    std::copy(first, last, std::inserter(toexpand, toexpand.end()));
     if (!retrieve_line_info(first, last, line, file_name)) {
     // preprocess the body of this #line message
-    token_sequence_type toexpand;
-
-        std::copy(first, make_ref_transform_iterator(end, get_value),
-            std::inserter(toexpand, toexpand.end()));
 
         typename token_sequence_type::iterator begin2 = toexpand.begin();
         ctx.expand_whole_tokensequence(begin2, toexpand.end(), 
@@ -1817,6 +1816,15 @@
             BOOST_WAVE_THROW(preprocess_exception, bad_line_statement, 
                 boost::wave::util::impl::as_string(expanded).c_str(), act_pos)
         }
+
+    // call the corresponding pp hook function
+        ctx.get_hooks().found_line_directive(ctx, expanded, line, 
+            file_name.c_str());
+    }
+    else {
+    // call the corresponding pp hook function
+        ctx.get_hooks().found_line_directive(ctx, toexpand, line, 
+            file_name.c_str());
     }
     
 // the queues should be empty at this point


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs

Reply via email to