public ASPostfixExpression newPostIncExpression(Expression sub) {
return newPostfixExpression(TokenBuilder.newPostInc(), sub);
}
public ASNewExpression newNewExpression(Expression subexpression, List args) {
LinkedListTree ast = ASTUtils.newAST(AS3Parser.NEW, "new");
ast.appendToken(TokenBuilder.newSpace());
LinkedListTree subExpr = ast(subexpression);
ASTBuilder.assertNoParent("sub-expression", subExpr);
// TODO: recursively check the given subexpression
ast.addChildWithTokens(subExpr);
LinkedListTree arguments = ASTUtils.newParentheticAST(AS3Parser.ARGUMENTS, AS3Parser.LPAREN, "(", AS3Parser.RPAREN, ")");
ast.addChildWithTokens(arguments);
ASTASNewExpression result = new ASTASNewExpression(ast);
result.setArguments(args);
return result;
}