llvmir some opt

This commit is contained in:
邓智航
2025-12-10 17:58:17 +08:00
commit 84827838e2
103 changed files with 5838 additions and 0 deletions

27
frontend/ast/exp/Exp.java Normal file
View File

@@ -0,0 +1,27 @@
package frontend.ast.exp;
import frontend.ast.Node;
import frontend.ast.SyntaxType;
import frontend.lexer.TokenStream;
import midend.symbol.SymbolManager;
import error.Errors;
public class Exp extends Node {
public Exp(TokenStream ts) {
super(SyntaxType.EXP, ts);
}
public void parse(Errors errors) {
AddExp addexp = new AddExp(this.ts);
addexp.parse(errors);
addChild(addexp);
}
public int getType() {
return ((AddExp) getChild(0)).getType();
}
public int getValue() {
return ((AddExp) getChild(0)).getValue();
}
}