summaryrefslogtreecommitdiff
path: root/src/ast/nodes/RootNode.java
diff options
context:
space:
mode:
authorgeno <gabriele.genovese2@studio.unibo.it>2024-06-25 16:04:07 +0200
committergeno <gabriele.genovese2@studio.unibo.it>2024-06-25 16:04:07 +0200
commitb12c01732860f9727626829e0b25a273de5fe5c7 (patch)
tree50bbf73b7bb191bfcc00ad42a58f67b131d4d125 /src/ast/nodes/RootNode.java
parentda554f4281da45a22f7101f26cfdf274149c7966 (diff)
check semantic of defined and undefined variables implemented
do not check for built-in function works on the example
Diffstat (limited to 'src/ast/nodes/RootNode.java')
-rw-r--r--src/ast/nodes/RootNode.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ast/nodes/RootNode.java b/src/ast/nodes/RootNode.java
index 4b7e579..45d20db 100644
--- a/src/ast/nodes/RootNode.java
+++ b/src/ast/nodes/RootNode.java
@@ -1,15 +1,15 @@
package ast.nodes;
+import ast.types.*;
import java.util.ArrayList;
import java.util.HashMap;
-
import semanticanalysis.*;
-import ast.types.*;
/**
* Node for the `root` statement of the grammar.
*/
public class RootNode implements Node {
+
// stms and compundStmts are protected because they are reused for a
// BlockNode
protected ArrayList<Node> stmts;
@@ -28,11 +28,11 @@ public class RootNode implements Node {
ST.add(HM);
- for (Node stmt : compoundStmts) {
+ for (Node stmt : stmts) {
errors.addAll(stmt.checkSemantics(ST, _nesting));
}
- for (Node stmt : stmts) {
+ for (Node stmt : compoundStmts) {
errors.addAll(stmt.checkSemantics(ST, _nesting));
}