From 06671f5aed68753435a762bc3be43e83094156d1 Mon Sep 17 00:00:00 2001 From: geno Date: Wed, 26 Jun 2024 14:53:05 +0200 Subject: exercise 1 completed 1.b now works 1.c implened error for "function takes N positional arguments but M were given" --- src/ast/nodes/SimpleStmtNode.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/ast/nodes/SimpleStmtNode.java') diff --git a/src/ast/nodes/SimpleStmtNode.java b/src/ast/nodes/SimpleStmtNode.java index 5f844cb..b7e5455 100644 --- a/src/ast/nodes/SimpleStmtNode.java +++ b/src/ast/nodes/SimpleStmtNode.java @@ -1,10 +1,9 @@ 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. -- cgit v1.2.3-18-g5258 From afff6a80cd58f7787efa1398f7c8cbdce8989323 Mon Sep 17 00:00:00 2001 From: geno Date: Sun, 30 Jun 2024 13:36:37 +0200 Subject: fixed warnings, better formatting, final added where possible --- src/ast/nodes/SimpleStmtNode.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/ast/nodes/SimpleStmtNode.java') diff --git a/src/ast/nodes/SimpleStmtNode.java b/src/ast/nodes/SimpleStmtNode.java index b7e5455..b2bc880 100644 --- a/src/ast/nodes/SimpleStmtNode.java +++ b/src/ast/nodes/SimpleStmtNode.java @@ -9,10 +9,11 @@ import semanticanalysis.SymbolTable; * 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; @@ -23,7 +24,7 @@ public class SimpleStmtNode implements Node { @Override public ArrayList checkSemantics(SymbolTable ST, int _nesting) { - ArrayList errors = new ArrayList(); + ArrayList errors = new ArrayList(); if (assignment != null) { errors.addAll(assignment.checkSemantics(ST, _nesting)); -- cgit v1.2.3-18-g5258