|
Last change
on this file since 33 was
29,
checked in by landauf, 17 years ago
|
|
updated boost from 1_33_1 to 1_34_1
|
|
File size:
872 bytes
|
| Line | |
|---|
| 1 | /*============================================================================= |
|---|
| 2 | Copyright (c) 2004 Joao Abecasis |
|---|
| 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 | |
|---|
| 10 | #include <boost/spirit/core/primitives/primitives.hpp> |
|---|
| 11 | #include <boost/spirit/core/non_terminal/rule.hpp> |
|---|
| 12 | |
|---|
| 13 | #include <string> |
|---|
| 14 | |
|---|
| 15 | int main() |
|---|
| 16 | { |
|---|
| 17 | using boost::spirit::rule; |
|---|
| 18 | using boost::spirit::str_p; |
|---|
| 19 | using boost::spirit::ch_p; |
|---|
| 20 | |
|---|
| 21 | using std::string; |
|---|
| 22 | |
|---|
| 23 | string str = "abcd"; |
|---|
| 24 | |
|---|
| 25 | rule<> strings = str_p("abcd"); |
|---|
| 26 | strings = str_p('a'); |
|---|
| 27 | strings = str_p(str.begin(), str.end()); |
|---|
| 28 | |
|---|
| 29 | rule<> chars = ch_p('a'); |
|---|
| 30 | chars = ch_p("b"); |
|---|
| 31 | } |
|---|
| 32 | |
|---|
Note: See
TracBrowser
for help on using the repository browser.