DriveHQ Start Menu
Cloud Drive Mapping
Folder Sync
Cloud Backup
True Drop Box
FTP/SFTP Hosting
Group Account
DriveHQ Start Menu
Online File Server
My Storage
|
Manage Shares
|
Publishes
|
Drop Boxes
|
Group Account
WebDAV Drive Mapping
Cloud Drive Home
|
WebDAV Guide
|
Drive Mapping Tool
|
Drive Mapping URL
Complete Data Backup
Backup Guide
|
Online Backup Tool
|
Cloud-to-Cloud Backup
FTP, Email & Web Service
FTP Home
|
FTP Hosting FAQ
|
Email Hosting
|
EmailManager
|
Web Hosting
Help & Resources
About
|
Enterprise Service
|
Partnership
|
Comparisons
|
Support
Quick Links
Security and Privacy
Download Software
Service Manual
Use Cases
Group Account
Online Help
Blog
Contact
Cloud Surveillance
Sign Up
Login
Features
Business Features
Online File Server
FTP Hosting
Cloud Drive Mapping
Cloud File Backup
Email Backup & Hosting
Cloud File Sharing
Folder Synchronization
Group Management
True Drop Box
Full-text Search
AD Integration/SSO
Mobile Access
IP Camera & DVR Solution
More...
Personal Features
Personal Cloud Drive
Backup All Devices
Mobile APPs
Personal Web Hosting
Sub-Account (for Kids)
Home/PC/Kids Monitoring
More...
Software
DriveHQ Drive Mapping Tool
DriveHQ FileManager
DriveHQ Online Backup
DriveHQ Mobile Apps
Pricing
Business Plans & Pricing
Personal Plans & Pricing
Price Comparison with Others
Feature Comparison with Others
Install Mobile App
Sign up
Creating account...
Invalid character in username! Only 0-9, a-z, A-Z, _, -, . allowed.
Username is required!
Invalid email address!
E-mail is required!
Password is required!
Password is invalid!
Password and confirmation do not match.
Confirm password is required!
I accept
Membership Agreement
Please read the Membership Agreement and check "I accept"!
Free Quick Sign-up
Sign-up Page
Log in
Signing in...
Username or e-mail address is required!
Password is required!
Keep me logged in
Quick Login
Forgot Password
Up
Upload
Download
Share
Publish
New Folder
New File
Copy
Cut
Delete
Paste
Rate
Upgrade
Rotate
Effect
Edit
Slide
History
/*============================================================================= Copyright (c) 2002-2003 Joel de Guzman Copyright (c) 2002-2003 Hartmut Kaiser Copyright (c) 2003 Martin Wille http://spirit.sourceforge.net/ Use, modification and distribution is subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) =============================================================================*/ #if !defined(BOOST_SPIRIT_PARSER_TRAITS_HPP) #define BOOST_SPIRIT_PARSER_TRAITS_HPP #include
#include
#include
#include
/////////////////////////////////////////////////////////////////////////////// namespace boost { namespace spirit { /////////////////////////////////////////////////////////////////////////////// // // Parser traits templates // // Used to determine the type and several other characteristics of a given // parser type. // /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// // // The is_parser traits template can be used to tell wether a given // class is a parser. // /////////////////////////////////////////////////////////////////////////////// template
struct is_parser { BOOST_STATIC_CONSTANT(bool, value = (::boost::is_base_and_derived
, T>::value)); // [JDG 2/3/03] simplified implementation by // using boost::is_base_and_derived }; /////////////////////////////////////////////////////////////////////////////// // // The is_unary_composite traits template can be used to tell if a given // parser is a unary parser as for instance kleene_star or optional. // /////////////////////////////////////////////////////////////////////////////// template
struct is_unary_composite { BOOST_STATIC_CONSTANT(bool, value = (::boost::is_convertible< typename UnaryT::parser_category_t, unary_parser_category>::value)); }; /////////////////////////////////////////////////////////////////////////////// // // The is_acction_parser traits template can be used to tell if a given // parser is a action parser, i.e. it is a composite consisting of a // auxilliary parser and an attached semantic action. // /////////////////////////////////////////////////////////////////////////////// template
struct is_action_parser { BOOST_STATIC_CONSTANT(bool, value = (::boost::is_convertible< typename ActionT::parser_category_t, action_parser_category>::value)); }; /////////////////////////////////////////////////////////////////////////////// // // The is_binary_composite traits template can be used to tell if a given // parser is a binary parser as for instance sequence or difference. // /////////////////////////////////////////////////////////////////////////////// template
struct is_binary_composite { BOOST_STATIC_CONSTANT(bool, value = (::boost::is_convertible< typename BinaryT::parser_category_t, binary_parser_category>::value)); }; /////////////////////////////////////////////////////////////////////////////// // // The is_composite_parser traits template can be used to tell if a given // parser is a unary or a binary parser composite type. // /////////////////////////////////////////////////////////////////////////////// template
struct is_composite_parser { BOOST_STATIC_CONSTANT(bool, value = ( ::boost::spirit::is_unary_composite
::value || ::boost::spirit::is_binary_composite
::value)); }; /////////////////////////////////////////////////////////////////////////////// template
struct is_alternative { BOOST_STATIC_CONSTANT(bool, value = ( ::boost::spirit::impl::parser_type_traits
::is_alternative)); }; template
struct is_sequence { BOOST_STATIC_CONSTANT(bool, value = ( ::boost::spirit::impl::parser_type_traits
::is_sequence)); }; template
struct is_sequential_or { BOOST_STATIC_CONSTANT(bool, value = ( ::boost::spirit::impl::parser_type_traits
::is_sequential_or)); }; template
struct is_intersection { BOOST_STATIC_CONSTANT(bool, value = ( ::boost::spirit::impl::parser_type_traits
::is_intersection)); }; template
struct is_difference { BOOST_STATIC_CONSTANT(bool, value = ( ::boost::spirit::impl::parser_type_traits
::is_difference)); }; template
struct is_exclusive_or { BOOST_STATIC_CONSTANT(bool, value = ( ::boost::spirit::impl::parser_type_traits
::is_exclusive_or)); }; template
struct is_optional { BOOST_STATIC_CONSTANT(bool, value = ( ::boost::spirit::impl::parser_type_traits
::is_optional)); }; template
struct is_kleene_star { BOOST_STATIC_CONSTANT(bool, value = ( ::boost::spirit::impl::parser_type_traits
::is_kleene_star)); }; template
struct is_positive { BOOST_STATIC_CONSTANT(bool, value = ( ::boost::spirit::impl::parser_type_traits
::is_positive)); }; /////////////////////////////////////////////////////////////////////////////// // // Parser extraction templates // /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// // // The unary_subject template can be used to return the type of the // parser used as the subject of an unary parser. // If the parser under inspection is not an unary type parser the compilation // will fail. // /////////////////////////////////////////////////////////////////////////////// template
struct unary_subject { BOOST_STATIC_ASSERT(::boost::spirit::is_unary_composite
::value); typedef typename UnaryT::subject_t type; }; /////////////////////////////////////////////////////////////////////////////// // // The get_unary_subject template function returns the parser object, which // is used as the subject of an unary parser. // If the parser under inspection is not an unary type parser the compilation // will fail. // /////////////////////////////////////////////////////////////////////////////// template
inline typename unary_subject
::type const & get_unary_subject(UnaryT const &unary_) { BOOST_STATIC_ASSERT(::boost::spirit::is_unary_composite
::value); return unary_.subject(); } /////////////////////////////////////////////////////////////////////////////// // // The binary_left_subject and binary_right_subject templates can be used to // return the types of the parsers used as the left and right subject of an // binary parser. // If the parser under inspection is not a binary type parser the compilation // will fail. // /////////////////////////////////////////////////////////////////////////////// template
struct binary_left_subject { BOOST_STATIC_ASSERT(::boost::spirit::is_binary_composite
::value); typedef typename BinaryT::left_t type; }; template
struct binary_right_subject { BOOST_STATIC_ASSERT(::boost::spirit::is_binary_composite
::value); typedef typename BinaryT::right_t type; }; /////////////////////////////////////////////////////////////////////////////// // // The get_binary_left_subject and get_binary_right_subject template functions // return the parser object, which is used as the left or right subject of a // binary parser. // If the parser under inspection is not a binary type parser the compilation // will fail. // /////////////////////////////////////////////////////////////////////////////// template
inline typename binary_left_subject
::type const & get_binary_left_subject(BinaryT const &binary_) { BOOST_STATIC_ASSERT(::boost::spirit::is_binary_composite
::value); return binary_.left(); } template
inline typename binary_right_subject
::type const & get_binary_right_subject(BinaryT const &binary_) { BOOST_STATIC_ASSERT(::boost::spirit::is_binary_composite
::value); return binary_.right(); } /////////////////////////////////////////////////////////////////////////////// // // The action_subject template can be used to return the type of the // parser used as the subject of an action parser. // If the parser under inspection is not an action type parser the compilation // will fail. // /////////////////////////////////////////////////////////////////////////////// template
struct action_subject { BOOST_STATIC_ASSERT(::boost::spirit::is_action_parser
::value); typedef typename ActionT::subject_t type; }; /////////////////////////////////////////////////////////////////////////////// // // The get_action_subject template function returns the parser object, which // is used as the subject of an action parser. // If the parser under inspection is not an action type parser the compilation // will fail. // /////////////////////////////////////////////////////////////////////////////// template
inline typename action_subject
::type const & get_action_subject(ActionT const &action_) { BOOST_STATIC_ASSERT(::boost::spirit::is_action_parser
::value); return action_.subject(); } /////////////////////////////////////////////////////////////////////////////// // // The semantic_action template can be used to return the type of the // attached semantic action of an action parser. // If the parser under inspection is not an action type parser the compilation // will fail. // /////////////////////////////////////////////////////////////////////////////// template
struct semantic_action { BOOST_STATIC_ASSERT(::boost::spirit::is_action_parser
::value); typedef typename ActionT::predicate_t type; }; /////////////////////////////////////////////////////////////////////////////// // // The get_semantic_action template function returns the attached semantic // action of an action parser. // If the parser under inspection is not an action type parser the compilation // will fail. // /////////////////////////////////////////////////////////////////////////////// template
inline typename semantic_action
::type const & get_semantic_action(ActionT const &action_) { BOOST_STATIC_ASSERT(::boost::spirit::is_action_parser
::value); return action_.predicate(); } /////////////////////////////////////////////////////////////////////////////// }} // namespace boost::spirit #endif // !defined(BOOST_SPIRIT_PARSER_TRAITS_HPP)
parser_traits.hpp
Page URL
File URL
Prev
3/5
Next
Download
( 11 KB )
Note: The DriveHQ service banners will NOT be displayed if the file owner is a paid member.
Comments
Total ratings:
0
Average rating:
Not Rated
Would you like to comment?
Join DriveHQ
for a free account, or
Logon
if you are already a member.