| 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 #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 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 bool IsVariableDeclaration(); | 407 bool IsVariableDeclaration(); |
| 408 bool IsFunctionDeclaration(); | 408 bool IsFunctionDeclaration(); |
| 409 bool IsFunctionLiteral(); | 409 bool IsFunctionLiteral(); |
| 410 bool IsForInStatement(); | 410 bool IsForInStatement(); |
| 411 bool IsTopLevelAccessor(); | 411 bool IsTopLevelAccessor(); |
| 412 | 412 |
| 413 AstNode* ParseBinaryExpr(int min_preced); | 413 AstNode* ParseBinaryExpr(int min_preced); |
| 414 LiteralNode* ParseConstExpr(); | 414 LiteralNode* ParseConstExpr(); |
| 415 static const bool kRequireConst = true; | 415 static const bool kRequireConst = true; |
| 416 static const bool kAllowConst = false; | 416 static const bool kAllowConst = false; |
| 417 AstNode* ParseExpr(bool require_compiletime_const); | 417 static const bool kConsumeCascades = true; |
| 418 static const bool kNoCascades = false; |
| 419 AstNode* ParseExpr(bool require_compiletime_const, bool consume_cascades); |
| 418 AstNode* ParseExprList(); | 420 AstNode* ParseExprList(); |
| 419 AstNode* ParseConditionalExpr(); | 421 AstNode* ParseConditionalExpr(); |
| 420 AstNode* ParseUnaryExpr(); | 422 AstNode* ParseUnaryExpr(); |
| 421 AstNode* ParsePostfixExpr(); | 423 AstNode* ParsePostfixExpr(); |
| 424 AstNode* ParseSelectors(AstNode* primary, bool is_cascade); |
| 425 AstNode* ParseCascades(AstNode* expr); |
| 422 AstNode* ParsePrimary(); | 426 AstNode* ParsePrimary(); |
| 423 AstNode* ParseStringLiteral(); | 427 AstNode* ParseStringLiteral(); |
| 424 String* ParseImportStringLiteral(); | 428 String* ParseImportStringLiteral(); |
| 425 AstNode* ParseCompoundLiteral(); | 429 AstNode* ParseCompoundLiteral(); |
| 426 AstNode* ParseListLiteral(intptr_t type_pos, | 430 AstNode* ParseListLiteral(intptr_t type_pos, |
| 427 bool is_const, | 431 bool is_const, |
| 428 const AbstractTypeArguments& type_arguments); | 432 const AbstractTypeArguments& type_arguments); |
| 429 AstNode* ParseMapLiteral(intptr_t type_pos, | 433 AstNode* ParseMapLiteral(intptr_t type_pos, |
| 430 bool is_const, | 434 bool is_const, |
| 431 const AbstractTypeArguments& type_arguments); | 435 const AbstractTypeArguments& type_arguments); |
| 432 AstNode* ParseNewOperator(); | 436 AstNode* ParseNewOperator(); |
| 433 | 437 |
| 434 // An implicit argument, if non-null, is prepended to the returned list. | 438 // An implicit argument, if non-null, is prepended to the returned list. |
| 435 ArgumentListNode* ParseActualParameters(ArgumentListNode* implicit_arguments, | 439 ArgumentListNode* ParseActualParameters(ArgumentListNode* implicit_arguments, |
| 436 bool require_const); | 440 bool require_const); |
| 437 AstNode* ParseStaticCall(const Class& cls, | 441 AstNode* ParseStaticCall(const Class& cls, |
| 438 const String& method_name, | 442 const String& method_name, |
| 439 intptr_t ident_pos); | 443 intptr_t ident_pos); |
| 440 AstNode* ParseInstanceCall(AstNode* receiver, const String& method_name); | 444 AstNode* ParseInstanceCall(AstNode* receiver, const String& method_name); |
| 441 AstNode* ParseClosureCall(AstNode* closure); | 445 AstNode* ParseClosureCall(AstNode* closure); |
| 442 AstNode* ParseInstanceFieldAccess(AstNode* receiver, | 446 AstNode* ParseInstanceFieldAccess(AstNode* receiver, |
| 443 const String& field_name); | 447 const String& field_name, |
| 448 bool consume_cascades); |
| 444 AstNode* GenerateStaticFieldLookup(const Field& field, | 449 AstNode* GenerateStaticFieldLookup(const Field& field, |
| 445 intptr_t ident_pos); | 450 intptr_t ident_pos); |
| 446 AstNode* ParseStaticFieldAccess(const Class& cls, | 451 AstNode* ParseStaticFieldAccess(const Class& cls, |
| 447 const String& field_name, | 452 const String& field_name, |
| 448 intptr_t ident_pos); | 453 intptr_t ident_pos, |
| 454 bool consume_cascades); |
| 449 | 455 |
| 450 LocalVariable* LookupLocalScope(const String& ident); | 456 LocalVariable* LookupLocalScope(const String& ident); |
| 451 void CheckInstanceFieldAccess(intptr_t field_pos, const String& field_name); | 457 void CheckInstanceFieldAccess(intptr_t field_pos, const String& field_name); |
| 452 RawClass* TypeParametersScopeClass(); | 458 RawClass* TypeParametersScopeClass(); |
| 453 bool IsInstantiatorRequired() const; | 459 bool IsInstantiatorRequired() const; |
| 454 bool IsDefinedInLexicalScope(const String& ident); | 460 bool IsDefinedInLexicalScope(const String& ident); |
| 455 bool ResolveIdentInLocalScope(intptr_t ident_pos, | 461 bool ResolveIdentInLocalScope(intptr_t ident_pos, |
| 456 const String &ident, | 462 const String &ident, |
| 457 AstNode** node); | 463 AstNode** node); |
| 458 static const bool kResolveLocally = true; | 464 static const bool kResolveLocally = true; |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 548 | 554 |
| 549 // Allocate temporary only once per function. | 555 // Allocate temporary only once per function. |
| 550 LocalVariable* expression_temp_; | 556 LocalVariable* expression_temp_; |
| 551 | 557 |
| 552 DISALLOW_COPY_AND_ASSIGN(Parser); | 558 DISALLOW_COPY_AND_ASSIGN(Parser); |
| 553 }; | 559 }; |
| 554 | 560 |
| 555 } // namespace dart | 561 } // namespace dart |
| 556 | 562 |
| 557 #endif // VM_PARSER_H_ | 563 #endif // VM_PARSER_H_ |
| OLD | NEW |