Skip to content

Commit 10b389a

Browse files
author
ApsarasX
committed
chore: add ROADMAP-zh_CN.md
1 parent ed5c430 commit 10b389a

2 files changed

Lines changed: 28 additions & 8 deletions

File tree

ROADMAP-zh_CN.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
- [x] 词法&语法分析
2+
- [ ] 语义分析
3+
- [ ] 建立符号表
4+
- [ ] 属性分析
5+
- [ ] 引用消解
6+
- [ ] 变量消解
7+
- [ ] 函数消解
8+
- [ ] 类型检查
9+
- [ ] 变量/常量类型推导
10+
- [ ] 变量/常量赋值类型检查
11+
- [ ] 函数传参类型检查
12+
- [ ] 常数折叠
13+
- [ ] 数据流分析
14+
- [ ] 活跃性分析
15+
- [ ] 检查return语句
16+
- [ ] 检查continue语句和break语句
17+
- [ ] 赋值分析
18+
- [ ] 检查变量被使用前是否已经赋值
19+
- [ ] 检查常量是否被二次赋值
20+
- [ ] LLVM IR生成

lib/AST/ASTVisitor.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ antlrcpp::Any ASTVisitor::visitStatements(StaticScriptParser::StatementsContext
1111
SharedPtrVector<Stmt> stmts;
1212
if (ctx) {
1313
for (auto &stmtCtx: ctx->statement()) {
14-
SharedPtr<Stmt> stmt= visitStatement(stmtCtx);
14+
SharedPtr<Stmt> stmt = visitStatement(stmtCtx);
1515
stmts.push_back(stmt);
1616
}
1717
}
@@ -22,38 +22,38 @@ antlrcpp::Any ASTVisitor::visitStatement(StaticScriptParser::StatementContext *c
2222
antlrcpp::Any stmtAny;
2323
SharedPtr<Stmt> stmt;
2424
if (ctx->emptyStatement()) {
25-
stmtAny = visitEmptyStatement(ctx->emptyStatement());
25+
stmtAny = visitEmptyStatement(ctx->emptyStatement());
2626
} else if (ctx->declarationStatement()) {
27-
stmtAny = visitDeclarationStatement(ctx->declarationStatement());
27+
stmtAny = visitDeclarationStatement(ctx->declarationStatement());
2828
if (stmtAny.is<SharedPtr<VarDeclStmt>>()) {
2929
stmt = stmtAny.as<SharedPtr<VarDeclStmt>>();
3030
} else if (stmtAny.is<SharedPtr<FunctionDeclStmt>>()) {
3131
stmt = stmtAny.as<SharedPtr<FunctionDeclStmt>>();
3232
}
3333
} else if (ctx->compoundStatement()) {
34-
stmtAny = visitCompoundStatement(ctx->compoundStatement());
34+
stmtAny = visitCompoundStatement(ctx->compoundStatement());
3535
if (stmtAny.is<SharedPtr<CompoundStmt>>()) {
3636
stmt = stmtAny.as<SharedPtr<CompoundStmt>>();
3737
}
3838
} else if (ctx->expressionStatement()) {
39-
stmtAny = visitExpressionStatement(ctx->expressionStatement());
39+
stmtAny = visitExpressionStatement(ctx->expressionStatement());
4040
if (stmtAny.is<SharedPtr<Expr>>()) {
4141
stmt = stmtAny.as<SharedPtr<Expr>>();
4242
}
4343
} else if (ctx->selectionStatement()) {
44-
stmtAny = visitSelectionStatement(ctx->selectionStatement());
44+
stmtAny = visitSelectionStatement(ctx->selectionStatement());
4545
if (stmtAny.is<SharedPtr<IfStmt>>()) {
4646
stmt = stmtAny.as<SharedPtr<IfStmt>>();
4747
}
4848
} else if (ctx->iterationStatement()) {
49-
stmtAny = visitIterationStatement(ctx->iterationStatement());
49+
stmtAny = visitIterationStatement(ctx->iterationStatement());
5050
if (stmtAny.is<SharedPtr<WhileStmt>>()) {
5151
stmt = stmtAny.as<SharedPtr<WhileStmt>>();
5252
} else if (stmtAny.is<SharedPtr<ForStmt>>()) {
5353
stmt = stmtAny.as<SharedPtr<ForStmt>>();
5454
}
5555
} else if (ctx->jumpStatement()) {
56-
stmtAny = visitJumpStatement(ctx->jumpStatement());
56+
stmtAny = visitJumpStatement(ctx->jumpStatement());
5757
if (stmtAny.is<SharedPtr<ContinueStmt>>()) {
5858
stmt = stmtAny.as<SharedPtr<ContinueStmt>>();
5959
} else if (stmtAny.is<SharedPtr<BreakStmt>>()) {

0 commit comments

Comments
 (0)