| 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 "platform/assert.h" | 10 #include "platform/assert.h" |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 Token::Kind CurrentToken() { | 251 Token::Kind CurrentToken() { |
| 252 if (token_kind_ == Token::kILLEGAL) { | 252 if (token_kind_ == Token::kILLEGAL) { |
| 253 ComputeCurrentToken(); | 253 ComputeCurrentToken(); |
| 254 } | 254 } |
| 255 CompilerStats::num_token_checks++; | 255 CompilerStats::num_token_checks++; |
| 256 return token_kind_; | 256 return token_kind_; |
| 257 } | 257 } |
| 258 | 258 |
| 259 void ComputeCurrentToken(); | 259 void ComputeCurrentToken(); |
| 260 | 260 |
| 261 RawLibraryPrefix* ParsePrefix(); |
| 262 |
| 261 Token::Kind LookaheadToken(int num_tokens); | 263 Token::Kind LookaheadToken(int num_tokens); |
| 262 String* CurrentLiteral() const; | 264 String* CurrentLiteral() const; |
| 263 RawDouble* CurrentDoubleLiteral() const; | 265 RawDouble* CurrentDoubleLiteral() const; |
| 264 RawInteger* CurrentIntegerLiteral() const; | 266 RawInteger* CurrentIntegerLiteral() const; |
| 265 | 267 |
| 266 // Sets parser to given token position in the stream. | 268 // Sets parser to given token position in the stream. |
| 267 void SetPosition(intptr_t position); | 269 void SetPosition(intptr_t position); |
| 268 | 270 |
| 269 void ConsumeToken() { | 271 void ConsumeToken() { |
| 270 // Reset cache and advance the token. | 272 // Reset cache and advance the token. |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 void ParseLibraryPart(); | 374 void ParseLibraryPart(); |
| 373 void ParsePartHeader(); | 375 void ParsePartHeader(); |
| 374 void ParseLibraryNameObsoleteSyntax(); | 376 void ParseLibraryNameObsoleteSyntax(); |
| 375 void ParseLibraryImportObsoleteSyntax(); | 377 void ParseLibraryImportObsoleteSyntax(); |
| 376 void ParseLibraryIncludeObsoleteSyntax(); | 378 void ParseLibraryIncludeObsoleteSyntax(); |
| 377 | 379 |
| 378 void ResolveTypeFromClass(const Class& cls, | 380 void ResolveTypeFromClass(const Class& cls, |
| 379 ClassFinalizer::FinalizationKind finalization, | 381 ClassFinalizer::FinalizationKind finalization, |
| 380 AbstractType* type); | 382 AbstractType* type); |
| 381 RawAbstractType* ParseType(ClassFinalizer::FinalizationKind finalization, | 383 RawAbstractType* ParseType(ClassFinalizer::FinalizationKind finalization, |
| 382 bool allow_deferred_type = false); | 384 bool allow_deferred_type = false, |
| 385 bool consume_unresolved_prefix = true); |
| 383 void ParseTypeParameters(const Class& cls); | 386 void ParseTypeParameters(const Class& cls); |
| 384 RawTypeArguments* ParseTypeArguments( | 387 RawTypeArguments* ParseTypeArguments( |
| 385 ClassFinalizer::FinalizationKind finalization); | 388 ClassFinalizer::FinalizationKind finalization); |
| 386 void ParseQualIdent(QualIdent* qual_ident); | |
| 387 void ParseMethodOrConstructor(ClassDesc* members, MemberDesc* method); | 389 void ParseMethodOrConstructor(ClassDesc* members, MemberDesc* method); |
| 388 void ParseFieldDefinition(ClassDesc* members, MemberDesc* field); | 390 void ParseFieldDefinition(ClassDesc* members, MemberDesc* field); |
| 389 void CheckMemberNameConflict(ClassDesc* members, MemberDesc* member); | 391 void CheckMemberNameConflict(ClassDesc* members, MemberDesc* member); |
| 390 void ParseClassMemberDefinition(ClassDesc* members, | 392 void ParseClassMemberDefinition(ClassDesc* members, |
| 391 intptr_t metadata_pos); | 393 intptr_t metadata_pos); |
| 392 void ParseFormalParameter(bool allow_explicit_default_value, | 394 void ParseFormalParameter(bool allow_explicit_default_value, |
| 393 bool evaluate_metadata, | 395 bool evaluate_metadata, |
| 394 ParamList* params); | 396 ParamList* params); |
| 395 void ParseFormalParameters(bool allow_explicit_default_values, | 397 void ParseFormalParameters(bool allow_explicit_default_values, |
| 396 bool evaluate_metadata, | 398 bool evaluate_metadata, |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 AstNode* ParseVariableDeclarationList(); | 539 AstNode* ParseVariableDeclarationList(); |
| 538 AstNode* ParseFunctionStatement(bool is_literal); | 540 AstNode* ParseFunctionStatement(bool is_literal); |
| 539 AstNode* ParseStatement(); | 541 AstNode* ParseStatement(); |
| 540 SequenceNode* ParseNestedStatement(bool parsing_loop_body, | 542 SequenceNode* ParseNestedStatement(bool parsing_loop_body, |
| 541 SourceLabel* label); | 543 SourceLabel* label); |
| 542 void ParseStatementSequence(); | 544 void ParseStatementSequence(); |
| 543 bool IsIdentifier(); | 545 bool IsIdentifier(); |
| 544 bool IsSimpleLiteral(const AbstractType& type, Instance* value); | 546 bool IsSimpleLiteral(const AbstractType& type, Instance* value); |
| 545 bool IsFunctionTypeAliasName(); | 547 bool IsFunctionTypeAliasName(); |
| 546 bool IsMixinAppAlias(); | 548 bool IsMixinAppAlias(); |
| 549 bool TryParseQualIdent(); |
| 547 bool TryParseTypeParameters(); | 550 bool TryParseTypeParameters(); |
| 548 bool TryParseOptionalType(); | 551 bool TryParseOptionalType(); |
| 549 bool TryParseReturnType(); | 552 bool TryParseReturnType(); |
| 550 bool IsVariableDeclaration(); | 553 bool IsVariableDeclaration(); |
| 551 bool IsFunctionDeclaration(); | 554 bool IsFunctionDeclaration(); |
| 552 bool IsFunctionLiteral(); | 555 bool IsFunctionLiteral(); |
| 553 bool IsForInStatement(); | 556 bool IsForInStatement(); |
| 554 bool IsTopLevelAccessor(); | 557 bool IsTopLevelAccessor(); |
| 555 | 558 |
| 556 AstNode* ParseBinaryExpr(int min_preced); | 559 AstNode* ParseBinaryExpr(int min_preced); |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 728 intptr_t last_used_try_index_; | 731 intptr_t last_used_try_index_; |
| 729 | 732 |
| 730 bool unregister_pending_function_; | 733 bool unregister_pending_function_; |
| 731 | 734 |
| 732 DISALLOW_COPY_AND_ASSIGN(Parser); | 735 DISALLOW_COPY_AND_ASSIGN(Parser); |
| 733 }; | 736 }; |
| 734 | 737 |
| 735 } // namespace dart | 738 } // namespace dart |
| 736 | 739 |
| 737 #endif // VM_PARSER_H_ | 740 #endif // VM_PARSER_H_ |
| OLD | NEW |