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
/////////////////////////////////////////////////////////////////////////////// /// \file parser.hpp /// Contains the definition of regex_compiler, a factory for building regex objects /// from strings. // // Copyright 2007 Eric Niebler. 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) #ifndef BOOST_XPRESSIVE_DETAIL_DYNAMIC_PARSER_HPP_EAN_10_04_2005 #define BOOST_XPRESSIVE_DETAIL_DYNAMIC_PARSER_HPP_EAN_10_04_2005 // MS compatible compilers support #pragma once #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once # pragma warning(push) # pragma warning(disable : 4127) // conditional expression is constant #endif #include
#include
#include
#include
#include
// The Regular Expression grammar, in pseudo BNF: // // expression = alternates ; // // alternates = sequence, *('|', sequence) ; // // sequence = quant, *(quant) ; // // quant = atom, [*+?] ; // // atom = literal | // '.' | // '\' any | // '(' expression ')' ; // // literal = not a meta-character ; // namespace boost { namespace xpressive { namespace detail { /////////////////////////////////////////////////////////////////////////////// // make_char_xpression // template
inline sequence
make_char_xpression ( Char ch , regex_constants::syntax_option_type flags , Traits const &traits ) { if(0 != (regex_constants::icase_ & flags)) { literal_matcher
matcher(ch, traits); return make_dynamic
(matcher); } else { literal_matcher
matcher(ch, traits); return make_dynamic
(matcher); } } /////////////////////////////////////////////////////////////////////////////// // make_any_xpression // template
inline sequence
make_any_xpression ( regex_constants::syntax_option_type flags , Traits const &traits ) { using namespace regex_constants; typedef typename iterator_value
::type char_type; typedef set_matcher
set_matcher; typedef literal_matcher
literal_matcher; char_type const newline = traits.widen('\n'); set_matcher s; s.set_[0] = newline; s.set_[1] = 0; s.inverse(); switch(((int)not_dot_newline | not_dot_null) & flags) { case not_dot_null: return make_dynamic
(literal_matcher(char_type(0), traits)); case not_dot_newline: return make_dynamic
(literal_matcher(newline, traits)); case (int)not_dot_newline | not_dot_null: return make_dynamic
(s); default: return make_dynamic
(any_matcher()); } } /////////////////////////////////////////////////////////////////////////////// // make_literal_xpression // template
inline sequence
make_literal_xpression ( typename Traits::string_type const &literal , regex_constants::syntax_option_type flags , Traits const &traits ) { BOOST_ASSERT(0 != literal.size()); if(1 == literal.size()) { return make_char_xpression
(literal[0], flags, traits); } if(0 != (regex_constants::icase_ & flags)) { string_matcher
matcher(literal, traits); return make_dynamic
(matcher); } else { string_matcher
matcher(literal, traits); return make_dynamic
(matcher); } } /////////////////////////////////////////////////////////////////////////////// // make_backref_xpression // template
inline sequence
make_backref_xpression ( int mark_nbr , regex_constants::syntax_option_type flags , Traits const &traits ) { if(0 != (regex_constants::icase_ & flags)) { return make_dynamic
( mark_matcher
(mark_nbr, traits) ); } else { return make_dynamic
( mark_matcher
(mark_nbr, traits) ); } } /////////////////////////////////////////////////////////////////////////////// // merge_charset // template
inline void merge_charset ( basic_chset
&basic , compound_charset
const &compound , Traits const &traits ) { if(0 != compound.posix_yes()) { typename Traits::char_class_type mask = compound.posix_yes(); for(int i = 0; i <= UCHAR_MAX; ++i) { if(traits.isctype((Char)i, mask)) { basic.set((Char)i); } } } if(!compound.posix_no().empty()) { for(std::size_t j = 0; j < compound.posix_no().size(); ++j) { typename Traits::char_class_type mask = compound.posix_no()[j]; for(int i = 0; i <= UCHAR_MAX; ++i) { if(!traits.isctype((Char)i, mask)) { basic.set((Char)i); } } } } if(compound.is_inverted()) { basic.inverse(); } } /////////////////////////////////////////////////////////////////////////////// // make_charset_xpression // template
inline sequence
make_charset_xpression ( compound_charset
&chset , Traits const &traits , regex_constants::syntax_option_type flags ) { typedef typename Traits::char_type char_type; bool const icase = (0 != (regex_constants::icase_ & flags)); bool const optimize = is_narrow_char
::value && 0 != (regex_constants::optimize & flags); // don't care about compile speed -- fold eveything into a bitset<256> if(optimize) { typedef basic_chset
charset_type; charset_type charset(chset.base()); if(icase) { charset_matcher
matcher(charset); merge_charset(matcher.charset_, chset, traits); return make_dynamic
(matcher); } else { charset_matcher
matcher(charset); merge_charset(matcher.charset_, chset, traits); return make_dynamic
(matcher); } } // special case to make [[:digit:]] fast else if(chset.base().empty() && chset.posix_no().empty()) { BOOST_ASSERT(0 != chset.posix_yes()); posix_charset_matcher
matcher(chset.posix_yes(), chset.is_inverted()); return make_dynamic
(matcher); } // default, slow else { if(icase) { charset_matcher
matcher(chset); return make_dynamic
(matcher); } else { charset_matcher
matcher(chset); return make_dynamic
(matcher); } } } /////////////////////////////////////////////////////////////////////////////// // make_posix_charset_xpression // template
inline sequence
make_posix_charset_xpression ( typename Traits::char_class_type m , bool no , regex_constants::syntax_option_type //flags , Traits const & //traits ) { posix_charset_matcher
charset(m, no); return make_dynamic
(charset); } /////////////////////////////////////////////////////////////////////////////// // make_assert_begin_line // template
inline sequence
make_assert_begin_line ( regex_constants::syntax_option_type flags , Traits const &traits ) { if(0 != (regex_constants::single_line & flags)) { return detail::make_dynamic
(detail::assert_bos_matcher()); } else { detail::assert_bol_matcher
matcher(traits); return detail::make_dynamic
(matcher); } } /////////////////////////////////////////////////////////////////////////////// // make_assert_end_line // template
inline sequence
make_assert_end_line ( regex_constants::syntax_option_type flags , Traits const &traits ) { if(0 != (regex_constants::single_line & flags)) { return detail::make_dynamic
(detail::assert_eos_matcher()); } else { detail::assert_eol_matcher
matcher(traits); return detail::make_dynamic
(matcher); } } /////////////////////////////////////////////////////////////////////////////// // make_assert_word // template
inline sequence
make_assert_word(Cond, Traits const &traits) { typedef typename iterator_value
::type char_type; return detail::make_dynamic
( detail::assert_word_matcher
(traits) ); } }}} // namespace boost::xpressive::detail #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma warning(pop) #endif #endif
parser.hpp
Page URL
File URL
Prev
4/7
Next
Download
( 9 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.