llvmir some opt
This commit is contained in:
21
frontend/ast/exp/NumberExp.java
Normal file
21
frontend/ast/exp/NumberExp.java
Normal file
@@ -0,0 +1,21 @@
|
||||
package frontend.ast.exp;
|
||||
|
||||
import frontend.ast.Node;
|
||||
import frontend.ast.SyntaxType;
|
||||
import frontend.lexer.TokenStream;
|
||||
import error.Errors;
|
||||
import frontend.ast.token.TokenNode;
|
||||
|
||||
public class NumberExp extends Node {
|
||||
public NumberExp(TokenStream ts) {
|
||||
super(SyntaxType.NUMBER, ts);
|
||||
}
|
||||
|
||||
public void parse(Errors errors) {
|
||||
addChild(new TokenNode(ts)); //intconst
|
||||
}
|
||||
|
||||
public int getValue() {
|
||||
return Integer.parseInt(((TokenNode) getChild(0)).getValue());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user