diff options
Diffstat (limited to 'src/ast/nodes/ForStmtNode.java')
-rw-r--r-- | src/ast/nodes/ForStmtNode.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ast/nodes/ForStmtNode.java b/src/ast/nodes/ForStmtNode.java index 6d94bb2..28fe783 100644 --- a/src/ast/nodes/ForStmtNode.java +++ b/src/ast/nodes/ForStmtNode.java @@ -22,6 +22,10 @@ public class ForStmtNode implements Node { public ArrayList<SemanticError> checkSemantics(SymbolTable ST, int _nesting) { ArrayList<SemanticError> errors = new ArrayList<SemanticError>(); + ExprNode expr = (ExprNode) exprList; + + ST.insert(expr.getId(), expr.typeCheck(), _nesting, ""); + errors.addAll(exprList.checkSemantics(ST, _nesting)); errors.addAll(block.checkSemantics(ST, _nesting)); |