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

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

Issue 12210127: First stab at mixins in VM compiler (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "vm/ast.h" 10 #include "vm/ast.h"
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 RawObject* EvaluateConstConstructorCall( 321 RawObject* EvaluateConstConstructorCall(
322 const Class& type_class, 322 const Class& type_class,
323 const AbstractTypeArguments& type_arguments, 323 const AbstractTypeArguments& type_arguments,
324 const Function& constructor, 324 const Function& constructor,
325 ArgumentListNode* arguments); 325 ArgumentListNode* arguments);
326 AstNode* FoldConstExpr(intptr_t expr_pos, AstNode* expr); 326 AstNode* FoldConstExpr(intptr_t expr_pos, AstNode* expr);
327 327
328 // Support for parsing of scripts. 328 // Support for parsing of scripts.
329 void ParseTopLevel(); 329 void ParseTopLevel();
330 void ParseClassDefinition(const GrowableObjectArray& pending_classes); 330 void ParseClassDefinition(const GrowableObjectArray& pending_classes);
331 void ParseFunctionTypeAlias(const GrowableObjectArray& pending_classes); 331 void ParseMixinTypedef(const GrowableObjectArray& pending_classes);
332 void ParseTypedef(const GrowableObjectArray& pending_classes);
332 void ParseTopLevelVariable(TopLevel* top_level); 333 void ParseTopLevelVariable(TopLevel* top_level);
333 void ParseTopLevelFunction(TopLevel* top_level); 334 void ParseTopLevelFunction(TopLevel* top_level);
334 void ParseTopLevelAccessor(TopLevel* top_level); 335 void ParseTopLevelAccessor(TopLevel* top_level);
335 336
336 // Support for parsing libraries. 337 // Support for parsing libraries.
337 Dart_Handle CallLibraryTagHandler(Dart_LibraryTag tag, 338 Dart_Handle CallLibraryTagHandler(Dart_LibraryTag tag,
338 intptr_t token_pos, 339 intptr_t token_pos,
339 const String& url); 340 const String& url);
340 void ParseIdentList(GrowableObjectArray* names); 341 void ParseIdentList(GrowableObjectArray* names);
341 void ParseLibraryDefinition(); 342 void ParseLibraryDefinition();
(...skipping 17 matching lines...) Expand all
359 void ParseMethodOrConstructor(ClassDesc* members, MemberDesc* method); 360 void ParseMethodOrConstructor(ClassDesc* members, MemberDesc* method);
360 void ParseFieldDefinition(ClassDesc* members, MemberDesc* field); 361 void ParseFieldDefinition(ClassDesc* members, MemberDesc* field);
361 void ParseClassMemberDefinition(ClassDesc* members); 362 void ParseClassMemberDefinition(ClassDesc* members);
362 void ParseFormalParameter(bool allow_explicit_default_value, 363 void ParseFormalParameter(bool allow_explicit_default_value,
363 ParamList* params); 364 ParamList* params);
364 void ParseFormalParameters(bool allow_explicit_default_values, 365 void ParseFormalParameters(bool allow_explicit_default_values,
365 ParamList* params); 366 ParamList* params);
366 void ParseFormalParameterList(bool allow_explicit_default_values, 367 void ParseFormalParameterList(bool allow_explicit_default_values,
367 ParamList* params); 368 ParamList* params);
368 void CheckConstFieldsInitialized(const Class& cls); 369 void CheckConstFieldsInitialized(const Class& cls);
369 void AddImplicitConstructor(ClassDesc* members); 370 void AddImplicitConstructor(const Class& cls);
370 void CheckConstructors(ClassDesc* members); 371 void CheckConstructors(ClassDesc* members);
371 void ParseInitializedInstanceFields( 372 void ParseInitializedInstanceFields(
372 const Class& cls, 373 const Class& cls,
373 LocalVariable* receiver, 374 LocalVariable* receiver,
374 GrowableArray<Field*>* initialized_fields); 375 GrowableArray<Field*>* initialized_fields);
375 void CheckDuplicateFieldInit(intptr_t init_pos, 376 void CheckDuplicateFieldInit(intptr_t init_pos,
376 GrowableArray<Field*>* initialized_fields, 377 GrowableArray<Field*>* initialized_fields,
377 Field* field); 378 Field* field);
378 void GenerateSuperConstructorCall(const Class& cls, 379 void GenerateSuperConstructorCall(const Class& cls,
379 LocalVariable* receiver); 380 LocalVariable* receiver);
380 AstNode* ParseSuperInitializer(const Class& cls, LocalVariable* receiver); 381 AstNode* ParseSuperInitializer(const Class& cls, LocalVariable* receiver);
381 AstNode* ParseInitializer(const Class& cls, 382 AstNode* ParseInitializer(const Class& cls,
382 LocalVariable* receiver, 383 LocalVariable* receiver,
383 GrowableArray<Field*>* initialized_fields); 384 GrowableArray<Field*>* initialized_fields);
384 void ParseConstructorRedirection(const Class& cls, LocalVariable* receiver); 385 void ParseConstructorRedirection(const Class& cls, LocalVariable* receiver);
385 void ParseInitializers(const Class& cls, 386 void ParseInitializers(const Class& cls,
386 LocalVariable* receiver, 387 LocalVariable* receiver,
387 GrowableArray<Field*>* initialized_fields); 388 GrowableArray<Field*>* initialized_fields);
388 String& ParseNativeDeclaration(); 389 String& ParseNativeDeclaration();
389 RawArray* ParseInterfaceList(const Type& super_type); 390 RawArray* ParseInterfaceList(const Type& super_type);
391 RawType* ParseMixins(const Type& super_type);
390 void AddInterfaceIfUnique(intptr_t interfaces_pos, 392 void AddInterfaceIfUnique(intptr_t interfaces_pos,
391 const GrowableObjectArray& interface_list, 393 const GrowableObjectArray& interface_list,
392 const AbstractType& interface); 394 const AbstractType& interface);
393 void AddInterfaces(intptr_t interfaces_pos, 395 void AddInterfaces(intptr_t interfaces_pos,
394 const Class& cls, 396 const Class& cls,
395 const Array& interfaces); 397 const Array& interfaces);
396 StaticCallNode* BuildInvocationMirrorAllocation( 398 StaticCallNode* BuildInvocationMirrorAllocation(
397 intptr_t call_pos, 399 intptr_t call_pos,
398 const String& function_name, 400 const String& function_name,
399 const ArgumentListNode& function_args); 401 const ArgumentListNode& function_args);
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 bool is_const); 484 bool is_const);
483 AstNode* ParseVariableDeclarationList(); 485 AstNode* ParseVariableDeclarationList();
484 AstNode* ParseFunctionStatement(bool is_literal); 486 AstNode* ParseFunctionStatement(bool is_literal);
485 AstNode* ParseStatement(); 487 AstNode* ParseStatement();
486 SequenceNode* ParseNestedStatement(bool parsing_loop_body, 488 SequenceNode* ParseNestedStatement(bool parsing_loop_body,
487 SourceLabel* label); 489 SourceLabel* label);
488 void ParseStatementSequence(); 490 void ParseStatementSequence();
489 bool IsIdentifier(); 491 bool IsIdentifier();
490 bool IsSimpleLiteral(const AbstractType& type, Instance* value); 492 bool IsSimpleLiteral(const AbstractType& type, Instance* value);
491 bool IsFunctionTypeAliasName(); 493 bool IsFunctionTypeAliasName();
494 bool IsMixinTypedef();
492 bool TryParseTypeParameter(); 495 bool TryParseTypeParameter();
493 bool TryParseOptionalType(); 496 bool TryParseOptionalType();
494 bool TryParseReturnType(); 497 bool TryParseReturnType();
495 bool IsVariableDeclaration(); 498 bool IsVariableDeclaration();
496 bool IsFunctionDeclaration(); 499 bool IsFunctionDeclaration();
497 bool IsFunctionLiteral(); 500 bool IsFunctionLiteral();
498 bool IsForInStatement(); 501 bool IsForInStatement();
499 bool IsTopLevelAccessor(); 502 bool IsTopLevelAccessor();
500 503
501 AstNode* ParseBinaryExpr(int min_preced); 504 AstNode* ParseBinaryExpr(int min_preced);
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 ParsedFunction* parsed_function_; 654 ParsedFunction* parsed_function_;
652 655
653 // The function currently being parsed. 656 // The function currently being parsed.
654 Function& innermost_function_; 657 Function& innermost_function_;
655 658
656 // The class currently being parsed, or the owner class of the 659 // The class currently being parsed, or the owner class of the
657 // function currently being parsed. It is used for primary identifier lookups. 660 // function currently being parsed. It is used for primary identifier lookups.
658 Class& current_class_; 661 Class& current_class_;
659 662
660 // The current library (and thus class dictionary) used to resolve names. 663 // The current library (and thus class dictionary) used to resolve names.
664 // When parsing a function, this is the library in which the function
665 // is defined. This can be the library in which the current_class_ is
666 // defined, or the library of a mixin class where the function originates.
661 const Library& library_; 667 const Library& library_;
662 668
663 // List of try blocks seen so far, this is used to generate inlined finally 669 // List of try blocks seen so far, this is used to generate inlined finally
664 // code at all points in the try block where an exit from the block is 670 // code at all points in the try block where an exit from the block is
665 // done using 'return', 'break' or 'continue' statements. 671 // done using 'return', 'break' or 'continue' statements.
666 TryBlocks* try_blocks_list_; 672 TryBlocks* try_blocks_list_;
667 673
668 DISALLOW_COPY_AND_ASSIGN(Parser); 674 DISALLOW_COPY_AND_ASSIGN(Parser);
669 }; 675 };
670 676
671 } // namespace dart 677 } // namespace dart
672 678
673 #endif // VM_PARSER_H_ 679 #endif // VM_PARSER_H_
OLDNEW
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698