Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/libs/spirit/test/parser_context_test.cpp @ 33

Last change on this file since 33 was 29, checked in by landauf, 16 years ago

updated boost from 1_33_1 to 1_34_1

File size: 794 bytes
Line 
1/*=============================================================================
2    Copyright (c) 2003 Vaclav Vesely
3    http://spirit.sourceforge.net/
4
5    Use, modification and distribution is subject to the Boost Software
6    License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
7    http://www.boost.org/LICENSE_1_0.txt)
8=============================================================================*/
9#include <boost/detail/lightweight_test.hpp>
10#include <boost/spirit/core.hpp>
11#include <boost/spirit/actor/assign_actor.hpp>
12
13using namespace boost;
14using namespace spirit;
15
16int main()
17{
18    rule<parser_context<int> > int_rule = int_p;
19    int result(0);
20    parse("123", int_rule[assign_a(result)]); 
21    BOOST_TEST(result == 123);
22    return boost::report_errors();
23}
24
Note: See TracBrowser for help on using the repository browser.