-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathpr_parser_impl.hpp
More file actions
46 lines (33 loc) · 1.29 KB
/
pr_parser_impl.hpp
File metadata and controls
46 lines (33 loc) · 1.29 KB
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
#pragma once
#include "parser/api/pr_parser.hpp"
#include <stdfwd/optional>
#include <stdfwd/size_t>
#include <stdfwd/string_view>
//------------------------------------------------------------------------------
namespace parser
{
class ParserContext;
//------------------------------------------------------------------------------
class ParserImpl final : public Parser
{
public:
IncludeFiles parseFile( const fs::File & _file ) const override;
private:
using IncludeFileOpt = std::optional< IncludeFile >;
static IncludeFileOpt parseLine( ParserContext & _context );
static IncludeFileOpt
parseInclude( const ParserContext & _context, std::size_t _index );
static std::size_t getStartPos( ParserContext & _context ) noexcept;
static std::size_t getStartPosInInclude(
const ParserContext & _conext, std::size_t _index, char _char );
static std::size_t
findComentEnd( ParserContext & _context, std::size_t _index ) noexcept;
static std::size_t
findEndOfString( ParserContext & _context, std::size_t _index ) noexcept;
static std::size_t
findEndOfRawString( ParserContext & _context, std::size_t _index ) noexcept;
static std::optional< std::size_t >
findInclude( std::string_view _line, std::size_t _index );
};
//------------------------------------------------------------------------------
}