1 #ifndef STATEMENT_HPP
2 #define STATEMENT_HPP
3 #include <sngcm/cmparser/ParserApi.hpp>
4 #include <sngcm/ast/Statement.hpp>
5 #include <sngcm/cmparser/ParsingContext.hpp>
6 #include <soulng/lexer/Token.hpp>
7 #include <soulng/parser/Match.hpp>
8 #include <soulng/parser/Value.hpp>
9
10
11
12 class CmajorLexer;
13
14 struct StatementParser
15 {
16 static soulng::parser::Match Statement(CmajorLexer& lexer, ParsingContext* ctx);
17 static soulng::parser::Match Label(CmajorLexer& lexer);
18 static soulng::parser::Match LabeledStatement(CmajorLexer& lexer, ParsingContext* ctx);
19 static soulng::parser::Match ControlStatement(CmajorLexer& lexer, ParsingContext* ctx);
20 static soulng::parser::Match CompoundStatement(CmajorLexer& lexer, ParsingContext* ctx);
21 static soulng::parser::Match ReturnStatement(CmajorLexer& lexer, ParsingContext* ctx);
22 static soulng::parser::Match IfStatement(CmajorLexer& lexer, ParsingContext* ctx);
23 static soulng::parser::Match WhileStatement(CmajorLexer& lexer, ParsingContext* ctx);
24 static soulng::parser::Match DoStatement(CmajorLexer& lexer, ParsingContext* ctx);
25 static soulng::parser::Match ForStatement(CmajorLexer& lexer, ParsingContext* ctx);
26 static soulng::parser::Match ForInitStatement(CmajorLexer& lexer, ParsingContext* ctx);
27 static soulng::parser::Match ForLoopStatementExpr(CmajorLexer& lexer, ParsingContext* ctx);
28 static soulng::parser::Match RangeForStatement(CmajorLexer& lexer, ParsingContext* ctx);
29 static soulng::parser::Match BreakStatement(CmajorLexer& lexer, ParsingContext* ctx);
30 static soulng::parser::Match ContinueStatement(CmajorLexer& lexer, ParsingContext* ctx);
31 static soulng::parser::Match GotoStatement(CmajorLexer& lexer, ParsingContext* ctx);
32 static soulng::parser::Match SwitchStatement(CmajorLexer& lexer, ParsingContext* ctx);
33 static soulng::parser::Match CaseStatement(CmajorLexer& lexer, ParsingContext* ctx);
34 static soulng::parser::Match DefaultStatement(CmajorLexer& lexer, ParsingContext* ctx);
35 static soulng::parser::Match GotoCaseStatement(CmajorLexer& lexer, ParsingContext* ctx);
36 static soulng::parser::Match GotoDefaultStatement(CmajorLexer& lexer, ParsingContext* ctx);
37 static soulng::parser::Match AssignmentStatementExpr(CmajorLexer& lexer, ParsingContext* ctx);
38 static soulng::parser::Match AssignmentStatement(CmajorLexer& lexer, ParsingContext* ctx);
39 static soulng::parser::Match ConstructionStatement(CmajorLexer& lexer, ParsingContext* ctx);
40 static soulng::parser::Match DeleteStatement(CmajorLexer& lexer, ParsingContext* ctx);
41 static soulng::parser::Match DestroyStatement(CmajorLexer& lexer, ParsingContext* ctx);
42 static soulng::parser::Match ExpressionStatement(CmajorLexer& lexer, ParsingContext* ctx);
43 static soulng::parser::Match EmptyStatement(CmajorLexer& lexer, ParsingContext* ctx);
44 static soulng::parser::Match ThrowStatement(CmajorLexer& lexer, ParsingContext* ctx);
45 static soulng::parser::Match TryStatement(CmajorLexer& lexer, ParsingContext* ctx);
46 static soulng::parser::Match Catch(CmajorLexer& lexer, ParsingContext* ctx);
47 static soulng::parser::Match AssertStatement(CmajorLexer& lexer, ParsingContext* ctx);
48 static soulng::parser::Match ConditionalCompilationStatement(CmajorLexer& lexer, ParsingContext* ctx);
49 static soulng::parser::Match ConditionalCompilationExpression(CmajorLexer& lexer);
50 static soulng::parser::Match ConditionalCompilationDisjunction(CmajorLexer& lexer);
51 static soulng::parser::Match ConditionalCompilationConjunction(CmajorLexer& lexer);
52 static soulng::parser::Match ConditionalCompilationPrefix(CmajorLexer& lexer);
53 static soulng::parser::Match ConditionalCompilationPrimary(CmajorLexer& lexer);
54 };
55
56 #endif // STATEMENT_HPP