| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/parser.h" | 5 #include "vm/parser.h" |
| 6 | 6 |
| 7 #include "lib/invocation_mirror.h" | 7 #include "lib/invocation_mirror.h" |
| 8 #include "vm/bigint_operations.h" | 8 #include "vm/bigint_operations.h" |
| 9 #include "vm/class_finalizer.h" | 9 #include "vm/class_finalizer.h" |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 } | 59 } |
| 60 indent_++; | 60 indent_++; |
| 61 } | 61 } |
| 62 } | 62 } |
| 63 ~TraceParser() { indent_--; } | 63 ~TraceParser() { indent_--; } |
| 64 private: | 64 private: |
| 65 void PrintIndent() { | 65 void PrintIndent() { |
| 66 for (int i = 0; i < indent_; i++) { OS::Print(". "); } | 66 for (int i = 0; i < indent_; i++) { OS::Print(". "); } |
| 67 } | 67 } |
| 68 static int indent_; | 68 static int indent_; |
| 69 |
| 70 DISALLOW_COPY_AND_ASSIGN(TraceParser); |
| 69 }; | 71 }; |
| 70 | 72 |
| 71 int TraceParser::indent_ = 0; | 73 int TraceParser::indent_ = 0; |
| 72 | 74 |
| 73 #define TRACE_PARSER(s) \ | 75 #define TRACE_PARSER(s) \ |
| 74 TraceParser __p__(this->TokenPos(), this->script_, s) | 76 TraceParser __p__(this->TokenPos(), this->script_, s) |
| 75 | 77 |
| 76 #else // not DEBUG | 78 #else // not DEBUG |
| 77 #define TRACE_PARSER(s) | 79 #define TRACE_PARSER(s) |
| 78 #endif // DEBUG | 80 #endif // DEBUG |
| (...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 697 bool FunctionExists(const String& name) const { | 699 bool FunctionExists(const String& name) const { |
| 698 return LookupFunction(name) != NULL; | 700 return LookupFunction(name) != NULL; |
| 699 } | 701 } |
| 700 | 702 |
| 701 const Class& clazz_; | 703 const Class& clazz_; |
| 702 const String& class_name_; | 704 const String& class_name_; |
| 703 intptr_t token_pos_; // Token index of "class" keyword. | 705 intptr_t token_pos_; // Token index of "class" keyword. |
| 704 GrowableObjectArray& functions_; | 706 GrowableObjectArray& functions_; |
| 705 GrowableObjectArray& fields_; | 707 GrowableObjectArray& fields_; |
| 706 GrowableArray<MemberDesc> members_; | 708 GrowableArray<MemberDesc> members_; |
| 709 |
| 710 DISALLOW_COPY_AND_ASSIGN(ClassDesc); |
| 707 }; | 711 }; |
| 708 | 712 |
| 709 | 713 |
| 710 struct TopLevel { | 714 struct TopLevel { |
| 711 TopLevel() : | 715 TopLevel() : |
| 712 fields(GrowableObjectArray::Handle(GrowableObjectArray::New())), | 716 fields(GrowableObjectArray::Handle(GrowableObjectArray::New())), |
| 713 functions(GrowableObjectArray::Handle(GrowableObjectArray::New())) { } | 717 functions(GrowableObjectArray::Handle(GrowableObjectArray::New())) { } |
| 714 | 718 |
| 715 GrowableObjectArray& fields; | 719 GrowableObjectArray& fields; |
| 716 GrowableObjectArray& functions; | 720 GrowableObjectArray& functions; |
| (...skipping 9325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10042 void Parser::SkipQualIdent() { | 10046 void Parser::SkipQualIdent() { |
| 10043 ASSERT(IsIdentifier()); | 10047 ASSERT(IsIdentifier()); |
| 10044 ConsumeToken(); | 10048 ConsumeToken(); |
| 10045 if (CurrentToken() == Token::kPERIOD) { | 10049 if (CurrentToken() == Token::kPERIOD) { |
| 10046 ConsumeToken(); // Consume the kPERIOD token. | 10050 ConsumeToken(); // Consume the kPERIOD token. |
| 10047 ExpectIdentifier("identifier expected after '.'"); | 10051 ExpectIdentifier("identifier expected after '.'"); |
| 10048 } | 10052 } |
| 10049 } | 10053 } |
| 10050 | 10054 |
| 10051 } // namespace dart | 10055 } // namespace dart |
| OLD | NEW |