summaryrefslogtreecommitdiff
path: root/src/ast/nodes/SimpleStmtNode.java
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2024-06-30 13:45:57 +0200
committerGitHub <noreply@github.com>2024-06-30 13:45:57 +0200
commit8aa8b5834953cab15c0687608f4fafea2e6c61be (patch)
tree1835ae7c789136b4a6c44c12efd4247a0b96d893 /src/ast/nodes/SimpleStmtNode.java
parent7125bb27fedaafd5a56b5122e4251b182448ddac (diff)
parent06d7c8dee25c065b1a569337f34d3cd5e892a31d (diff)
Merge pull request #10 from boozec/check-semantics
Co-Authored-By: geno <gabriele.genovese2@studio.unibo.it> Co-Authored-By: L0P0P <grassoemanuele@live.com>
Diffstat (limited to 'src/ast/nodes/SimpleStmtNode.java')
-rw-r--r--src/ast/nodes/SimpleStmtNode.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/ast/nodes/SimpleStmtNode.java b/src/ast/nodes/SimpleStmtNode.java
index 5f844cb..b2bc880 100644
--- a/src/ast/nodes/SimpleStmtNode.java
+++ b/src/ast/nodes/SimpleStmtNode.java
@@ -1,19 +1,19 @@
package ast.nodes;
+import ast.types.*;
import java.util.ArrayList;
-
import semanticanalysis.SemanticError;
import semanticanalysis.SymbolTable;
-import ast.types.*;
/**
* Node for the `simple_stmt` statement of the grammar.
*/
public class SimpleStmtNode implements Node {
- private Node assignment;
- private Node expr;
- private Node returnStmt;
- private Node importStmt;
+
+ private final Node assignment;
+ private final Node expr;
+ private final Node returnStmt;
+ private final Node importStmt;
public SimpleStmtNode(Node assignment, Node expr, Node returnStmt, Node importStmt) {
this.assignment = assignment;
@@ -24,7 +24,7 @@ public class SimpleStmtNode implements Node {
@Override
public ArrayList<SemanticError> checkSemantics(SymbolTable ST, int _nesting) {
- ArrayList<SemanticError> errors = new ArrayList<SemanticError>();
+ ArrayList<SemanticError> errors = new ArrayList();
if (assignment != null) {
errors.addAll(assignment.checkSemantics(ST, _nesting));