summaryrefslogtreecommitdiff
path: root/src/ast/nodes/TrailerNode.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/TrailerNode.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/TrailerNode.java')
-rw-r--r--src/ast/nodes/TrailerNode.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ast/nodes/TrailerNode.java b/src/ast/nodes/TrailerNode.java
index b0a0ee7..850b8e8 100644
--- a/src/ast/nodes/TrailerNode.java
+++ b/src/ast/nodes/TrailerNode.java
@@ -11,6 +11,7 @@ import org.antlr.v4.runtime.tree.TerminalNode;
* Node for the `trailer` statement of the grammar.
*/
public class TrailerNode implements Node {
+
private Node arglist;
private ArrayList<Node> exprs;
private TerminalNode methodCall;
@@ -39,6 +40,10 @@ public class TrailerNode implements Node {
return errors;
}
+ public int getArgumentNumber() {
+ return ((ArglistNode) arglist).getArgumentNumber();
+ }
+
@Override
public Type typeCheck() {
return new VoidType();