OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_PARSING_PARSER_H_ | 5 #ifndef V8_PARSING_PARSER_H_ |
6 #define V8_PARSING_PARSER_H_ | 6 #define V8_PARSING_PARSER_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/ast/ast.h" | 9 #include "src/ast/ast.h" |
10 #include "src/ast/scopes.h" | 10 #include "src/ast/scopes.h" |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 typedef v8::internal::Literal* Literal; | 347 typedef v8::internal::Literal* Literal; |
348 typedef ObjectLiteral::Property* ObjectLiteralProperty; | 348 typedef ObjectLiteral::Property* ObjectLiteralProperty; |
349 typedef ZoneList<v8::internal::Expression*>* ExpressionList; | 349 typedef ZoneList<v8::internal::Expression*>* ExpressionList; |
350 typedef ZoneList<ObjectLiteral::Property*>* PropertyList; | 350 typedef ZoneList<ObjectLiteral::Property*>* PropertyList; |
351 typedef ParserFormalParameters::Parameter FormalParameter; | 351 typedef ParserFormalParameters::Parameter FormalParameter; |
352 typedef ParserFormalParameters FormalParameters; | 352 typedef ParserFormalParameters FormalParameters; |
353 typedef ZoneList<v8::internal::Statement*>* StatementList; | 353 typedef ZoneList<v8::internal::Statement*>* StatementList; |
354 | 354 |
355 struct TypeSystem { | 355 struct TypeSystem { |
356 typedef v8::internal::typesystem::Type* Type; | 356 typedef v8::internal::typesystem::Type* Type; |
357 typedef ZoneList<v8::internal::typesystem::Type*>* TypeArguments; | 357 typedef ZoneList<v8::internal::typesystem::Type*>* TypeList; |
358 typedef v8::internal::typesystem::TypeParameter* TypeParameter; | 358 typedef v8::internal::typesystem::TypeParameter* TypeParameter; |
359 typedef ZoneList<v8::internal::typesystem::TypeParameter*>* | 359 typedef ZoneList<v8::internal::typesystem::TypeParameter*>* |
360 TypeParameters; | 360 TypeParameters; |
361 typedef v8::internal::typesystem::FormalParameter* FormalParameter; | 361 typedef v8::internal::typesystem::FormalParameter* FormalParameter; |
362 typedef ZoneList<v8::internal::typesystem::FormalParameter*>* | 362 typedef ZoneList<v8::internal::typesystem::FormalParameter*>* |
363 FormalParameters; | 363 FormalParameters; |
364 }; | 364 }; |
365 | 365 |
366 // For constructing objects returned by the traversing functions. | 366 // For constructing objects returned by the traversing functions. |
367 typedef AstNodeFactory Factory; | 367 typedef AstNodeFactory Factory; |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 } | 492 } |
493 static Expression* EmptyExpression() { | 493 static Expression* EmptyExpression() { |
494 return NULL; | 494 return NULL; |
495 } | 495 } |
496 static Literal* EmptyLiteral() { | 496 static Literal* EmptyLiteral() { |
497 return NULL; | 497 return NULL; |
498 } | 498 } |
499 static ObjectLiteralProperty* EmptyObjectLiteralProperty() { return NULL; } | 499 static ObjectLiteralProperty* EmptyObjectLiteralProperty() { return NULL; } |
500 static FunctionLiteral* EmptyFunctionLiteral() { return NULL; } | 500 static FunctionLiteral* EmptyFunctionLiteral() { return NULL; } |
501 | 501 |
502 static typesystem::Type* EmptyType() { return NULL; } | 502 static typesystem::Type* EmptyType() { return nullptr; } |
503 static ZoneList<typesystem::Type*>* NullTypeArguments() { return nullptr; } | 503 static ZoneList<typesystem::Type*>* NullTypeList() { return nullptr; } |
504 V8_INLINE ZoneList<typesystem::Type*>* EmptyTypeArguments() const; | 504 V8_INLINE ZoneList<typesystem::Type*>* EmptyTypeList() const; |
505 static ZoneList<typesystem::TypeParameter*>* NullTypeParameters() { | 505 static ZoneList<typesystem::TypeParameter*>* NullTypeParameters() { |
506 return nullptr; | 506 return nullptr; |
507 } | 507 } |
508 static bool IsNullTypeParameters( | 508 static bool IsNullTypeParameters( |
509 ZoneList<typesystem::TypeParameter*>* typ_pars) { | 509 ZoneList<typesystem::TypeParameter*>* typ_pars) { |
510 return typ_pars == nullptr; | 510 return typ_pars == nullptr; |
511 } | 511 } |
512 V8_INLINE ZoneList<typesystem::TypeParameter*>* EmptyTypeParameters() const; | 512 V8_INLINE ZoneList<typesystem::TypeParameter*>* EmptyTypeParameters() const; |
513 V8_INLINE ZoneList<typesystem::FormalParameter*>* EmptyFormalParameters() | 513 V8_INLINE ZoneList<typesystem::FormalParameter*>* EmptyFormalParameters() |
514 const; | 514 const; |
515 static ZoneList<const AstRawString*>* NullIdentifierList() { return nullptr; } | 515 static ZoneList<const AstRawString*>* NullIdentifierList() { return nullptr; } |
516 V8_INLINE ZoneList<const AstRawString*>* EmptyIdentifierList() const; | 516 V8_INLINE ZoneList<const AstRawString*>* EmptyIdentifierList() const; |
| 517 static typesystem::Type* HoleTypeElement() { return nullptr; } |
517 | 518 |
518 // Used in error return values. | 519 // Used in error return values. |
519 static ZoneList<Expression*>* NullExpressionList() { | 520 static ZoneList<Expression*>* NullExpressionList() { |
520 return NULL; | 521 return NULL; |
521 } | 522 } |
522 static const AstRawString* EmptyFormalParameter() { return NULL; } | 523 static const AstRawString* EmptyFormalParameter() { return NULL; } |
523 | 524 |
524 // Non-NULL empty string. | 525 // Non-NULL empty string. |
525 V8_INLINE const AstRawString* EmptyIdentifierString(); | 526 V8_INLINE const AstRawString* EmptyIdentifierString(); |
526 | 527 |
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1105 return parser_->scanner()->IdentifierIsFutureStrictReserved(identifier); | 1106 return parser_->scanner()->IdentifierIsFutureStrictReserved(identifier); |
1106 } | 1107 } |
1107 | 1108 |
1108 | 1109 |
1109 Scope* ParserTraits::NewScope(Scope* parent_scope, ScopeType scope_type, | 1110 Scope* ParserTraits::NewScope(Scope* parent_scope, ScopeType scope_type, |
1110 FunctionKind kind) { | 1111 FunctionKind kind) { |
1111 return parser_->NewScope(parent_scope, scope_type, kind); | 1112 return parser_->NewScope(parent_scope, scope_type, kind); |
1112 } | 1113 } |
1113 | 1114 |
1114 | 1115 |
1115 ZoneList<typesystem::Type*>* ParserTraits::EmptyTypeArguments() const { | 1116 ZoneList<typesystem::Type*>* ParserTraits::EmptyTypeList() const { |
1116 return new (parser_->zone()) ZoneList<typesystem::Type*>(1, parser_->zone()); | 1117 return new (parser_->zone()) ZoneList<typesystem::Type*>(1, parser_->zone()); |
1117 } | 1118 } |
1118 | 1119 |
1119 | 1120 |
1120 ZoneList<typesystem::TypeParameter*>* ParserTraits::EmptyTypeParameters() | 1121 ZoneList<typesystem::TypeParameter*>* ParserTraits::EmptyTypeParameters() |
1121 const { | 1122 const { |
1122 return new (parser_->zone()) | 1123 return new (parser_->zone()) |
1123 ZoneList<typesystem::TypeParameter*>(1, parser_->zone()); | 1124 ZoneList<typesystem::TypeParameter*>(1, parser_->zone()); |
1124 } | 1125 } |
1125 | 1126 |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1292 | 1293 |
1293 DoExpression* ParserTraits::ParseDoExpression(bool* ok) { | 1294 DoExpression* ParserTraits::ParseDoExpression(bool* ok) { |
1294 return parser_->ParseDoExpression(ok); | 1295 return parser_->ParseDoExpression(ok); |
1295 } | 1296 } |
1296 | 1297 |
1297 | 1298 |
1298 } // namespace internal | 1299 } // namespace internal |
1299 } // namespace v8 | 1300 } // namespace v8 |
1300 | 1301 |
1301 #endif // V8_PARSING_PARSER_H_ | 1302 #endif // V8_PARSING_PARSER_H_ |
OLD | NEW |