| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 void SkipPrimary(); | 160 void SkipPrimary(); |
| 161 void SkipCompoundLiteral(); | 161 void SkipCompoundLiteral(); |
| 162 void SkipNewOperator(); | 162 void SkipNewOperator(); |
| 163 void SkipActualParameters(); | 163 void SkipActualParameters(); |
| 164 void SkipMapLiteral(); | 164 void SkipMapLiteral(); |
| 165 void SkipListLiteral(); | 165 void SkipListLiteral(); |
| 166 void SkipFunctionLiteral(); | 166 void SkipFunctionLiteral(); |
| 167 void SkipStringLiteral(); | 167 void SkipStringLiteral(); |
| 168 | 168 |
| 169 void CheckConstructorCallTypeArguments( | 169 void CheckConstructorCallTypeArguments( |
| 170 intptr_t pos, Function& constructor, const TypeArguments& type_arguments); | 170 intptr_t pos, |
| 171 Function& constructor, |
| 172 const AbstractTypeArguments& type_arguments); |
| 171 | 173 |
| 172 // Reports error message at location of current token. | 174 // Reports error message at location of current token. |
| 173 void ErrorMsg(const char* msg, ...); | 175 void ErrorMsg(const char* msg, ...); |
| 174 void ErrorMsg(intptr_t token_index, const char* msg, ...); | 176 void ErrorMsg(intptr_t token_index, const char* msg, ...); |
| 175 void Warning(const char* msg, ...); | 177 void Warning(const char* msg, ...); |
| 176 void Warning(intptr_t token_index, const char* msg, ...); | 178 void Warning(intptr_t token_index, const char* msg, ...); |
| 177 void Unimplemented(const char* msg); | 179 void Unimplemented(const char* msg); |
| 178 | 180 |
| 179 const Instance& EvaluateConstExpr(AstNode* expr); | 181 const Instance& EvaluateConstExpr(AstNode* expr); |
| 180 void RunStaticFieldInitializer(const Field& field); | 182 void RunStaticFieldInitializer(const Field& field); |
| 181 RawInstance* EvaluateConstConstructorCall(const Class& type_class, | 183 RawInstance* EvaluateConstConstructorCall( |
| 182 const TypeArguments& type_arguments, | 184 const Class& type_class, |
| 183 const Function& constructor, | 185 const AbstractTypeArguments& type_arguments, |
| 184 ArgumentListNode* arguments); | 186 const Function& constructor, |
| 187 ArgumentListNode* arguments); |
| 185 AstNode* FoldConstExpr(intptr_t expr_pos, AstNode* expr); | 188 AstNode* FoldConstExpr(intptr_t expr_pos, AstNode* expr); |
| 186 | 189 |
| 187 // Support for parsing of scripts. | 190 // Support for parsing of scripts. |
| 188 void ParseTopLevel(); | 191 void ParseTopLevel(); |
| 189 void ParseClassDefinition(GrowableArray<const Class*>* classes); | 192 void ParseClassDefinition(GrowableArray<const Class*>* classes); |
| 190 void ParseInterfaceDefinition(GrowableArray<const Class*>* classes); | 193 void ParseInterfaceDefinition(GrowableArray<const Class*>* classes); |
| 191 void ParseFunctionTypeAlias(GrowableArray<const Class*>* classes); | 194 void ParseFunctionTypeAlias(GrowableArray<const Class*>* classes); |
| 192 void ParseTopLevelVariable(TopLevel* top_level); | 195 void ParseTopLevelVariable(TopLevel* top_level); |
| 193 void ParseTopLevelFunction(TopLevel* top_level); | 196 void ParseTopLevelFunction(TopLevel* top_level); |
| 194 void ParseTopLevelAccessor(TopLevel* top_level); | 197 void ParseTopLevelAccessor(TopLevel* top_level); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 205 void TryResolveTypeFromClass(intptr_t type_pos, | 208 void TryResolveTypeFromClass(intptr_t type_pos, |
| 206 const Class& cls, | 209 const Class& cls, |
| 207 AbstractType* type); | 210 AbstractType* type); |
| 208 enum TypeResolution { | 211 enum TypeResolution { |
| 209 kDoNotResolve, // Type resolution is postponed. | 212 kDoNotResolve, // Type resolution is postponed. |
| 210 kCanResolve, // Type resolution is optional. | 213 kCanResolve, // Type resolution is optional. |
| 211 kMustResolve // Type resolution is required. | 214 kMustResolve // Type resolution is required. |
| 212 }; | 215 }; |
| 213 RawAbstractType* ParseType(TypeResolution type_resolution); | 216 RawAbstractType* ParseType(TypeResolution type_resolution); |
| 214 void ParseTypeParameters(const Class& cls); | 217 void ParseTypeParameters(const Class& cls); |
| 215 RawTypeArguments* ParseTypeArguments(TypeResolution type_resolution); | 218 RawAbstractTypeArguments* ParseTypeArguments(TypeResolution type_resolution); |
| 216 void ParseQualIdent(QualIdent* qual_ident); | 219 void ParseQualIdent(QualIdent* qual_ident); |
| 217 void ParseMethodOrConstructor(ClassDesc* members, MemberDesc* method); | 220 void ParseMethodOrConstructor(ClassDesc* members, MemberDesc* method); |
| 218 void ParseFieldDefinition(ClassDesc* members, MemberDesc* field); | 221 void ParseFieldDefinition(ClassDesc* members, MemberDesc* field); |
| 219 void ParseClassMemberDefinition(ClassDesc* members); | 222 void ParseClassMemberDefinition(ClassDesc* members); |
| 220 void ParseFormalParameter(bool allow_explicit_default_value, | 223 void ParseFormalParameter(bool allow_explicit_default_value, |
| 221 ParamList* params); | 224 ParamList* params); |
| 222 void ParseFormalParameters(bool allow_explicit_default_values, | 225 void ParseFormalParameters(bool allow_explicit_default_values, |
| 223 ParamList* params); | 226 ParamList* params); |
| 224 void ParseFormalParameterList(bool allow_explicit_default_values, | 227 void ParseFormalParameterList(bool allow_explicit_default_values, |
| 225 ParamList* params); | 228 ParamList* params); |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 AstNode* ParseExpr(bool require_compiletime_const); | 342 AstNode* ParseExpr(bool require_compiletime_const); |
| 340 AstNode* ParseExprList(); | 343 AstNode* ParseExprList(); |
| 341 AstNode* ParseConditionalExpr(); | 344 AstNode* ParseConditionalExpr(); |
| 342 AstNode* ParseUnaryExpr(); | 345 AstNode* ParseUnaryExpr(); |
| 343 AstNode* ParsePostfixExpr(); | 346 AstNode* ParsePostfixExpr(); |
| 344 AstNode* ParsePrimary(); | 347 AstNode* ParsePrimary(); |
| 345 AstNode* ParseStringLiteral(); | 348 AstNode* ParseStringLiteral(); |
| 346 AstNode* ParseCompoundLiteral(); | 349 AstNode* ParseCompoundLiteral(); |
| 347 AstNode* ParseListLiteral(intptr_t type_pos, | 350 AstNode* ParseListLiteral(intptr_t type_pos, |
| 348 bool is_const, | 351 bool is_const, |
| 349 const TypeArguments& type_arguments); | 352 const AbstractTypeArguments& type_arguments); |
| 350 AstNode* ParseMapLiteral(intptr_t type_pos, | 353 AstNode* ParseMapLiteral(intptr_t type_pos, |
| 351 bool is_const, | 354 bool is_const, |
| 352 const TypeArguments& type_arguments); | 355 const AbstractTypeArguments& type_arguments); |
| 353 AstNode* ParseNewOperator(); | 356 AstNode* ParseNewOperator(); |
| 354 | 357 |
| 355 // An implicit argument, if non-null, is prepended to the returned list. | 358 // An implicit argument, if non-null, is prepended to the returned list. |
| 356 ArgumentListNode* ParseActualParameters(ArgumentListNode* implicit_arguments, | 359 ArgumentListNode* ParseActualParameters(ArgumentListNode* implicit_arguments, |
| 357 bool require_const); | 360 bool require_const); |
| 358 AstNode* ParseStaticCall(const Class& cls, | 361 AstNode* ParseStaticCall(const Class& cls, |
| 359 const String& method_name, | 362 const String& method_name, |
| 360 intptr_t ident_pos); | 363 intptr_t ident_pos); |
| 361 AstNode* ParseInstanceCall(AstNode* receiver, const String& method_name); | 364 AstNode* ParseInstanceCall(AstNode* receiver, const String& method_name); |
| 362 AstNode* ParseClosureCall(AstNode* closure); | 365 AstNode* ParseClosureCall(AstNode* closure); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 // code at all points in the try block where an exit from the block is | 449 // code at all points in the try block where an exit from the block is |
| 447 // done using 'return', 'break' or 'continue' statements. | 450 // done using 'return', 'break' or 'continue' statements. |
| 448 TryBlocks* try_blocks_list_; | 451 TryBlocks* try_blocks_list_; |
| 449 | 452 |
| 450 DISALLOW_COPY_AND_ASSIGN(Parser); | 453 DISALLOW_COPY_AND_ASSIGN(Parser); |
| 451 }; | 454 }; |
| 452 | 455 |
| 453 } // namespace dart | 456 } // namespace dart |
| 454 | 457 |
| 455 #endif // VM_PARSER_H_ | 458 #endif // VM_PARSER_H_ |
| OLD | NEW |