Statement parent = getParentStatement();
FunctionStatement function = getFunctionStatement();
if (function.getType() == Type.CONSTRUCTOR) {
BlockStatement block = function.getBlockStatement();
if (parent == function && block.isEmpty()) {
_expression = new Expression(new LinkNode(this, location,
new Name().add(Name.SUPER, "super"), parameters, LinkNode.SUPER), location);
} else {
parser.error(location, "Superclass constructor invoke must appear as a first statement (characters between tags are considered statements)");
}
} else {
parser.error(location, "Superclass constructor invoke may only appear in constructor");
}
} else {
// super.method(params, ...)
_expression = new Expression(new LinkNode(this, location,
new Name().add(Name.SUPER, "super").add(method), parameters, LinkNode.GET), location);
}
} else {
if (method == null) {
parser.error(location, "Attribute 'method' not given");
return;
}
if (from == null) {
// method(params, ...)
_expression = new Expression(new LinkNode(this, location,
new Name().add(method), parameters, LinkNode.GET), location);
} else {
// expr.method(params, ...)
Expression self = Grammar.parseExpression(from, location, parser);