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, ParsingContext* ctx);
18 static soulng::parser::Match CompileUnit(CmajorLexer& lexer, ParsingContext* ctx);
19 static soulng::parser::Match NamespaceContent(CmajorLexer& lexer, ParsingContext* ctx, sngcm::ast::CompileUnitNode* cu, sngcm::ast::NamespaceNode* ns);
20 static soulng::parser::Match UsingDirectives(CmajorLexer& lexer, ParsingContext* ctx, sngcm::ast::NamespaceNode* ns);
21 static soulng::parser::Match UsingDirective(CmajorLexer& lexer, ParsingContext* ctx, sngcm::ast::NamespaceNode* ns);
22 static soulng::parser::Match UsingAliasDirective(CmajorLexer& lexer);
23 static soulng::parser::Match UsingNamespaceDirective(CmajorLexer& lexer, ParsingContext* ctx);
24 static soulng::parser::Match Definitions(CmajorLexer& lexer, ParsingContext* ctx, sngcm::ast::CompileUnitNode* cu, sngcm::ast::NamespaceNode* ns);
25 static soulng::parser::Match Definition(CmajorLexer& lexer, ParsingContext* ctx, sngcm::ast::CompileUnitNode* cu, sngcm::ast::NamespaceNode* ns);
26 static soulng::parser::Match NamespaceDefinition(CmajorLexer& lexer, ParsingContext* ctx, sngcm::ast::CompileUnitNode* cu, sngcm::ast::NamespaceNode* ns);
27 static soulng::parser::Match TypedefDeclaration(CmajorLexer& lexer, ParsingContext* ctx);
28 static soulng::parser::Match ConceptDefinition(CmajorLexer& lexer, ParsingContext* ctx);
29 static soulng::parser::Match FunctionDefinition(CmajorLexer& lexer, ParsingContext* ctx);
30 static soulng::parser::Match ClassDefinition(CmajorLexer& lexer, ParsingContext* ctx);
31 static soulng::parser::Match InterfaceDefinition(CmajorLexer& lexer, ParsingContext* ctx);
32 static soulng::parser::Match EnumTypeDefinition(CmajorLexer& lexer, ParsingContext* ctx);
33 static soulng::parser::Match ConstantDefinition(CmajorLexer& lexer, ParsingContext* ctx);
34 static soulng::parser::Match DelegateDefinition(CmajorLexer& lexer, ParsingContext* ctx);
35 static soulng::parser::Match ClassDelegateDefinition(CmajorLexer& lexer, ParsingContext* ctx);
36 static soulng::parser::Match GlobalVariableDefinition(CmajorLexer& lexer, ParsingContext* ctx, sngcm::ast::CompileUnitNode* cu);
37 };
38
39 #endif // COMPILEUNIT_HPP