示例#1
0
 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;
 }
示例#2
0
 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;
 }
示例#3
0
 public ASAssignmentExpression newMultiplyAssignExpression(Expression left, Expression right) {
   return ASTBuilder.newAssignExpression(TokenBuilder.newMulAssign(), left, right);
 }
示例#4
0
 public ASAssignmentExpression newDivideAssignExpression(Expression left, Expression right) {
   return ASTBuilder.newAssignExpression(TokenBuilder.newDivAssign(), left, right);
 }
示例#5
0
 public ASPrefixExpression newNotExpression(Expression sub) {
   return newPrefixExpression(TokenBuilder.newNot(), sub);
 }
示例#6
0
 public ASPostfixExpression newPostIncExpression(Expression sub) {
   return newPostfixExpression(TokenBuilder.newPostInc(), sub);
 }
示例#7
0
 public ASPrefixExpression newPositiveExpression(Expression sub) {
   return newPrefixExpression(TokenBuilder.newPlus(), sub);
 }
示例#8
0
 public ASBinaryExpression newLessThanExpression(Expression left, Expression right) {
   return ASTBuilder.newBinaryExpression(TokenBuilder.newLess(), left, right);
 }
示例#9
0
 public ASBinaryExpression newShiftRightUnsignedExpression(Expression left, Expression right) {
   return ASTBuilder.newBinaryExpression(TokenBuilder.newShiftRightUnsigned(), left, right);
 }
示例#10
0
 public ASBinaryExpression newSubtractExpression(Expression left, Expression right) {
   return ASTBuilder.newBinaryExpression(TokenBuilder.newMinus(), left, right);
 }
示例#11
0
 public ASBinaryExpression newShiftLeftExpression(Expression left, Expression right) {
   return ASTBuilder.newBinaryExpression(TokenBuilder.newShiftLeft(), left, right);
 }
示例#12
0
 public ASBinaryExpression newNotEqualsExpression(Expression left, Expression right) {
   return ASTBuilder.newBinaryExpression(TokenBuilder.newNotEquals(), left, right);
 }
示例#13
0
 public ASBinaryExpression newMultiplyExpression(Expression left, Expression right) {
   return ASTBuilder.newBinaryExpression(TokenBuilder.newMult(), left, right);
 }
示例#14
0
 public ASAssignmentExpression newShiftRightUnsignedAssignExpression(
     Expression left, Expression right) {
   return ASTBuilder.newAssignExpression(TokenBuilder.newSRUAssign(), left, right);
 }
示例#15
0
 public ASPrefixExpression newNegativeExpression(Expression sub) {
   return newPrefixExpression(TokenBuilder.newMinus(), sub);
 }
示例#16
0
 public ASAssignmentExpression newSubtractAssignExpression(Expression left, Expression right) {
   return ASTBuilder.newAssignExpression(TokenBuilder.newSubAssign(), left, right);
 }
示例#17
0
 public ASBinaryExpression newAddExpression(Expression left, Expression right) {
   return ASTBuilder.newBinaryExpression(TokenBuilder.newPlus(), left, right);
 }