OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 1223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1234 | 1234 |
1235 virtual void Accept(AstVisitor* v); | 1235 virtual void Accept(AstVisitor* v); |
1236 virtual Assignment* AsAssignment() { return this; } | 1236 virtual Assignment* AsAssignment() { return this; } |
1237 | 1237 |
1238 Token::Value binary_op() const; | 1238 Token::Value binary_op() const; |
1239 | 1239 |
1240 Token::Value op() const { return op_; } | 1240 Token::Value op() const { return op_; } |
1241 Expression* target() const { return target_; } | 1241 Expression* target() const { return target_; } |
1242 Expression* value() const { return value_; } | 1242 Expression* value() const { return value_; } |
1243 int position() { return pos_; } | 1243 int position() { return pos_; } |
| 1244 // This check relies on the definition order of token in token.h. |
| 1245 bool is_compound() const { return op() > Token::ASSIGN; } |
1244 | 1246 |
1245 // An initialization block is a series of statments of the form | 1247 // An initialization block is a series of statments of the form |
1246 // x.y.z.a = ...; x.y.z.b = ...; etc. The parser marks the beginning and | 1248 // x.y.z.a = ...; x.y.z.b = ...; etc. The parser marks the beginning and |
1247 // ending of these blocks to allow for optimizations of initialization | 1249 // ending of these blocks to allow for optimizations of initialization |
1248 // blocks. | 1250 // blocks. |
1249 bool starts_initialization_block() { return block_start_; } | 1251 bool starts_initialization_block() { return block_start_; } |
1250 bool ends_initialization_block() { return block_end_; } | 1252 bool ends_initialization_block() { return block_end_; } |
1251 void mark_block_start() { block_start_ = true; } | 1253 void mark_block_start() { block_start_ = true; } |
1252 void mark_block_end() { block_end_ = true; } | 1254 void mark_block_end() { block_end_ = true; } |
1253 | 1255 |
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1781 #undef DEF_VISIT | 1783 #undef DEF_VISIT |
1782 | 1784 |
1783 private: | 1785 private: |
1784 bool stack_overflow_; | 1786 bool stack_overflow_; |
1785 }; | 1787 }; |
1786 | 1788 |
1787 | 1789 |
1788 } } // namespace v8::internal | 1790 } } // namespace v8::internal |
1789 | 1791 |
1790 #endif // V8_AST_H_ | 1792 #endif // V8_AST_H_ |
OLD | NEW |