Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(261)

Side by Side Diff: runtime/vm/parser.h

Issue 2349593003: Support generic method syntax (fixes #25869). (Closed)
Patch Set: address comments Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #ifndef VM_PARSER_H_ 5 #ifndef VM_PARSER_H_
6 #define VM_PARSER_H_ 6 #define VM_PARSER_H_
7 7
8 #include "include/dart_api.h" 8 #include "include/dart_api.h"
9 9
10 #include "platform/assert.h" 10 #include "platform/assert.h"
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 void ParseLibraryDefinition(const Object& tl_owner); 503 void ParseLibraryDefinition(const Object& tl_owner);
504 void ParseLibraryName(); 504 void ParseLibraryName();
505 void ParseLibraryImportExport(const Object& tl_owner, 505 void ParseLibraryImportExport(const Object& tl_owner,
506 TokenPosition metadata_pos); 506 TokenPosition metadata_pos);
507 void ParseLibraryPart(); 507 void ParseLibraryPart();
508 void ParsePartHeader(); 508 void ParsePartHeader();
509 void ParseLibraryNameObsoleteSyntax(); 509 void ParseLibraryNameObsoleteSyntax();
510 void ParseLibraryImportObsoleteSyntax(); 510 void ParseLibraryImportObsoleteSyntax();
511 void ParseLibraryIncludeObsoleteSyntax(); 511 void ParseLibraryIncludeObsoleteSyntax();
512 512
513 void ResolveTypeFromClass(const Class& cls, 513 void ResolveType(ClassFinalizer::FinalizationKind finalization,
514 ClassFinalizer::FinalizationKind finalization, 514 AbstractType* type);
515 AbstractType* type);
516 RawAbstractType* ParseType(ClassFinalizer::FinalizationKind finalization, 515 RawAbstractType* ParseType(ClassFinalizer::FinalizationKind finalization,
517 bool allow_deferred_type = false, 516 bool allow_deferred_type = false,
518 bool consume_unresolved_prefix = true); 517 bool consume_unresolved_prefix = true);
519 RawAbstractType* ParseType( 518 RawAbstractType* ParseType(
520 ClassFinalizer::FinalizationKind finalization, 519 ClassFinalizer::FinalizationKind finalization,
521 bool allow_deferred_type, 520 bool allow_deferred_type,
522 bool consume_unresolved_prefix, 521 bool consume_unresolved_prefix,
523 LibraryPrefix* prefix); 522 LibraryPrefix* prefix);
524 523
525 void ParseTypeParameters(const Class& cls); 524 void ParseTypeParameters(bool parameterizing_class);
526 RawTypeArguments* ParseTypeArguments( 525 RawTypeArguments* ParseTypeArguments(
527 ClassFinalizer::FinalizationKind finalization); 526 ClassFinalizer::FinalizationKind finalization);
528 void ParseMethodOrConstructor(ClassDesc* members, MemberDesc* method); 527 void ParseMethodOrConstructor(ClassDesc* members, MemberDesc* method);
529 void ParseFieldDefinition(ClassDesc* members, MemberDesc* field); 528 void ParseFieldDefinition(ClassDesc* members, MemberDesc* field);
530 void CheckMemberNameConflict(ClassDesc* members, MemberDesc* member); 529 void CheckMemberNameConflict(ClassDesc* members, MemberDesc* member);
531 void ParseClassMemberDefinition(ClassDesc* members, 530 void ParseClassMemberDefinition(ClassDesc* members,
532 TokenPosition metadata_pos); 531 TokenPosition metadata_pos);
533 void ParseFormalParameter(bool allow_explicit_default_value, 532 void ParseFormalParameter(bool allow_explicit_default_value,
534 bool evaluate_metadata, 533 bool evaluate_metadata,
535 ParamList* params); 534 ParamList* params);
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 653
655 void AddAsyncClosureParameters(ParamList* params); 654 void AddAsyncClosureParameters(ParamList* params);
656 void AddContinuationVariables(); 655 void AddContinuationVariables();
657 void AddAsyncClosureVariables(); 656 void AddAsyncClosureVariables();
658 void AddAsyncGeneratorVariables(); 657 void AddAsyncGeneratorVariables();
659 658
660 LocalVariable* LookupReceiver(LocalScope* from_scope, bool test_only); 659 LocalVariable* LookupReceiver(LocalScope* from_scope, bool test_only);
661 LocalVariable* LookupTypeArgumentsParameter(LocalScope* from_scope, 660 LocalVariable* LookupTypeArgumentsParameter(LocalScope* from_scope,
662 bool test_only); 661 bool test_only);
663 void CaptureInstantiator(); 662 void CaptureInstantiator();
663 void CaptureFunctionInstantiator();
664 AstNode* LoadReceiver(TokenPosition token_pos); 664 AstNode* LoadReceiver(TokenPosition token_pos);
665 AstNode* LoadFieldIfUnresolved(AstNode* node); 665 AstNode* LoadFieldIfUnresolved(AstNode* node);
666 AstNode* LoadClosure(PrimaryNode* primary); 666 AstNode* LoadClosure(PrimaryNode* primary);
667 AstNode* LoadTypeParameter(PrimaryNode* primary);
667 InstanceGetterNode* CallGetter(TokenPosition token_pos, 668 InstanceGetterNode* CallGetter(TokenPosition token_pos,
668 AstNode* object, 669 AstNode* object,
669 const String& name); 670 const String& name);
670 671
671 AstNode* ParseAssertStatement(bool is_const = false); 672 AstNode* ParseAssertStatement(bool is_const = false);
672 AstNode* ParseJump(String* label_name); 673 AstNode* ParseJump(String* label_name);
673 AstNode* ParseIfStatement(String* label_name); 674 AstNode* ParseIfStatement(String* label_name);
674 AstNode* ParseWhileStatement(String* label_name); 675 AstNode* ParseWhileStatement(String* label_name);
675 AstNode* ParseDoWhileStatement(String* label_name); 676 AstNode* ParseDoWhileStatement(String* label_name);
676 AstNode* ParseForStatement(String* label_name); 677 AstNode* ParseForStatement(String* label_name);
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
819 TokenPosition ident_pos); 820 TokenPosition ident_pos);
820 821
821 LocalVariable* LookupLocalScope(const String& ident); 822 LocalVariable* LookupLocalScope(const String& ident);
822 void CheckInstanceFieldAccess(TokenPosition field_pos, 823 void CheckInstanceFieldAccess(TokenPosition field_pos,
823 const String& field_name); 824 const String& field_name);
824 bool ParsingStaticMember() const; 825 bool ParsingStaticMember() const;
825 const AbstractType* ReceiverType(const Class& cls); 826 const AbstractType* ReceiverType(const Class& cls);
826 bool IsInstantiatorRequired() const; 827 bool IsInstantiatorRequired() const;
827 bool ResolveIdentInLocalScope(TokenPosition ident_pos, 828 bool ResolveIdentInLocalScope(TokenPosition ident_pos,
828 const String &ident, 829 const String &ident,
829 AstNode** node); 830 AstNode** node,
831 intptr_t* function_level);
830 static const bool kResolveLocally = true; 832 static const bool kResolveLocally = true;
831 static const bool kResolveIncludingImports = false; 833 static const bool kResolveIncludingImports = false;
832 834
833 // Resolve a primary identifier in the library or prefix scope and 835 // Resolve a primary identifier in the library or prefix scope and
834 // generate the corresponding AstNode. 836 // generate the corresponding AstNode.
835 AstNode* ResolveIdentInCurrentLibraryScope(TokenPosition ident_pos, 837 AstNode* ResolveIdentInCurrentLibraryScope(TokenPosition ident_pos,
836 const String& ident); 838 const String& ident);
837 AstNode* ResolveIdentInPrefixScope(TokenPosition ident_pos, 839 AstNode* ResolveIdentInPrefixScope(TokenPosition ident_pos,
838 const LibraryPrefix& prefix, 840 const LibraryPrefix& prefix,
839 const String& ident); 841 const String& ident);
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
973 975
974 intptr_t recursion_counter_; 976 intptr_t recursion_counter_;
975 friend class RecursionChecker; 977 friend class RecursionChecker;
976 978
977 DISALLOW_COPY_AND_ASSIGN(Parser); 979 DISALLOW_COPY_AND_ASSIGN(Parser);
978 }; 980 };
979 981
980 } // namespace dart 982 } // namespace dart
981 983
982 #endif // VM_PARSER_H_ 984 #endif // VM_PARSER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698