OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1462 Token::Value op_; | 1462 Token::Value op_; |
1463 Expression* left_; | 1463 Expression* left_; |
1464 Expression* right_; | 1464 Expression* right_; |
1465 }; | 1465 }; |
1466 | 1466 |
1467 | 1467 |
1468 class Conditional: public Expression { | 1468 class Conditional: public Expression { |
1469 public: | 1469 public: |
1470 Conditional(Expression* condition, | 1470 Conditional(Expression* condition, |
1471 Expression* then_expression, | 1471 Expression* then_expression, |
1472 Expression* else_expression) | 1472 Expression* else_expression, |
| 1473 int then_expression_position, |
| 1474 int else_expression_position) |
1473 : condition_(condition), | 1475 : condition_(condition), |
1474 then_expression_(then_expression), | 1476 then_expression_(then_expression), |
1475 else_expression_(else_expression) { } | 1477 else_expression_(else_expression), |
| 1478 then_expression_position_(then_expression_position), |
| 1479 else_expression_position_(else_expression_position) { } |
1476 | 1480 |
1477 virtual void Accept(AstVisitor* v); | 1481 virtual void Accept(AstVisitor* v); |
1478 | 1482 |
1479 virtual bool IsPrimitive(); | 1483 virtual bool IsPrimitive(); |
1480 | 1484 |
1481 Expression* condition() const { return condition_; } | 1485 Expression* condition() const { return condition_; } |
1482 Expression* then_expression() const { return then_expression_; } | 1486 Expression* then_expression() const { return then_expression_; } |
1483 Expression* else_expression() const { return else_expression_; } | 1487 Expression* else_expression() const { return else_expression_; } |
1484 | 1488 |
| 1489 int then_expression_position() { return then_expression_position_; } |
| 1490 int else_expression_position() { return else_expression_position_; } |
| 1491 |
1485 private: | 1492 private: |
1486 Expression* condition_; | 1493 Expression* condition_; |
1487 Expression* then_expression_; | 1494 Expression* then_expression_; |
1488 Expression* else_expression_; | 1495 Expression* else_expression_; |
| 1496 int then_expression_position_; |
| 1497 int else_expression_position_; |
1489 }; | 1498 }; |
1490 | 1499 |
1491 | 1500 |
1492 class Assignment: public Expression { | 1501 class Assignment: public Expression { |
1493 public: | 1502 public: |
1494 Assignment(Token::Value op, Expression* target, Expression* value, int pos) | 1503 Assignment(Token::Value op, Expression* target, Expression* value, int pos) |
1495 : op_(op), target_(target), value_(value), pos_(pos), | 1504 : op_(op), target_(target), value_(value), pos_(pos), |
1496 block_start_(false), block_end_(false) { | 1505 block_start_(false), block_end_(false) { |
1497 ASSERT(Token::IsAssignmentOp(op)); | 1506 ASSERT(Token::IsAssignmentOp(op)); |
1498 } | 1507 } |
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2088 | 2097 |
2089 // Holds the result of copying an expression. | 2098 // Holds the result of copying an expression. |
2090 Expression* expr_; | 2099 Expression* expr_; |
2091 // Holds the result of copying a statement. | 2100 // Holds the result of copying a statement. |
2092 Statement* stmt_; | 2101 Statement* stmt_; |
2093 }; | 2102 }; |
2094 | 2103 |
2095 } } // namespace v8::internal | 2104 } } // namespace v8::internal |
2096 | 2105 |
2097 #endif // V8_AST_H_ | 2106 #endif // V8_AST_H_ |
OLD | NEW |