|
||||
File indexing completed on 2025-01-31 10:02:06
0001 /*============================================================================= 0002 Copyright (c) 2001-2003 Daniel Nuffer 0003 Copyright (c) 2001-2007 Hartmut Kaiser 0004 http://spirit.sourceforge.net/ 0005 0006 Distributed under the Boost Software License, Version 1.0. (See accompanying 0007 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 0008 =============================================================================*/ 0009 0010 #ifndef BOOST_SPIRIT_CLASSIC_TREE_PARSE_TREE_UTILS_HPP 0011 #define BOOST_SPIRIT_CLASSIC_TREE_PARSE_TREE_UTILS_HPP 0012 0013 #include <utility> // for std::pair 0014 0015 #include <boost/spirit/home/classic/tree/parse_tree.hpp> // needed for parse tree generation 0016 0017 /////////////////////////////////////////////////////////////////////////////// 0018 namespace boost { 0019 namespace spirit { 0020 BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN 0021 0022 /////////////////////////////////////////////////////////////////////////////// 0023 // 0024 // The function 'get_first_leaf' returnes a reference to the first leaf node 0025 // of the given parsetree. 0026 // 0027 /////////////////////////////////////////////////////////////////////////////// 0028 template <typename T> 0029 tree_node<T> const & 0030 get_first_leaf (tree_node<T> const &node); 0031 0032 /////////////////////////////////////////////////////////////////////////////// 0033 // 0034 // The function 'find_node' finds a specified node through recursive search. 0035 // If the return value is true, the variable to which points the parameter 0036 // 'found_node' will contain the address of the node with the given rule_id. 0037 // 0038 /////////////////////////////////////////////////////////////////////////////// 0039 template <typename T> 0040 bool 0041 find_node (tree_node<T> const &node, parser_id node_to_search, 0042 tree_node<T> const **found_node); 0043 0044 /////////////////////////////////////////////////////////////////////////////// 0045 // 0046 // The function 'get_node_range' return a pair of iterators pointing at the 0047 // range, which contains the elements of a specified node. It's very useful 0048 // for locating all information related with a specified node. 0049 // 0050 /////////////////////////////////////////////////////////////////////////////// 0051 template <typename T> 0052 bool 0053 get_node_range (tree_node<T> const &node, parser_id node_to_search, 0054 std::pair<typename tree_node<T>::const_tree_iterator, 0055 typename tree_node<T>::const_tree_iterator> &nodes); 0056 0057 /////////////////////////////////////////////////////////////////////////////// 0058 BOOST_SPIRIT_CLASSIC_NAMESPACE_END 0059 } // namespace spirit 0060 } // namespace boost 0061 0062 #include <boost/spirit/home/classic/tree/impl/parse_tree_utils.ipp> 0063 0064 #endif
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |