llvmir some opt
This commit is contained in:
28
frontend/ast/block/BlockItem.java
Normal file
28
frontend/ast/block/BlockItem.java
Normal file
@@ -0,0 +1,28 @@
|
||||
package frontend.ast.block;
|
||||
|
||||
import error.Errors;
|
||||
import frontend.ast.Node;
|
||||
import frontend.ast.SyntaxType;
|
||||
import frontend.lexer.TokenStream;
|
||||
import frontend.lexer.TokenType;
|
||||
import frontend.ast.decl.Decl;
|
||||
|
||||
public class BlockItem extends Node {
|
||||
public BlockItem(TokenStream ts) {
|
||||
super(SyntaxType.BLOCK_ITEM, ts);
|
||||
}
|
||||
|
||||
public void parse(Errors errors) {
|
||||
if (getCurrToken().getType() == TokenType.CONSTTK
|
||||
|| getCurrToken().getType() == TokenType.STATICTK
|
||||
|| getCurrToken().getType() == TokenType.INTTK) {
|
||||
Decl decl = new Decl(this.ts);
|
||||
decl.parse(errors);
|
||||
addChild(decl);
|
||||
} else {
|
||||
Stmt stmt = new Stmt(this.ts);
|
||||
stmt.parse(errors);
|
||||
addChild(stmt);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user