1 #ifndef COMPILEUNIT_HPP
2 #define COMPILEUNIT_HPP
3 #include <sngcm/cmparser/ParserApi.hpp>
4 #include <sngcm/ast/CompileUnit.hpp>
5 #include <sngcm/cmparser/ParsingContext.hpp>
6 #include <memory>
7 #include <soulng/lexer/Token.hpp>
8 #include <soulng/parser/Match.hpp>
9 #include <soulng/parser/Value.hpp>
10
11
12
13 class CmajorLexer;
14
15 struct CompileUnitParser
16 {
17 static std::unique_ptr<sngcm::ast::CompileUnitNode> Parse(CmajorLexer& lexer, boost::uuids::uuid* moduleId, ParsingContext* ctx);
18 static soulng::parser::Match CompileUnit(CmajorLexer& lexer, boost::uuids::uuid* moduleId, ParsingContext* ctx);
19 static soulng::parser::Match NamespaceContent(CmajorLexer& lexer, boost::uuids::uuid* moduleId, ParsingContext* ctx, sngcm::ast::CompileUnitNode* cu, sngcm::ast::NamespaceNode* ns);
20 static soulng::parser::Match UsingDirectives(CmajorLexer& lexer, boost::uuids::uuid* moduleId, ParsingContext* ctx, sngcm::ast::NamespaceNode* ns);
21 static soulng::parser::Match UsingDirective(CmajorLexer& lexer, boost::uuids::uuid* moduleId, ParsingContext* ctx, sngcm::ast::NamespaceNode* ns);
22 static soulng::parser::Match UsingAliasDirective(CmajorLexer& lexer, boost::uuids::uuid* moduleId);
23 static soulng::parser::Match UsingNamespaceDirective(CmajorLexer& lexer, boost::uuids::uuid* moduleId, ParsingContext* ctx);
24 static soulng::parser::Match Definitions(CmajorLexer& lexer, boost::uuids::uuid* moduleId, ParsingContext* ctx, sngcm::ast::CompileUnitNode* cu, sngcm::ast::NamespaceNode* ns);
25 static soulng::parser::Match Definition(CmajorLexer& lexer, boost::uuids::uuid* moduleId, ParsingContext* ctx, sngcm::ast::CompileUnitNode* cu, sngcm::ast::NamespaceNode* ns);
26 static soulng::parser::Match NamespaceDefinition(CmajorLexer& lexer, boost::uuids::uuid* moduleId, ParsingContext* ctx, sngcm::ast::CompileUnitNode* cu, sngcm::ast::NamespaceNode* ns);
27 static soulng::parser::Match TypedefDeclaration(CmajorLexer& lexer, boost::uuids::uuid* moduleId, ParsingContext* ctx);
28 static soulng::parser::Match ConceptDefinition(CmajorLexer& lexer, boost::uuids::uuid* moduleId, ParsingContext* ctx);
29 static soulng::parser::Match FunctionDefinition(CmajorLexer& lexer, boost::uuids::uuid* moduleId, ParsingContext* ctx);
30 static soulng::parser::Match ClassDefinition(CmajorLexer& lexer, boost::uuids::uuid* moduleId, ParsingContext* ctx);
31 static soulng::parser::Match InterfaceDefinition(CmajorLexer& lexer, boost::uuids::uuid* moduleId, ParsingContext* ctx);
32 static soulng::parser::Match EnumTypeDefinition(CmajorLexer& lexer, boost::uuids::uuid* moduleId, ParsingContext* ctx);
33 static soulng::parser::Match ConstantDefinition(CmajorLexer& lexer, boost::uuids::uuid* moduleId, ParsingContext* ctx);
34 static soulng::parser::Match DelegateDefinition(CmajorLexer& lexer, boost::uuids::uuid* moduleId, ParsingContext* ctx);
35 static soulng::parser::Match ClassDelegateDefinition(CmajorLexer& lexer, boost::uuids::uuid* moduleId, ParsingContext* ctx);
36 static soulng::parser::Match GlobalVariableDefinition(CmajorLexer& lexer, boost::uuids::uuid* moduleId, ParsingContext* ctx, sngcm::ast::CompileUnitNode* cu);
37 static soulng::parser::Match InstantiationRequestDeclaration(CmajorLexer& lexer, boost::uuids::uuid* moduleId, ParsingContext* ctx);
38 };
39
40 #endif // COMPILEUNIT_HPP