diff options
Diffstat (limited to 'src/ast/nodes/TrailerNode.java')
-rw-r--r-- | src/ast/nodes/TrailerNode.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/ast/nodes/TrailerNode.java b/src/ast/nodes/TrailerNode.java index 850b8e8..22e43a0 100644 --- a/src/ast/nodes/TrailerNode.java +++ b/src/ast/nodes/TrailerNode.java @@ -15,12 +15,14 @@ public class TrailerNode implements Node { private Node arglist; private ArrayList<Node> exprs; private TerminalNode methodCall; + private boolean isParenthesis; private boolean isEmpty; - public TrailerNode(Node arglist, ArrayList<Node> exprs, TerminalNode methodCall) { + public TrailerNode(Node arglist, ArrayList<Node> exprs, TerminalNode methodCall, boolean isParenthesis) { this.arglist = arglist; this.exprs = exprs; this.methodCall = methodCall; + this.isParenthesis = isParenthesis; this.isEmpty = (this.arglist == null && this.exprs.size() == 0 && this.methodCall == null); } @@ -41,9 +43,17 @@ public class TrailerNode implements Node { } public int getArgumentNumber() { + if (arglist == null) { + return 0; + } + return ((ArglistNode) arglist).getArgumentNumber(); } + public boolean isParenthesis() { + return this.isParenthesis; + } + @Override public Type typeCheck() { return new VoidType(); |