diff options
Diffstat (limited to 'src/ast/nodes/BlockNode.java')
-rw-r--r-- | src/ast/nodes/BlockNode.java | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/ast/nodes/BlockNode.java b/src/ast/nodes/BlockNode.java index 732e89b..2ea0a47 100644 --- a/src/ast/nodes/BlockNode.java +++ b/src/ast/nodes/BlockNode.java @@ -15,12 +15,12 @@ public class BlockNode extends RootNode { } @Override - public ArrayList<SemanticError> checkSemantics(SymbolTable ST, int _nesting) { + public ArrayList<SemanticError> checkSemantics(SymbolTable ST, int _nesting, FunctionType ft) { ArrayList<SemanticError> errors = new ArrayList<>(); // Check semantics for each child for (Node child : childs) { - errors.addAll(child.checkSemantics(ST, _nesting)); + errors.addAll(child.checkSemantics(ST, _nesting, ft)); } return errors; @@ -32,6 +32,17 @@ public class BlockNode extends RootNode { } @Override + public String codeGeneration() { + String str = ""; + + for (Node child : childs) { + str += child.codeGeneration(); + } + + return str; + } + + @Override public String toPrint(String prefix) { String str = prefix + "Block\n"; |