1

When I look at Java method AST declaration in Rascal, I see under Expression \super() node.

However in Java, you can also call super() with parameters. So, I expected to see something like : \super(list[Expression] arguments), but I do not see it.

Is it traced via \methodCall() or in some other way?

I could not try it myself because I get an error when I try to build an AST from a constructor with getMethodASTEclipse() method. I already opened an issue about this getMethodASTEclipse() error in the GitHub.

Davy Landman
  • 15,109
  • 6
  • 49
  • 73
caytekin
  • 171
  • 2
  • 12
  • Is this related to this issue: https://github.com/cwi-swat/rascal/issues/486 ? – Davy Landman Nov 05 '14 at 13:41
  • No, the issue in the github you're mentioning ([link](https://github.com/cwi-swat/rascal/issues/486)} is about not being able to build an AST for a constructor without arguments. – caytekin Nov 06 '14 at 14:45
  • This stackexchange question is about the following: given an AST, if there is a super(param1, param2) call in the code with parameters, how do we visit that node? What I now know is that we can visit it with \constructorCall(isSuper,_,_). The remaining question, then, is: what is super() node used or visited for? – caytekin Nov 06 '14 at 14:52
  • Aha, so you have answered the question, but now a new question appears, why it `super()` in the AST? could is be the `super.invokeMethod()` expression? that the receiver is `super()`? – Davy Landman Nov 06 '14 at 19:09
  • For the following code: – caytekin Nov 11 '14 at 12:11
  • (perhaps update the question?) – Davy Landman Nov 11 '14 at 12:13
  • For the following Java code: `super.p11();` the Rascal AST contains only `methodCall(_,_,_)` with no receiver. So, no, I don't think `super()` is used in the `super.invokeMethod()` as receiver. Do you know an example for which `super()` in Rascal AST is used? – caytekin Nov 11 '14 at 12:20
  • May be we can close this question and I can ask it as a new question... – caytekin Nov 11 '14 at 12:28
  • closing it is an good idea :) (and opening a new specific question!) – Davy Landman Nov 13 '14 at 10:16
  • This question is closed. I have opened a new question as follow-up : – caytekin Nov 20 '14 at 12:38

0 Answers0