llvmir some opt
This commit is contained in:
27
frontend/ast/exp/Exp.java
Normal file
27
frontend/ast/exp/Exp.java
Normal 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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user