summaryrefslogtreecommitdiff
path: root/src/ast/nodes/ParamlistNode.java
diff options
context:
space:
mode:
authorgeno <gabriele.genovese2@studio.unibo.it>2024-06-26 14:53:05 +0200
committergeno <gabriele.genovese2@studio.unibo.it>2024-06-26 14:53:05 +0200
commit06671f5aed68753435a762bc3be43e83094156d1 (patch)
tree56f251596cf57f6f13a7921e7dad6e795989329d /src/ast/nodes/ParamlistNode.java
parente09358f3648445bbf9747f40497af6221d933a99 (diff)
exercise 1 completed
1.b now works 1.c implened error for "function takes N positional arguments but M were given"
Diffstat (limited to 'src/ast/nodes/ParamlistNode.java')
-rw-r--r--src/ast/nodes/ParamlistNode.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ast/nodes/ParamlistNode.java b/src/ast/nodes/ParamlistNode.java
index 144eb13..0a9696f 100644
--- a/src/ast/nodes/ParamlistNode.java
+++ b/src/ast/nodes/ParamlistNode.java
@@ -10,6 +10,7 @@ import ast.types.*;
* Node for the `param_list` statement of the grammar.
*/
public class ParamlistNode implements Node {
+
private ArrayList<Node> params;
public ParamlistNode(ArrayList<Node> _params) {
@@ -27,6 +28,10 @@ public class ParamlistNode implements Node {
return errors;
}
+ public int getParamNumber() {
+ return params.size();
+ }
+
@Override
public Type typeCheck() {
return new VoidType();