Update of /cvsroot/boost/boost/boost/wave/grammars
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24959/boost/wave/grammars
Modified Files:
cpp_expression_grammar.hpp cpp_expression_value.hpp
cpp_intlit_grammar.hpp cpp_literal_grammar_gen.hpp
Log Message:
Wave: Added the BOOST_WAVE_SUPPORT_LONGLONG_INTEGER_LITERALS pp configuration
constant.
Index: cpp_expression_grammar.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/wave/grammars/cpp_expression_grammar.hpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- cpp_expression_grammar.hpp 20 Dec 2006 16:55:53 -0000 1.17
+++ cpp_expression_grammar.hpp 4 Jul 2007 18:25:51 -0000 1.18
@@ -100,11 +100,11 @@
{
typedef boost::wave::grammars::closures::closure_value return_type;
bool is_unsigned = false;
- unsigned long ul = intlit_grammar_gen<TokenT>::evaluate(token,
+ uint_literal_type ul = intlit_grammar_gen<TokenT>::evaluate(token,
is_unsigned);
return is_unsigned ?
- return_type(ul) : return_type(static_cast<long>(ul));
+ return_type(ul) :
return_type(static_cast<uint_literal_type>(ul));
}
};
phoenix::function<convert_intlit> const as_intlit;
Index: cpp_expression_value.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/wave/grammars/cpp_expression_value.hpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- cpp_expression_value.hpp 20 Dec 2006 16:55:53 -0000 1.9
+++ cpp_expression_value.hpp 4 Jul 2007 18:25:51 -0000 1.10
@@ -58,10 +58,10 @@
explicit closure_value(unsigned int ui, value_error valid_ =
error_noerror)
: type(is_uint), valid(valid_)
{ value.ui = ui; }
- explicit closure_value(long i, value_error valid_ = error_noerror)
+ explicit closure_value(int_literal_type i, value_error valid_ =
error_noerror)
: type(is_int), valid(valid_)
{ value.i = i; }
- explicit closure_value(unsigned long ui, value_error valid_ =
error_noerror)
+ explicit closure_value(uint_literal_type ui, value_error valid_ =
error_noerror)
: type(is_uint), valid(valid_)
{ value.ui = ui; }
explicit closure_value(bool b, value_error valid_ = error_noerror)
@@ -72,7 +72,7 @@
value_error is_valid() const { return valid; }
// explicit conversion
- friend int as_int(closure_value const& v)
+ friend int_literal_type as_int(closure_value const& v)
{
switch (v.type) {
case is_uint: return v.value.ui;
@@ -81,7 +81,7 @@
}
return v.value.i;
}
- friend unsigned int as_uint(closure_value const& v)
+ friend uint_literal_type as_uint(closure_value const& v)
{
switch (v.type) {
case is_uint: return v.value.ui;
@@ -90,7 +90,7 @@
}
return v.value.i;
}
- friend long as_long(closure_value const& v)
+ friend int_literal_type as_long(closure_value const& v)
{
switch (v.type) {
case is_uint: return v.value.ui;
@@ -99,7 +99,7 @@
}
return v.value.i;
}
- friend unsigned long as_ulong(closure_value const& v)
+ friend uint_literal_type as_ulong(closure_value const& v)
{
switch (v.type) {
case is_uint: return v.value.ui;
@@ -154,14 +154,14 @@
valid = error_noerror;
return *this;
}
- closure_value &operator= (long rhs)
+ closure_value &operator= (int_literal_type rhs)
{
type = is_int;
value.i = rhs;
valid = error_noerror;
return *this;
}
- closure_value &operator= (unsigned long rhs)
+ closure_value &operator= (uint_literal_type rhs)
{
type = is_uint;
value.ui = rhs;
@@ -184,7 +184,7 @@
switch(rhs.type) {
case is_bool:
{
- long result = value.i + as_long(rhs);
+ int_literal_type result = value.i + as_long(rhs);
if (rhs.value.i > 0L && value.i > result ||
rhs.value.i < 0L && value.i < result)
{
@@ -198,7 +198,7 @@
case is_int:
{
- long result = value.i + rhs.value.i;
+ int_literal_type result = value.i + rhs.value.i;
if (rhs.value.i > 0L && value.i > result ||
rhs.value.i < 0L && value.i < result)
{
@@ -212,7 +212,7 @@
case is_uint:
{
- unsigned long result = value.ui + rhs.value.ui;
+ uint_literal_type result = value.ui + rhs.value.ui;
if (result < value.ui) {
valid = error_integer_overflow;
}
@@ -227,7 +227,7 @@
case is_uint:
{
- unsigned long result = value.ui + as_ulong(rhs);
+ uint_literal_type result = value.ui + as_ulong(rhs);
if (result < value.ui) {
valid = error_integer_overflow;
}
@@ -251,7 +251,7 @@
switch(rhs.type) {
case is_bool:
{
- long result = value.i - as_long(rhs);
+ int_literal_type result = value.i - as_long(rhs);
if (rhs.value.i > 0L && result > value.i ||
rhs.value.i < 0L && result < value.i)
{
@@ -265,7 +265,7 @@
case is_int:
{
- long result = value.i - rhs.value.i;
+ int_literal_type result = value.i - rhs.value.i;
if (rhs.value.i > 0L && result > value.i ||
rhs.value.i < 0L && result < value.i)
{
@@ -279,7 +279,7 @@
case is_uint:
{
- unsigned long result = value.ui - rhs.value.ui;
+ uint_literal_type result = value.ui - rhs.value.ui;
if (result > value.ui) {
valid = error_integer_overflow;
}
@@ -296,7 +296,7 @@
switch(rhs.type) {
case is_bool:
{
- unsigned long result = value.ui - as_ulong(rhs);
+ uint_literal_type result = value.ui - as_ulong(rhs);
if (result > value.ui)
{
valid = error_integer_overflow;
@@ -309,7 +309,7 @@
case is_int:
{
- unsigned long result = value.ui - rhs.value.i;
+ uint_literal_type result = value.ui - rhs.value.i;
if (rhs.value.i > 0L && result > value.ui ||
rhs.value.i < 0L && result < value.ui)
{
@@ -323,7 +323,7 @@
case is_uint:
{
- unsigned long result = value.ui - rhs.value.ui;
+ uint_literal_type result = value.ui - rhs.value.ui;
if (result > value.ui) {
valid = error_integer_overflow;
}
@@ -350,7 +350,7 @@
case is_bool: value.i *= as_long(rhs); break;
case is_int:
{
- long result = value.i * rhs.value.i;
+ int_literal_type result = value.i * rhs.value.i;
if (0 != value.i && 0 != rhs.value.i &&
(result / value.i != rhs.value.i ||
result / rhs.value.i != value.i)
@@ -366,7 +366,7 @@
case is_uint:
{
- unsigned long result = value.ui * rhs.value.ui;
+ uint_literal_type result = value.ui * rhs.value.ui;
if (0 != value.ui && 0 != rhs.value.ui &&
(result / value.ui != rhs.value.ui ||
result / rhs.value.ui != value.ui)
@@ -385,8 +385,8 @@
case is_uint:
{
- unsigned long rhs_val = as_ulong(rhs);
- unsigned long result = value.ui * rhs_val;
+ uint_literal_type rhs_val = as_ulong(rhs);
+ uint_literal_type result = value.ui * rhs_val;
if (0 != value.ui && 0 != rhs_val &&
(result / value.ui != rhs_val ||
result / rhs_val != value.ui)
@@ -554,7 +554,7 @@
switch (rhs.type) {
case is_int:
{
- long value = as_long(rhs);
+ int_literal_type value = as_long(rhs);
if (value != 0 && value == -value)
return closure_value(-value, error_integer_overflow);
return closure_value(-value, rhs.valid);
@@ -564,7 +564,7 @@
case is_uint: break;
}
- long value = as_ulong(rhs);
+ int_literal_type value = as_ulong(rhs);
if (value != 0 && value == -value)
return closure_value(-value, error_integer_overflow);
return closure_value(-value, rhs.valid);
@@ -666,7 +666,7 @@
case is_bool:
case is_int:
{
- long shift_by = as_long(rhs);
+ int_literal_type shift_by = as_long(rhs);
if (shift_by > 64)
shift_by = 64;
@@ -678,7 +678,7 @@
case is_uint:
{
- unsigned long shift_by = as_ulong(rhs);
+ uint_literal_type shift_by = as_ulong(rhs);
if (shift_by > 64)
shift_by = 64;
@@ -696,7 +696,7 @@
case is_bool:
case is_int:
{
- long shift_by = as_long(rhs);
+ int_literal_type shift_by = as_long(rhs);
if (shift_by > 64)
shift_by = 64;
@@ -708,7 +708,7 @@
case is_uint:
{
- unsigned long shift_by = as_ulong(rhs);
+ uint_literal_type shift_by = as_ulong(rhs);
if (shift_by > 64)
shift_by = 64;
@@ -731,7 +731,7 @@
case is_bool:
case is_int:
{
- long shift_by = as_long(rhs);
+ int_literal_type shift_by = as_long(rhs);
if (shift_by > 64)
shift_by = 64;
@@ -743,7 +743,7 @@
case is_uint:
{
- unsigned long shift_by = as_ulong(rhs);
+ uint_literal_type shift_by = as_ulong(rhs);
if (shift_by > 64)
shift_by = 64;
@@ -761,7 +761,7 @@
case is_bool:
case is_int:
{
- long shift_by = as_long(rhs);
+ int_literal_type shift_by = as_long(rhs);
if (shift_by > 64)
shift_by = 64;
@@ -773,7 +773,7 @@
case is_uint:
{
- unsigned long shift_by = as_ulong(rhs);
+ uint_literal_type shift_by = as_ulong(rhs);
if (shift_by > 64)
shift_by = 64;
@@ -804,21 +804,21 @@
friend closure_value
operator| (closure_value const &lhs, closure_value const &rhs)
{
- unsigned long result = as_ulong(lhs) | as_ulong(rhs);
+ uint_literal_type result = as_ulong(lhs) | as_ulong(rhs);
return closure_value(result, (value_error)(lhs.valid | rhs.valid));
}
friend closure_value
operator& (closure_value const &lhs, closure_value const &rhs)
{
- unsigned long result = as_ulong(lhs) & as_ulong(rhs);
+ uint_literal_type result = as_ulong(lhs) & as_ulong(rhs);
return closure_value(result, (value_error)(lhs.valid | rhs.valid));
}
friend closure_value
operator^ (closure_value const &lhs, closure_value const &rhs)
{
- unsigned long result = as_ulong(lhs) ^ as_ulong(rhs);
+ uint_literal_type result = as_ulong(lhs) ^ as_ulong(rhs);
return closure_value(result, (value_error)(lhs.valid | rhs.valid));
}
@@ -861,8 +861,8 @@
private:
value_type type;
union {
- long i;
- unsigned long ui;
+ int_literal_type i;
+ uint_literal_type ui;
bool b;
} value;
value_error valid;
Index: cpp_intlit_grammar.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/wave/grammars/cpp_intlit_grammar.hpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- cpp_intlit_grammar.hpp 20 Dec 2006 16:55:53 -0000 1.7
+++ cpp_intlit_grammar.hpp 4 Jul 2007 18:25:51 -0000 1.8
@@ -50,10 +50,11 @@
namespace wave {
namespace grammars {
+///////////////////////////////////////////////////////////////////////////////
namespace closures {
struct intlit_closure
- : boost::spirit::closure<intlit_closure, unsigned long>
+ : boost::spirit::closure<intlit_closure, uint_literal_type>
{
member1 val;
};
@@ -103,7 +104,7 @@
hex_lit =
(ch_p('X') | ch_p('x'))
- >> uint_parser<unsigned long, 16>()
+ >> uint_parser<uint_literal_type, 16>()
[
self.val = arg1,
var(self.is_unsigned) = true
@@ -111,7 +112,7 @@
,
oct_lit =
- !uint_parser<unsigned long, 8>()
+ !uint_parser<uint_literal_type, 8>()
[
self.val = arg1,
var(self.is_unsigned) = true
@@ -119,7 +120,7 @@
,
dec_lit =
- int_parser<long, 10>()
+ uint_parser<uint_literal_type, 10>()
[
self.val = arg1
]
@@ -158,14 +159,14 @@
template <typename TokenT>
BOOST_WAVE_INTLITGRAMMAR_GEN_INLINE
-unsigned long
+uint_literal_type
intlit_grammar_gen<TokenT>::evaluate(TokenT const &token,
bool &is_unsigned)
{
using namespace boost::spirit;
intlit_grammar g(is_unsigned);
-unsigned long result = 0;
+uint_literal_type result = 0;
typename TokenT::string_type const &token_val = token.get_value();
parse_info<typename TokenT::string_type::const_iterator> hit =
parse(token_val.begin(), token_val.end(), g[spirit_assign_actor(result)]);
Index: cpp_literal_grammar_gen.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/wave/grammars/cpp_literal_grammar_gen.hpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- cpp_literal_grammar_gen.hpp 20 Dec 2006 16:55:53 -0000 1.7
+++ cpp_literal_grammar_gen.hpp 4 Jul 2007 18:25:51 -0000 1.8
@@ -42,7 +42,7 @@
template <typename TokenT>
struct BOOST_WAVE_DECL intlit_grammar_gen {
- static unsigned long evaluate(TokenT const &tok, bool &is_unsigned);
+ static uint_literal_type evaluate(TokenT const &tok, bool &is_unsigned);
};
///////////////////////////////////////////////////////////////////////////////
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs