]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | /*============================================================================= |
2 | Copyright (c) 2003 Jonathan de Halleux (dehalleux@pelikhan.com) | |
3 | http://spirit.sourceforge.net/ | |
4 | ||
5 | Distributed under the Boost Software License, Version 1.0. (See accompanying | |
6 | file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
7 | =============================================================================*/ | |
8 | #ifndef BOOST_SPIRIT_ACTOR_HPP | |
9 | #define BOOST_SPIRIT_ACTOR_HPP | |
10 | ||
11 | #include <boost/spirit/home/classic/version.hpp> | |
12 | ||
13 | /////////////////////////////////////////////////////////////////////////////// | |
14 | // | |
15 | // Actors documentation and convention | |
16 | // | |
17 | // Actors | |
18 | // | |
19 | // Actors are predefined semantic action functors. They are used to do an | |
20 | // action on the parse result if the parser has had a successful match. An | |
21 | // example of actor is the append_actor described in the Spirit | |
22 | // documentation. | |
23 | // | |
24 | // The action takes place through a call to the () operator: single argument | |
25 | // () operator call for character parsers and two argument (first,last) call | |
26 | // for phrase parsers. Actors should implement at least one of the two () | |
27 | // operator. | |
28 | // | |
29 | // Actor instances are not created direcly since they usually involve a | |
30 | // number of template parameters. Instead generator functions ("helper | |
31 | // functions") are provided to generate actors according to their arguments. | |
32 | // All helper functions have the "_a" suffix. For example, append_actor is | |
33 | // created using the append_a function. | |
34 | // | |
35 | // Policy holder actors and policy actions | |
36 | // | |
37 | // A lot of actors need to store reference to one or more objects. For | |
38 | // example, actions on container need to store a reference to the container. | |
39 | // Therefore, this kind of actor have been broken down into | |
40 | // | |
41 | // - a action policy that does the action (act method), | |
42 | // - a policy holder actor that stores the references and feeds the act | |
43 | // method. | |
44 | // | |
45 | // Policy holder actors | |
46 | // | |
47 | // Policy holder have the following naming convention: | |
48 | // <member>_ >> *<member> >> !value >> actor | |
49 | // where member are the policy stored member, they can be of type: | |
50 | // | |
51 | // - ref, a reference, | |
52 | // - const_ref, a const reference, | |
53 | // - value, by value, | |
54 | // - empty, no stored members | |
55 | // - !value states if the policy uses the parse result or not. | |
56 | // | |
57 | // The available policy holder are enumerated below: | |
58 | // | |
59 | // - empty_actor, nothing stored, feeds parse result | |
60 | // - value_actor, 1 object stored by value, feeds value | |
61 | // - ref_actor, 1 reference stored, feeds ref | |
62 | // - ref_value_actor, 1 reference stored, feeds ref and parse result | |
63 | // | |
64 | // Doc. convention | |
65 | // | |
66 | // - ref is a reference to an object stored in a policy holder actor, | |
67 | // - value_ref,value1_ref, value2_ref are a const reference stored in a | |
68 | // policy holder actor, | |
69 | // - value is the parse result in the single argument () operator, | |
70 | // - first,last are the parse result in the two argument () operator | |
71 | // | |
72 | // Actors (generator functions) and quick description | |
73 | // | |
74 | // - assign_a(ref) assign parse result to ref | |
75 | // - assign_a(ref, value_ref) assign value_ref to ref | |
76 | // - increment_a(ref) increment ref | |
77 | // - decrement_a(ref) decrement ref | |
78 | // - push_back_a(ref) push back the parse result in ref | |
79 | // - push_back_a(ref, value_ref) push back value_ref in ref | |
80 | // - push_front_a(ref) push front the parse result in ref | |
81 | // - push_front_a(ref, value_ref) push front value_ref in ref | |
82 | // - insert_key_a(ref,value_ref) insert value_ref in ref using the | |
83 | // parse result as key | |
84 | // - insert_at_a(ref, key_ref) insert the parse result in ref at key_ref | |
85 | // - insert_at_a(ref, key_ref insert value_ref in ref at key_ref | |
86 | // , value_ref) | |
87 | // - assign_key_a(ref, value_ref) assign value_ref in ref using the | |
88 | // parse result as key | |
89 | // - erase_a(ref, key) erase data at key from ref | |
90 | // - clear_a(ref) clears ref | |
91 | // - swap_a(aref, bref) swaps aref and bref | |
92 | // | |
93 | /////////////////////////////////////////////////////////////////////////////// | |
94 | ||
95 | #include <boost/spirit/home/classic/actor/ref_actor.hpp> | |
96 | #include <boost/spirit/home/classic/actor/ref_value_actor.hpp> | |
97 | #include <boost/spirit/home/classic/actor/ref_const_ref_actor.hpp> | |
98 | #include <boost/spirit/home/classic/actor/ref_const_ref_value_actor.hpp> | |
99 | #include <boost/spirit/home/classic/actor/ref_const_ref_const_ref_a.hpp> | |
100 | ||
101 | #include <boost/spirit/home/classic/actor/assign_actor.hpp> | |
102 | #include <boost/spirit/home/classic/actor/clear_actor.hpp> | |
103 | #include <boost/spirit/home/classic/actor/increment_actor.hpp> | |
104 | #include <boost/spirit/home/classic/actor/decrement_actor.hpp> | |
105 | #include <boost/spirit/home/classic/actor/push_back_actor.hpp> | |
106 | #include <boost/spirit/home/classic/actor/push_front_actor.hpp> | |
107 | #include <boost/spirit/home/classic/actor/erase_actor.hpp> | |
108 | #include <boost/spirit/home/classic/actor/insert_key_actor.hpp> | |
109 | #include <boost/spirit/home/classic/actor/insert_at_actor.hpp> | |
110 | #include <boost/spirit/home/classic/actor/assign_key_actor.hpp> | |
111 | #include <boost/spirit/home/classic/actor/swap_actor.hpp> | |
112 | ||
113 | #endif |