-
Notifications
You must be signed in to change notification settings - Fork 2
/
URIReferenceGrammar.hpp
50 lines (44 loc) · 1.9 KB
/
URIReferenceGrammar.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/**
* This file is part of WebP2P.
*
* WebP2P is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* WebP2P is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with WebP2P. If not, see <http://www.gnu.org/licenses/>.
*
* Filename: URIReferenceGrammar.cpp
* Author(s): Dries Staelens
* Copyright: Copyright (c) 2010 Dries Staelens
* Description: Definition for the RFC 3986 uri-reference grammar rules.
* See also: http://tools.ietf.org/html/rfc3986#section-4.1
**/
#pragma once
/* WebP2P includes */
#include "ABNFCoreGrammar.hpp"
struct URIReferenceGrammar :
boost::spirit::qi::grammar<std::string::const_iterator, std::string()> {
/* external grammars */
ABNFCoreGrammar abnf;
/* rules for this grammar */
boost::spirit::qi::rule<std::string::const_iterator, std::string()>
uri, hier_part, absolute_uri, relative_ref, relative_part, scheme,
authority, userinfo, host, port, ip_literal, ipvfuture, ipv6address, i1,
i2, i3, i4, i5, i6, i7, i8, i9, r1, r2, r3, r4, r5, r6, h16, ls32,
ipv4address, dec_octet, reg_name, path, path_abempty, path_absolute,
path_noscheme, path_rootless, path_empty, segment, segment_nz,
segment_nz_nc, pchar, query, fragment, pct_encoded, unreserved,
reserved, gen_delims, sub_delims;
/* start symbol for this grammar */
boost::spirit::qi::rule<std::string::const_iterator, std::string()>
uri_reference;
/* Grammar constructor */
URIReferenceGrammar();
};