From eb7fb04d2dfadd004fa86f28da42681e0038df06 Mon Sep 17 00:00:00 2001 From: geno Date: Thu, 27 Jun 2024 18:20:34 +0200 Subject: left, right = 1, 2 assignment covered sfaccimm ho fatto refactoring dell exprlist --- src/ast/nodes/ForStmtNode.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/ast/nodes/ForStmtNode.java') diff --git a/src/ast/nodes/ForStmtNode.java b/src/ast/nodes/ForStmtNode.java index 28fe783..610d0a0 100644 --- a/src/ast/nodes/ForStmtNode.java +++ b/src/ast/nodes/ForStmtNode.java @@ -1,20 +1,20 @@ package ast.nodes; +import ast.types.*; import java.util.ArrayList; - import semanticanalysis.SemanticError; import semanticanalysis.SymbolTable; -import ast.types.*; /** * Node for the `for_stmt` statement of the grammar. */ public class ForStmtNode implements Node { - private Node exprList; + + private ExprListNode exprList; private Node block; public ForStmtNode(Node exprList, Node block) { - this.exprList = exprList; + this.exprList = (ExprListNode) exprList; this.block = block; } @@ -22,9 +22,7 @@ public class ForStmtNode implements Node { public ArrayList checkSemantics(SymbolTable ST, int _nesting) { ArrayList errors = new ArrayList(); - ExprNode expr = (ExprNode) exprList; - - ST.insert(expr.getId(), expr.typeCheck(), _nesting, ""); + // ST.insert(expr.getId(), expr.typeCheck(s), _nesting, ""); errors.addAll(exprList.checkSemantics(ST, _nesting)); errors.addAll(block.checkSemantics(ST, _nesting)); -- cgit v1.2.3-18-g5258