Braden McDaniel | 2 Jul 08:44
Gravatar

Using the result of a Phoenix function in the parse

I have a Phoenix function that returns bool and I'd like to use this
result in the parse; i.e., fail if the function returns false. The
techniques I'm familiar with all involve assigning the result to a
variable and then introducing another function object to test the value.
Is there a less verbose way of doing this? (That is, a way that doesn't
involve writing another function object just to test the value.)

--

-- 
Braden McDaniel                           e-mail: <braden <at> endoframe.com>
<http://endoframe.com>                    Jabber: <braden <at> jabber.org>

-------------------------------------------------------------------------
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/
Fanzhe Cui | 4 Jul 14:48

Problem with wave in boost 1_34_0

Hi, Hartmut and wave experts,

I had a program using wave in boost_33_1 that worked perfect. It used wave
library as a preprocessor to a script parser, and it worked with boost_33_1.
But when I was trying to compile it with wave in boost 1_34_0, I got error.
I think it might be a known problem to you guys and you might know the
solution to the problem. 

The program code that give error was:
    lexer_type it = lexer_type(instr.begin(), instr.end(), pos,
boost::wave::language_support(
boost::wave::support_cpp|boost::wave::support_long_long));

And the error was:

C2039: 'support_long_long' : is not a member of 'boost::wave'
1>c:\users\diamond\src\scriptpreproc.cpp(80) : error C2065:
'support_long_long' : undeclared identifier
1>c:\users\diamond\src\scriptpreproc.cpp(80) : error C2514:
'boost::wave::language_support' : class has no constructors
1>
c:\users\tools\boost\boost_1_34_0\boost\wave\language_support.hpp(25) : see
declaration of 'boost::wave::language_support'
1>c:\users\diamond\src\scriptpreproc.cpp(80) : error C2661:
'boost::wave::cpplexer::lex_iterator<TokenT>::lex_iterator' : no overloaded
function takes 4 arguments

Can you please point me to the right direction or give me a tip to resolve
this problem?

(Continue reading)

Hartmut Kaiser | 4 Jul 16:20
Picon
Gravatar

Re: Problem with wave in boost 1_34_0

Fanz, 

> I had a program using wave in boost_33_1 that worked perfect. 
> It used wave library as a preprocessor to a script parser, 
> and it worked with boost_33_1.
> But when I was trying to compile it with wave in boost 
> 1_34_0, I got error.
> I think it might be a known problem to you guys and you might 
> know the solution to the problem. 
> 
> The program code that give error was:
>     lexer_type it = lexer_type(instr.begin(), instr.end(), 
> pos, boost::wave::language_support( 
> boost::wave::support_cpp|boost::wave::support_long_long));
>    
> And the error was:
> 
> C2039: 'support_long_long' : is not a member of 'boost::wave'
> 1>c:\users\diamond\src\scriptpreproc.cpp(80) : error C2065:
> 'support_long_long' : undeclared identifier
> 1>c:\users\diamond\src\scriptpreproc.cpp(80) : error C2514:
> 'boost::wave::language_support' : class has no constructors
> 1>
> c:\users\tools\boost\boost_1_34_0\boost\wave\language_support.
hpp(25) : see declaration of 'boost::wave::language_support'
> 1>c:\users\diamond\src\scriptpreproc.cpp(80) : error C2661:
> 'boost::wave::cpplexer::lex_iterator<TokenT>::lex_iterator' : 
> no overloaded function takes 4 arguments
> 
> Can you please point me to the right direction or give me a 
(Continue reading)

Hartmut Kaiser | 4 Jul 20:11
Picon
Gravatar

Re: Range checking problem with uint_parser?


> > Actually, I ended up digging into this and fixing it 
> myself, so here goes.
> > 
> > The implementation I've attached works much the same way as 
> in Spirit2. 
> > The key is to do the overflow/underflow tests before actually doing 
> > the calculation, not afterwards.
> 
> Oh I see. Yeah. Spirit2 fixes this problem alright. I did 
> have a patch that someone submitted. I have it somewhere. It 
> has some optimizations to for typical cases (e.g. not doing 
> the checks when unnecessary). I'll look it up and apply it to 
> Spirit1 when I get back home. In the meantime, your fix will 
> surely suffice.
> 
> > I don't know what format you use for diff's so I'm just 
> attaching the 
> > entire file (the fix is against spirit 1.8.4 (shipping with 
> boost 1.34).
> > 
> > If you'd prefer the diffs, please let me know how to 
> produce them and 
> > I'll post these instead (would 'svn diff' work for you?)
> > 
> > I've tested against MSVC8, gcc-3.4.6 and gcc-4.1.2 which are the 
> > compilers I have access to right now.
> 
> Can we wait before I go back? I do not have access to all my 
> files. It'll be another 2 weeks though :(, so if someone 
(Continue reading)

Joel de Guzman | 4 Jul 23:34
Picon
Favicon

Re: Range checking problem with uint_parser?

Hartmut Kaiser wrote:

>>> Incidentally, the bug I fixed revealed a bug in the test suite: In 
>>> numeric_tests.cpp, line 119, max_octal should be "37777777777", not 
>>> "77777777777".
>> Yeah, I noticed that too when I wrote the Spirit2 numerics.
> 
> I applied Martins patch to the Boost CVS::HEAD (it hit me while
> preprocessing certain constructs in Wave). Should we try to get this into
> 1.34.1 as well?

Yes. It is a bug.

Regards,
--

-- 
Joel de Guzman
http://www.boost-consulting.com
http://spirit.sf.net

-------------------------------------------------------------------------
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/
Samuel DEBIONNE | 5 Jul 14:39
Favicon

[Phoenix2] lambda an let tests fail to compile


Hello,
I'am playing with Phoenix 2 for a few days and finds it very usefull  
(could be "promoted" just as Fusion 2 was IMO).

I'm increasing the complexity of my use cases and I'm now facing a problem  
with let and lambda scope utility.
My toolset is MSVC8 SP1 and I follow Harmut advices for the code : a fresh  
checkout from boost CVS and from spirit SVN (spirit/trunk/final). The  
headers are included in the right order.

The tests that fail are those with let/lambda and local variables. Without  
local variables it's fine. One of the failling test is :

     {
         int x = 1, y = 10, z = 13;
         BOOST_TEST(
             lambda(_a = _1, _b = _2)
             [
                 _1 + _a + _b
             ]
             (x, z)(y) == x + y + z
         );
     }

They are (all) failling in the same place, that is in the nested result  
meta-function of the initialize_local class where result is instantiated  
(Actor) with a function type instead of a class type. The compiler output  
stands bellow.

(Continue reading)

Joel de Guzman | 5 Jul 14:51
Picon
Favicon

Re: [Phoenix2] lambda an let tests fail to compile

Samuel DEBIONNE wrote:
> Hello,
> I'am playing with Phoenix 2 for a few days and finds it very usefull  
> (could be "promoted" just as Fusion 2 was IMO).
> 
> I'm increasing the complexity of my use cases and I'm now facing a problem  
> with let and lambda scope utility.
> My toolset is MSVC8 SP1 and I follow Harmut advices for the code : a fresh  
> checkout from boost CVS and from spirit SVN (spirit/trunk/final). The  
> headers are included in the right order.
> 
> The tests that fail are those with let/lambda and local variables. Without  
> local variables it's fine. One of the failling test is :
> 
>      {
>          int x = 1, y = 10, z = 13;
>          BOOST_TEST(
>              lambda(_a = _1, _b = _2)
>              [
>                  _1 + _a + _b
>              ]
>              (x, z)(y) == x + y + z
>          );
>      }
> 
> They are (all) failling in the same place, that is in the nested result  
> meta-function of the initialize_local class where result is instantiated  
> (Actor) with a function type instead of a class type. The compiler output  
> stands bellow.
> 
(Continue reading)

Laz Spirit | 6 Jul 20:15
Picon

Learning Spirit2

Hello,

Is there anywhere(other than the source) we can find more information about spirit2 than what's found in the presentation slides in the doc folder? I find it somewhat hard to piece together from the samples and source alone(although I kinda managed so far)... Is there access to a (possibly incomplete) documentation for it?

Failing that, can someone answer my current question, which is as simple as how to achieve the same functionality in spirit2 that was obtained from chset in spirit1.8?

Also, would you say it's a better idea to try to reuse some spirit1.8 grammar code(that use closures and phoenix functions) to convert it to spirit2 or should I just start rewriting it from the original ebnf spec?

Thank you...

-------------------------------------------------------------------------
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/
_______________________________________________
Spirit-general mailing list
Spirit-general <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spirit-general
Hartmut Kaiser | 6 Jul 20:27
Picon
Gravatar

Re: Learning Spirit2


Hi,

> Is there anywhere(other than the source) we can find more 
> information about spirit2 than what's found in the 
> presentation slides in the doc folder? I find it somewhat 
> hard to piece together from the samples and source 
> alone(although I kinda managed so far)... Is there access to 
> a (possibly incomplete) documentation for it? 

Nope, sorry...

> Failing that, can someone answer my current question, which 
> is as simple as how to achieve the same functionality in 
> spirit2 that was obtained from chset in spirit1.8?

Chset isn't implemented in spirit2 yet. 

> Also, would you say it's a better idea to try to reuse some 
> spirit1.8 grammar code(that use closures and phoenix 
> functions) to convert it to spirit2 or should I just start 
> rewriting it from the original ebnf spec?

Converting from the 1.8 grammar shouldn't be too hard. The required changes
should be straightforward.

Regards Hartmut

-------------------------------------------------------------------------
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/
Reetesh Mukul | 8 Jul 12:12
Picon

Is permutation parser available in spirit-2.0

Hi,

Is permutation parser available in boost-spirit 2.0 ? If yes, can any one point
me towards its docs?

Regards,
Reetesh Mukul

-------------------------------------------------------------------------
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/

Gmane