summaryrefslogtreecommitdiff
path: root/src/ast/nodes/BlockNode.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/ast/nodes/BlockNode.java')
-rw-r--r--src/ast/nodes/BlockNode.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/ast/nodes/BlockNode.java b/src/ast/nodes/BlockNode.java
index 2c85025..a38b4ea 100644
--- a/src/ast/nodes/BlockNode.java
+++ b/src/ast/nodes/BlockNode.java
@@ -3,6 +3,8 @@ package ast.nodes;
import java.util.ArrayList;
import ast.types.*;
+import semanticanalysis.SemanticError;
+import semanticanalysis.SymbolTable;
/**
* Node for `block` statement of the grammar.
@@ -14,6 +16,19 @@ public class BlockNode extends RootNode {
}
@Override
+ public ArrayList<SemanticError> checkSemantics(SymbolTable ST, int _nesting) {
+ ArrayList<SemanticError> errors = new ArrayList<SemanticError>();
+
+ // Check semantics for each child
+ for (Node child : childs) {
+ errors.addAll(child.checkSemantics(ST, _nesting));
+ }
+
+ return errors;
+ }
+
+
+ @Override
public Type typeCheck() {
return new VoidType();
}