public ASArrayAccessExpression newArrayAccessExpression(Expression target, Expression subscript) { LinkedListTree ast = ASTUtils.newImaginaryAST(AS3Parser.ARRAY_ACC); LinkedListTree targetExpr = ast(target); ASTBuilder.assertNoParent("target expression", targetExpr); // TODO: recursively check the given subexpression ast.addChildWithTokens(targetExpr); ast.appendToken(TokenBuilder.newLBrack()); LinkedListTree subscriptExpr = ast(subscript); ASTBuilder.assertNoParent("subscript expression", subscriptExpr); ast.addChildWithTokens(subscriptExpr); ast.appendToken(TokenBuilder.newRBrack()); ASTASArrayAccessExpression result = new ASTASArrayAccessExpression(ast); return result; }
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; }
public ASAssignmentExpression newMultiplyAssignExpression(Expression left, Expression right) { return ASTBuilder.newAssignExpression(TokenBuilder.newMulAssign(), left, right); }
public ASAssignmentExpression newDivideAssignExpression(Expression left, Expression right) { return ASTBuilder.newAssignExpression(TokenBuilder.newDivAssign(), left, right); }
public ASPrefixExpression newNotExpression(Expression sub) { return newPrefixExpression(TokenBuilder.newNot(), sub); }
public ASPostfixExpression newPostIncExpression(Expression sub) { return newPostfixExpression(TokenBuilder.newPostInc(), sub); }
public ASPrefixExpression newPositiveExpression(Expression sub) { return newPrefixExpression(TokenBuilder.newPlus(), sub); }
public ASBinaryExpression newLessThanExpression(Expression left, Expression right) { return ASTBuilder.newBinaryExpression(TokenBuilder.newLess(), left, right); }
public ASBinaryExpression newShiftRightUnsignedExpression(Expression left, Expression right) { return ASTBuilder.newBinaryExpression(TokenBuilder.newShiftRightUnsigned(), left, right); }
public ASBinaryExpression newSubtractExpression(Expression left, Expression right) { return ASTBuilder.newBinaryExpression(TokenBuilder.newMinus(), left, right); }
public ASBinaryExpression newShiftLeftExpression(Expression left, Expression right) { return ASTBuilder.newBinaryExpression(TokenBuilder.newShiftLeft(), left, right); }
public ASBinaryExpression newNotEqualsExpression(Expression left, Expression right) { return ASTBuilder.newBinaryExpression(TokenBuilder.newNotEquals(), left, right); }
public ASBinaryExpression newMultiplyExpression(Expression left, Expression right) { return ASTBuilder.newBinaryExpression(TokenBuilder.newMult(), left, right); }
public ASAssignmentExpression newShiftRightUnsignedAssignExpression( Expression left, Expression right) { return ASTBuilder.newAssignExpression(TokenBuilder.newSRUAssign(), left, right); }
public ASPrefixExpression newNegativeExpression(Expression sub) { return newPrefixExpression(TokenBuilder.newMinus(), sub); }
public ASAssignmentExpression newSubtractAssignExpression(Expression left, Expression right) { return ASTBuilder.newAssignExpression(TokenBuilder.newSubAssign(), left, right); }
public ASBinaryExpression newAddExpression(Expression left, Expression right) { return ASTBuilder.newBinaryExpression(TokenBuilder.newPlus(), left, right); }