Skip to content

Commit

Permalink
1. [STYLE]::package name arrange.
Browse files Browse the repository at this point in the history
  • Loading branch information
whtoo committed Oct 14, 2023
1 parent a2ad4e2 commit 5e911eb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
6 changes: 3 additions & 3 deletions ep20/src/main/java/org/teachfx/antlr4/ep20/Compiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.teachfx.antlr4.ep20.parser.CymbolLexer;
import org.teachfx.antlr4.ep20.parser.CymbolParser;
import org.teachfx.antlr4.ep20.pass.ast.CymbolASTBuilder;
import org.teachfx.antlr4.ep20.pass.cfg.DataFlowAnalysis;
import org.teachfx.antlr4.ep20.pass.cfg.ControlFlowAnalysis;
import org.teachfx.antlr4.ep20.pass.codegen.CymbolAssembler;
import org.teachfx.antlr4.ep20.pass.ir.CymbolIRBuilder;
import org.teachfx.antlr4.ep20.pass.symtab.LocalDefine;
Expand Down Expand Up @@ -38,7 +38,7 @@ public static void main(String[] args) throws IOException {

astRoot.accept(irBuilder);

var dataFlowAnalysis = new DataFlowAnalysis();
var dataFlowAnalysis = new ControlFlowAnalysis();

var assembler = new CymbolAssembler();

Expand All @@ -48,6 +48,6 @@ public static void main(String[] args) throws IOException {
var url = Compiler.class.getClassLoader().getResource("t.vm");
System.out.println(">>>=" + new File(".").getAbsolutePath());

assembler.saveToFile("output/t.vm");
assembler.saveToFile("../ep18/src/main/resources/t.vm");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
import org.teachfx.antlr4.ep20.ir.Prog;
import org.teachfx.antlr4.ep20.ir.def.Func;
import org.teachfx.antlr4.ep20.ir.expr.*;
import org.teachfx.antlr4.ep20.ir.expr.arith.BinExpr;
import org.teachfx.antlr4.ep20.ir.expr.arith.UnaryExpr;
import org.teachfx.antlr4.ep20.ir.expr.values.BoolVal;
import org.teachfx.antlr4.ep20.ir.expr.values.IntVal;
import org.teachfx.antlr4.ep20.ir.expr.values.StringVal;
import org.teachfx.antlr4.ep20.ir.expr.values.Var;
import org.teachfx.antlr4.ep20.ir.stmt.*;
import org.teachfx.antlr4.ep20.symtab.symbol.MethodSymbol;
import org.teachfx.antlr4.ep20.symtab.symbol.VariableSymbol;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
import org.teachfx.antlr4.ep20.ir.Prog;
import org.teachfx.antlr4.ep20.ir.def.Func;
import org.teachfx.antlr4.ep20.ir.expr.*;
import org.teachfx.antlr4.ep20.ir.expr.arith.BinExpr;
import org.teachfx.antlr4.ep20.ir.expr.arith.UnaryExpr;
import org.teachfx.antlr4.ep20.ir.expr.values.BoolVal;
import org.teachfx.antlr4.ep20.ir.expr.values.IntVal;
import org.teachfx.antlr4.ep20.ir.expr.values.StringVal;
import org.teachfx.antlr4.ep20.ir.expr.values.Var;
import org.teachfx.antlr4.ep20.ir.stmt.*;
import org.teachfx.antlr4.ep20.symtab.symbol.MethodSymbol;

Expand All @@ -26,7 +32,6 @@ public class CymbolIRBuilder implements ASTVisitor<Void, Expr> {
private List<Stmt> stmts;
private Stack<Label> breakStack;
private Stack<Label> continueStack;
private Stack<Label> returnBlockStack;

@Override
public Void visit(CompileUnit rootNode) {
Expand Down Expand Up @@ -54,7 +59,6 @@ public Void visit(FuncDeclNode funcDeclNode) {
/**/
breakStack = new Stack<>();
continueStack = new Stack<>();
returnBlockStack = new Stack<>();

currentFunc = new Func(funcDeclNode.getDeclName(), (MethodSymbol) funcDeclNode.getRefSymbol(), stmts);

Expand Down

0 comments on commit 5e911eb

Please sign in to comment.