diff options
Diffstat (limited to 'src/ast/nodes/FuncdefNode.java')
-rw-r--r-- | src/ast/nodes/FuncdefNode.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/ast/nodes/FuncdefNode.java b/src/ast/nodes/FuncdefNode.java index 8985e08..c4f5846 100644 --- a/src/ast/nodes/FuncdefNode.java +++ b/src/ast/nodes/FuncdefNode.java @@ -14,9 +14,9 @@ import org.antlr.v4.runtime.tree.TerminalNode; */ public class FuncdefNode implements Node { - private TerminalNode name; - private Node paramlist; - private Node block; + private final TerminalNode name; + private final Node paramlist; + private final Node block; public FuncdefNode(TerminalNode name, Node paramlist, Node block) { this.name = name; @@ -26,14 +26,14 @@ public class FuncdefNode implements Node { @Override public ArrayList<SemanticError> checkSemantics(SymbolTable ST, int _nesting) { - ArrayList<SemanticError> errors = new ArrayList<SemanticError>(); + ArrayList<SemanticError> errors = new ArrayList(); int paramNumber = ((ParamlistNode) paramlist).getParamNumber(); Type returnType = this.block.typeCheck(); FunctionType ft = new FunctionType(paramNumber, returnType); ST.insert(this.name.toString(), ft, _nesting, ""); - HashMap<String, STentry> HM = new HashMap<String, STentry>(); + HashMap<String, STentry> HM = new HashMap(); ST.add(HM); @@ -66,6 +66,7 @@ public class FuncdefNode implements Node { return ""; } + @Override public String toPrint(String prefix) { String str = prefix + "Funcdef(" + name + ")\n"; |