Remarks on grammar/generated ASTs
Discussion linked to !1 (closed).
NullLiteral
The NullLiteral
tag should have one child token
with a simplevalue of String. This is not the case in the ASTs were you find things like: <NullLiteral>null</NullLiteral>
which doesn't respect the grammar. This should be changed in the ASTs generator (unless you already changed it in the meantime).
- NullLiteral: do you need the NullLiteral for the miner?
It's similar to the image tag explained here !5 . It's not directly linked to the miner but the generated AST should normally respect the given java grammar. The proper AST should thus be <NullLiteral><token>null</token></NullLiteral>
. I'd like this to be addressed somehow because, for now, I "manually" replaced all the occurrences with the correct xml definition.
ThisExpression
I noticed the ThisExpression
tag is missing in the ASTs. This has an impact on the grammar (optional/mandatory). Some examples are included in the list here: !1 (closed). This has an impact on the commit d6bfa2e8
ThisExpression: I browsed some output of the parser and I am not sure that this literal is needed. Could you please provide an example from jhotdraw to confirm that it is needed? In case, no problem in adding it.
An example of the impact of this is in AbstractApplication.xml
ID="4820". The AST for this piece of code v.getApplication() != this
is
<InfixExpression>
<leftOperand>...<leftOperand>
<operator>!=</operator>
</InfixExpression>
InfixExpression
in Eclipse is defined here where both left and right operands are mandatory. But, in the generated ASTs, the ThisExpression
tag is missing which makes the right operand optional.
Also, I think it would be interesting for the miner that this tag appears in the ASTs.
Thanks