-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSyntaxCheckPass.h
58 lines (53 loc) · 2.77 KB
/
SyntaxCheckPass.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#pragma once
#include <cstdint>
#include "AstPass.h"
namespace lwscript
{
class LWSCRIPT_API SyntaxCheckPass : public AstPass
{
public:
SyntaxCheckPass() noexcept;
virtual ~SyntaxCheckPass() noexcept override = default;
protected:
virtual Stmt *ExecuteAstStmts(AstStmts *stmt) override;
virtual Stmt *ExecuteVarStmt(VarStmt *stmt) override;
virtual Stmt *ExecuteExprStmt(ExprStmt *stmt) override;
virtual Stmt *ExecuteReturnStmt(ReturnStmt *stmt) override;
virtual Stmt *ExecuteIfStmt(IfStmt *stmt) override;
virtual Stmt *ExecuteScopeStmt(ScopeStmt *stmt) override;
virtual Stmt *ExecuteWhileStmt(WhileStmt *stmt) override;
virtual Stmt *ExecuteEnumStmt(EnumStmt *stmt) override;
virtual Stmt *ExecuteFunctionStmt(FunctionStmt *stmt) override;
virtual Stmt *ExecuteClassStmt(ClassStmt *stmt) override;
virtual Stmt *ExecuteBreakStmt(BreakStmt *stmt) override;
virtual Stmt *ExecuteContinueStmt(ContinueStmt *stmt) override;
virtual Stmt *ExecuteModuleStmt(ModuleStmt *stmt) override;
virtual Expr *ExecuteLiteralExpr(LiteralExpr *expr) override;
virtual Expr *ExecuteInfixExpr(InfixExpr *expr) override;
virtual Expr *ExecutePrefixExpr(PrefixExpr *expr) override;
virtual Expr *ExecutePostfixExpr(PostfixExpr *expr) override;
virtual Expr *ExecuteConditionExpr(ConditionExpr *expr) override;
virtual Expr *ExecuteGroupExpr(GroupExpr *expr) override;
virtual Expr *ExecuteArrayExpr(ArrayExpr *expr) override;
virtual Expr *ExecuteAppregateExpr(AppregateExpr *expr) override;
virtual Expr *ExecuteDictExpr(DictExpr *expr) override;
virtual Expr *ExecuteIndexExpr(IndexExpr *expr) override;
virtual Expr *ExecuteNewExpr(NewExpr *expr) override;
virtual Expr *ExecuteThisExpr(ThisExpr *expr) override;
virtual Expr *ExecuteBaseExpr(BaseExpr *expr) override;
virtual Expr *ExecuteIdentifierExpr(IdentifierExpr *expr) override;
virtual Expr *ExecuteLambdaExpr(LambdaExpr *expr) override;
virtual Expr *ExecuteCompoundExpr(CompoundExpr *expr) override;
virtual Expr *ExecuteCallExpr(CallExpr *expr) override;
virtual Expr *ExecuteDotExpr(DotExpr *expr) override;
virtual Expr *ExecuteRefExpr(RefExpr *expr) override;
virtual Expr *ExecuteStructExpr(StructExpr *expr) override;
virtual Expr *ExecuteVarArgExpr(VarArgExpr *expr) override;
virtual Expr *ExecuteFactorialExpr(FactorialExpr *expr) override;
virtual Expr *ExecuteVarDescExpr(VarDescExpr *expr) override;
bool IsConstantLiteral(Expr *expr);
uint32_t mLoopDepth;
uint32_t mVarArgScopeDepth;
uint32_t mClassScopeDepth;
};
}