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 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_SUBRULE_HPP) #define BOOST_SPIRIT_SUBRULE_HPP #include
#include
#include
#include
#include
#include
namespace boost { namespace spirit { /////////////////////////////////////////////////////////////////////////// // // subrules_scanner class // /////////////////////////////////////////////////////////////////////////// template
struct subrules_scanner : public ScannerT { typedef ScannerT scanner_t; typedef ListT list_t; typedef subrules_scanner
self_t; subrules_scanner(ScannerT const& scan, ListT const& list_) : ScannerT(scan), list(list_) {} template
struct rebind_policies { typedef typename rebind_scanner_policies
::type rebind_scanner; typedef subrules_scanner
type; }; template
subrules_scanner< typename rebind_scanner_policies
::type, ListT> change_policies(PoliciesT const& policies) const { typedef subrules_scanner< BOOST_DEDUCED_TYPENAME rebind_scanner_policies
::type, ListT> subrules_scanner_t; return subrules_scanner_t( ScannerT::change_policies(policies), list); } template
struct rebind_iterator { typedef typename rebind_scanner_iterator
::type rebind_scanner; typedef subrules_scanner
type; }; template
subrules_scanner< typename rebind_scanner_iterator
::type, ListT> change_iterator(IteratorT const& first, IteratorT const &last) const { typedef subrules_scanner< BOOST_DEDUCED_TYPENAME rebind_scanner_iterator
::type, ListT> subrules_scanner_t; return subrules_scanner_t( ScannerT::change_iterator(first, last), list); } ListT const& list; }; /////////////////////////////////////////////////////////////////////////// // // subrule_scanner type computer class // // This computer ensures that the scanner will not be recursively // instantiated if it's not needed. // /////////////////////////////////////////////////////////////////////////// template
struct subrules_scanner_finder { typedef subrules_scanner
type; }; template
struct subrules_scanner_finder
, ListT> { typedef subrules_scanner
type; }; /////////////////////////////////////////////////////////////////////////// // // subrule_list class // /////////////////////////////////////////////////////////////////////////// template
struct subrule_list : public parser
> { typedef subrule_list
self_t; typedef FirstT first_t; typedef RestT rest_t; subrule_list(FirstT const& first_, RestT const& rest_) : first(first_), rest(rest_) {} template
struct result { typedef typename parser_result
::type type; }; template
typename parser_result
::type parse(ScannerT const& scan) const { typedef typename subrules_scanner_finder
::type subrules_scanner_t; subrules_scanner_t g_arg(scan, *this); return first.start.parse(g_arg); } template
subrule_list< FirstT, subrule_list< subrule_parser
, RestT> > operator,(subrule_parser
const& rhs) { return subrule_list< FirstT, subrule_list< subrule_parser
, RestT> >( first, subrule_list< subrule_parser
, RestT>(rhs, rest)); } FirstT first; RestT rest; }; /////////////////////////////////////////////////////////////////////////// // // subrule_parser class // /////////////////////////////////////////////////////////////////////////// template
struct subrule_parser : public parser
> { typedef subrule_parser
self_t; typedef subrule
subrule_t; typedef DefT def_t; BOOST_STATIC_CONSTANT(int, id = ID); template
struct result { typedef typename impl::get_subrule_parser_result< DefT, ScannerT, typename subrule_t::attr_t>::type type; }; subrule_parser(subrule_t const& start_, DefT const& rhs_) : rhs(rhs_), start(start_) {} template
typename parser_result
::type parse(ScannerT const& scan) const { // This will only be called when parsing single subrules. typedef subrule_list
list_t; typedef subrules_scanner
scanner_t; list_t list(*this, nil_t()); scanner_t g_arg(scan, list); return start.parse(g_arg); } template
inline subrule_list< self_t, subrule_list< subrule_parser
, nil_t> > operator,(subrule_parser
const& rhs) const { return subrule_list< self_t, subrule_list< subrule_parser
, nil_t> >( *this, subrule_list< subrule_parser
, nil_t>( rhs, nil_t())); } typename DefT::embed_t rhs; subrule_t const& start; }; /////////////////////////////////////////////////////////////////////////// // // subrule class // /////////////////////////////////////////////////////////////////////////// template
struct subrule : public parser
> , public ContextT::base_t , public context_aux
> { typedef subrule
self_t; typedef subrule
const& embed_t; typedef typename ContextT::context_linker_t context_t; typedef typename context_t::attr_t attr_t; BOOST_STATIC_CONSTANT(int, id = ID); template
struct result { typedef typename impl::get_subrule_result
::type type; }; template
typename parser_result
::type parse_main(ScannerT const& scan) const { typedef typename parser_result
::type result_t; result_t result; impl::parse_subrule
:: do_(result, scan); return result; } template
typename parser_result
::type parse(ScannerT const& scan) const { typedef typename parser_result
::type result_t; typedef parser_scanner_linker
scanner_t; BOOST_SPIRIT_CONTEXT_PARSE( scan, *this, scanner_t, context_t, result_t); } template
subrule_parser
operator=(parser
const& rhs) const { return subrule_parser
(*this, rhs.derived()); } private: // assignment of subrules is not allowed. Use subrules // with identical IDs if you want to have aliases. subrule& operator=(subrule const&); template
subrule& operator=(subrule
const&); }; }} // namespace boost::spirit #endif
subrule.hpp
Page URL
File URL
Prev
5/6
Next
Download
( 10 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.