summaryrefslogtreecommitdiff
path: root/src/ast/nodes/ForStmtNode.java
diff options
context:
space:
mode:
authorL0P0P <grassoemanuele@live.com>2024-06-27 12:02:35 +0200
committerL0P0P <grassoemanuele@live.com>2024-06-27 12:02:35 +0200
commit3c4229fc9e0ec6da9a7f60b57b9e93c49d1b6b6c (patch)
treeaca198eca62a0260a50ea59003c44a942e98f521 /src/ast/nodes/ForStmtNode.java
parentfb89b8c0885ee4e289cfb577bbabf0ee66b05024 (diff)
Fixed a lot of problems from all the progs we need to parse
Diffstat (limited to 'src/ast/nodes/ForStmtNode.java')
-rw-r--r--src/ast/nodes/ForStmtNode.java4
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));