|
|
|||
File indexing completed on 2025-12-16 10:09:11
0001 /*============================================================================= 0002 Copyright (c) 2003 Jonathan de Halleux (dehalleux@pelikhan.com) 0003 http://spirit.sourceforge.net/ 0004 0005 Distributed under the Boost Software License, Version 1.0. (See accompanying 0006 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 0007 =============================================================================*/ 0008 #ifndef BOOST_SPIRIT_ACTOR_HPP 0009 #define BOOST_SPIRIT_ACTOR_HPP 0010 0011 #include <boost/spirit/home/classic/version.hpp> 0012 0013 /////////////////////////////////////////////////////////////////////////////// 0014 // 0015 // Actors documentation and convention 0016 // 0017 // Actors 0018 // 0019 // Actors are predefined semantic action functors. They are used to do an 0020 // action on the parse result if the parser has had a successful match. An 0021 // example of actor is the append_actor described in the Spirit 0022 // documentation. 0023 // 0024 // The action takes place through a call to the () operator: single argument 0025 // () operator call for character parsers and two argument (first,last) call 0026 // for phrase parsers. Actors should implement at least one of the two () 0027 // operator. 0028 // 0029 // Actor instances are not created directly since they usually involve a 0030 // number of template parameters. Instead generator functions ("helper 0031 // functions") are provided to generate actors according to their arguments. 0032 // All helper functions have the "_a" suffix. For example, append_actor is 0033 // created using the append_a function. 0034 // 0035 // Policy holder actors and policy actions 0036 // 0037 // A lot of actors need to store reference to one or more objects. For 0038 // example, actions on container need to store a reference to the container. 0039 // Therefore, this kind of actor have been broken down into 0040 // 0041 // - a action policy that does the action (act method), 0042 // - a policy holder actor that stores the references and feeds the act 0043 // method. 0044 // 0045 // Policy holder actors 0046 // 0047 // Policy holder have the following naming convention: 0048 // <member>_ >> *<member> >> !value >> actor 0049 // where member are the policy stored member, they can be of type: 0050 // 0051 // - ref, a reference, 0052 // - const_ref, a const reference, 0053 // - value, by value, 0054 // - empty, no stored members 0055 // - !value states if the policy uses the parse result or not. 0056 // 0057 // The available policy holder are enumerated below: 0058 // 0059 // - empty_actor, nothing stored, feeds parse result 0060 // - value_actor, 1 object stored by value, feeds value 0061 // - ref_actor, 1 reference stored, feeds ref 0062 // - ref_value_actor, 1 reference stored, feeds ref and parse result 0063 // 0064 // Doc. convention 0065 // 0066 // - ref is a reference to an object stored in a policy holder actor, 0067 // - value_ref,value1_ref, value2_ref are a const reference stored in a 0068 // policy holder actor, 0069 // - value is the parse result in the single argument () operator, 0070 // - first,last are the parse result in the two argument () operator 0071 // 0072 // Actors (generator functions) and quick description 0073 // 0074 // - assign_a(ref) assign parse result to ref 0075 // - assign_a(ref, value_ref) assign value_ref to ref 0076 // - increment_a(ref) increment ref 0077 // - decrement_a(ref) decrement ref 0078 // - push_back_a(ref) push back the parse result in ref 0079 // - push_back_a(ref, value_ref) push back value_ref in ref 0080 // - push_front_a(ref) push front the parse result in ref 0081 // - push_front_a(ref, value_ref) push front value_ref in ref 0082 // - insert_key_a(ref,value_ref) insert value_ref in ref using the 0083 // parse result as key 0084 // - insert_at_a(ref, key_ref) insert the parse result in ref at key_ref 0085 // - insert_at_a(ref, key_ref insert value_ref in ref at key_ref 0086 // , value_ref) 0087 // - assign_key_a(ref, value_ref) assign value_ref in ref using the 0088 // parse result as key 0089 // - erase_a(ref, key) erase data at key from ref 0090 // - clear_a(ref) clears ref 0091 // - swap_a(aref, bref) swaps aref and bref 0092 // 0093 /////////////////////////////////////////////////////////////////////////////// 0094 0095 #include <boost/spirit/home/classic/actor/ref_actor.hpp> 0096 #include <boost/spirit/home/classic/actor/ref_value_actor.hpp> 0097 #include <boost/spirit/home/classic/actor/ref_const_ref_actor.hpp> 0098 #include <boost/spirit/home/classic/actor/ref_const_ref_value_actor.hpp> 0099 #include <boost/spirit/home/classic/actor/ref_const_ref_const_ref_a.hpp> 0100 0101 #include <boost/spirit/home/classic/actor/assign_actor.hpp> 0102 #include <boost/spirit/home/classic/actor/clear_actor.hpp> 0103 #include <boost/spirit/home/classic/actor/increment_actor.hpp> 0104 #include <boost/spirit/home/classic/actor/decrement_actor.hpp> 0105 #include <boost/spirit/home/classic/actor/push_back_actor.hpp> 0106 #include <boost/spirit/home/classic/actor/push_front_actor.hpp> 0107 #include <boost/spirit/home/classic/actor/erase_actor.hpp> 0108 #include <boost/spirit/home/classic/actor/insert_key_actor.hpp> 0109 #include <boost/spirit/home/classic/actor/insert_at_actor.hpp> 0110 #include <boost/spirit/home/classic/actor/assign_key_actor.hpp> 0111 #include <boost/spirit/home/classic/actor/swap_actor.hpp> 0112 0113 #endif
| [ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
|
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
|