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
/*============================================================================= Boost.Wave: A Standard compliant C++ preprocessor library Definition of the lexer iterator http://www.boost.org/ Copyright (c) 2001-2008 Hartmut Kaiser. Distributed under 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(CPP_LEX_ITERATOR_HPP_AF0C37E3_CBD8_4F33_A225_51CF576FA61F_INCLUDED) #define CPP_LEX_ITERATOR_HPP_AF0C37E3_CBD8_4F33_A225_51CF576FA61F_INCLUDED #include
#include
#include
#include
#include
#include
#include
#include
#include
#include
// this must occur after all of the includes and before any code appears #ifdef BOOST_HAS_ABI_HEADERS #include BOOST_ABI_PREFIX #endif #if 0 != __COMO_VERSION__ #define BOOST_WAVE_EOF_PREFIX static #else #define BOOST_WAVE_EOF_PREFIX #endif /////////////////////////////////////////////////////////////////////////////// namespace boost { namespace wave { namespace cpplexer { namespace impl { /////////////////////////////////////////////////////////////////////////////// // // lex_iterator_functor_shim // /////////////////////////////////////////////////////////////////////////////// template
class lex_iterator_functor_shim { typedef typename TokenT::position_type position_type; public: template
lex_iterator_functor_shim(IteratorT const &first, IteratorT const &last, position_type const &pos, boost::wave::language_support language) : functor_ptr(lex_input_interface_generator
::new_lexer(first, last, pos, language)) #if 0 != __DECCXX_VER || BOOST_INTEL_CXX_VERSION > 900 || defined(__PGI) , eof() #endif // 0 != __DECCXX_VER {} // interface to the boost::spirit::multi_pass_policies::functor_input policy typedef TokenT result_type; BOOST_WAVE_EOF_PREFIX result_type const eof; result_type operator()() { BOOST_ASSERT(0 != functor_ptr.get()); return functor_ptr->get(); } void set_position(position_type const &pos) { BOOST_ASSERT(0 != functor_ptr.get()); functor_ptr->set_position(pos); } #if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 bool has_include_guards(std::string& guard_name) const { return functor_ptr->has_include_guards(guard_name); } #endif private: boost::shared_ptr
> functor_ptr; }; /////////////////////////////////////////////////////////////////////////////// // eof token #if 0 != __COMO_VERSION__ template
typename lex_iterator_functor_shim
::result_type const lex_iterator_functor_shim
::eof; #endif // 0 != __COMO_VERSION__ /////////////////////////////////////////////////////////////////////////////// } // namespace impl /////////////////////////////////////////////////////////////////////////////// // // lex_iterator // // A generic C++ lexer interface class, which allows to plug in different // lexer implementations. The interface between the lexer type used and // the preprocessor component depends on the token type only (template // parameter TokenT). // Additionally, the following requirements apply: // // - the lexer type should have a function implemented, which returnes // the next lexed token from the input stream: // typename TokenT get(); // - at the end of the input stream this function should return the // eof token equivalent // - the lexer should implement a constructor taking two iterators // pointing to the beginning and the end of the input stream, // a third parameter containing the name of the parsed input file // and a 4th parameter of the type boost::wave::language_support // which specifies, which language subset should be supported (C++, // C99, C++0x etc.). // /////////////////////////////////////////////////////////////////////////////// template
class lex_iterator : public boost::spirit::multi_pass< impl::lex_iterator_functor_shim
, boost::wave::util::functor_input > { typedef impl::lex_iterator_functor_shim
input_policy_type; typedef boost::spirit::multi_pass
base_type; public: typedef TokenT token_type; lex_iterator() {} template
lex_iterator(IteratorT const &first, IteratorT const &last, typename TokenT::position_type const &pos, boost::wave::language_support language) : base_type(input_policy_type(first, last, pos, language)) {} void set_position(typename TokenT::position_type const &pos) { typedef typename TokenT::position_type position_type; // set the new position in the current token token_type& currtoken = base_type::get_input(); position_type currpos = currtoken.get_position(); currpos.set_file(pos.get_file()); currpos.set_line(pos.get_line()); currtoken.set_position(currpos); // set the new position for future tokens as well if (token_type::string_type::npos != currtoken.get_value().find_first_of('\n')) { currpos.set_line(pos.get_line() + 1); } base_type::get_functor().set_position(currpos); } #if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 // return, whether the current file has include guards // this function returns meaningful results only if the file was scanned // completely bool has_include_guards(std::string& guard_name) const { return base_type::get_functor().has_include_guards(guard_name); } #endif }; /////////////////////////////////////////////////////////////////////////////// } // namespace cpplexer } // namespace wave } // namespace boost // the suffix header occurs after all of the code #ifdef BOOST_HAS_ABI_HEADERS #include BOOST_ABI_SUFFIX #endif #undef BOOST_WAVE_EOF_PREFIX #endif // !defined(CPP_LEX_ITERATOR_HPP_AF0C37E3_CBD8_4F33_A225_51CF576FA61F_INCLUDED)
cpp_lex_iterator.hpp
Page URL
File URL
Prev
4/9
Next
Download
( 6 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.