/
DeclarationFileParser.h
38 lines (26 loc) · 1.03 KB
/
DeclarationFileParser.h
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
#pragma once
#include "ideclmanager.h"
#include "DeclarationFile.h"
namespace decl
{
class DeclarationManager;
class DeclarationFileParser
{
private:
Type _defaultDeclType;
std::map<std::string, IDeclarationCreator::Ptr> _creatorsByTypename;
IDeclarationCreator::Ptr _defaultTypeCreator;
std::set<DeclarationFile> _parsedFiles;
std::map<Type, NamedDeclarations> _parsedDecls;
std::vector<DeclarationBlockSyntax> _unrecognisedBlocks;
public:
DeclarationFileParser(Type declType, const std::map<std::string, IDeclarationCreator::Ptr>& creatorsByTypename);
void parse(std::istream& stream, const vfs::FileInfo& fileInfo, const std::string& modDir);
std::map<Type, NamedDeclarations>& getParsedDecls();
const std::set<DeclarationFile>& getParsedFiles() const;
const std::vector<DeclarationBlockSyntax>& getUnrecognisedBlocks() const;
private:
void processBlock(IDeclarationCreator& creator, const DeclarationBlockSyntax& block);
IDeclarationCreator::Ptr getCreatorByType(Type declType) const;
};
}