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/CompoundNode.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ast/nodes/CompoundNode.java') diff --git a/src/ast/nodes/CompoundNode.java b/src/ast/nodes/CompoundNode.java index e64be9e..d21c2c7 100644 --- a/src/ast/nodes/CompoundNode.java +++ b/src/ast/nodes/CompoundNode.java @@ -1,15 +1,15 @@ package ast.nodes; +import ast.types.*; import java.util.ArrayList; - import semanticanalysis.SemanticError; import semanticanalysis.SymbolTable; -import ast.types.*; /** * Node for the `compound_node` statement of the grammar. */ public class CompoundNode implements Node { + private Node ifNode; private Node funcDef; private Node forStmt; -- 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/CompoundNode.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/ast/nodes/CompoundNode.java') diff --git a/src/ast/nodes/CompoundNode.java b/src/ast/nodes/CompoundNode.java index d21c2c7..845f05e 100644 --- a/src/ast/nodes/CompoundNode.java +++ b/src/ast/nodes/CompoundNode.java @@ -10,10 +10,10 @@ import semanticanalysis.SymbolTable; */ public class CompoundNode implements Node { - private Node ifNode; - private Node funcDef; - private Node forStmt; - private Node whileStmt; + private final Node ifNode; + private final Node funcDef; + private final Node forStmt; + private final Node whileStmt; public CompoundNode(Node ifNode, Node funcDef, Node forStmt, Node whileStmt) { this.ifNode = ifNode; @@ -24,7 +24,7 @@ public class CompoundNode implements Node { @Override public ArrayList checkSemantics(SymbolTable ST, int _nesting) { - ArrayList errors = new ArrayList(); + ArrayList errors = new ArrayList(); if (ifNode != null) { errors.addAll(ifNode.checkSemantics(ST, _nesting)); -- cgit v1.2.3-18-g5258