OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 | 418 |
419 // Return types for traversing functions. | 419 // Return types for traversing functions. |
420 typedef Handle<String> Identifier; | 420 typedef Handle<String> Identifier; |
421 typedef v8::internal::Expression* Expression; | 421 typedef v8::internal::Expression* Expression; |
422 typedef Yield* YieldExpression; | 422 typedef Yield* YieldExpression; |
423 typedef v8::internal::FunctionLiteral* FunctionLiteral; | 423 typedef v8::internal::FunctionLiteral* FunctionLiteral; |
424 typedef v8::internal::Literal* Literal; | 424 typedef v8::internal::Literal* Literal; |
425 typedef ObjectLiteral::Property* ObjectLiteralProperty; | 425 typedef ObjectLiteral::Property* ObjectLiteralProperty; |
426 typedef ZoneList<v8::internal::Expression*>* ExpressionList; | 426 typedef ZoneList<v8::internal::Expression*>* ExpressionList; |
427 typedef ZoneList<ObjectLiteral::Property*>* PropertyList; | 427 typedef ZoneList<ObjectLiteral::Property*>* PropertyList; |
| 428 typedef ZoneList<v8::internal::Statement*>* StatementList; |
428 | 429 |
429 // For constructing objects returned by the traversing functions. | 430 // For constructing objects returned by the traversing functions. |
430 typedef AstNodeFactory<AstConstructionVisitor> Factory; | 431 typedef AstNodeFactory<AstConstructionVisitor> Factory; |
431 }; | 432 }; |
432 | 433 |
433 explicit ParserTraits(Parser* parser) : parser_(parser) {} | 434 explicit ParserTraits(Parser* parser) : parser_(parser) {} |
434 | 435 |
435 // Custom operations executed when FunctionStates are created and destructed. | 436 // Custom operations executed when FunctionStates are created and destructed. |
436 template<typename FunctionState> | 437 template<typename FunctionState> |
437 static void SetUpFunctionState(FunctionState* function_state, Zone* zone) { | 438 static void SetUpFunctionState(FunctionState* function_state, Zone* zone) { |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
585 AstNodeFactory<AstConstructionVisitor>* factory); | 586 AstNodeFactory<AstConstructionVisitor>* factory); |
586 Expression* ExpressionFromString( | 587 Expression* ExpressionFromString( |
587 int pos, Scanner* scanner, | 588 int pos, Scanner* scanner, |
588 AstNodeFactory<AstConstructionVisitor>* factory); | 589 AstNodeFactory<AstConstructionVisitor>* factory); |
589 ZoneList<v8::internal::Expression*>* NewExpressionList(int size, Zone* zone) { | 590 ZoneList<v8::internal::Expression*>* NewExpressionList(int size, Zone* zone) { |
590 return new(zone) ZoneList<v8::internal::Expression*>(size, zone); | 591 return new(zone) ZoneList<v8::internal::Expression*>(size, zone); |
591 } | 592 } |
592 ZoneList<ObjectLiteral::Property*>* NewPropertyList(int size, Zone* zone) { | 593 ZoneList<ObjectLiteral::Property*>* NewPropertyList(int size, Zone* zone) { |
593 return new(zone) ZoneList<ObjectLiteral::Property*>(size, zone); | 594 return new(zone) ZoneList<ObjectLiteral::Property*>(size, zone); |
594 } | 595 } |
| 596 ZoneList<v8::internal::Statement*>* NewStatementList(int size, Zone* zone) { |
| 597 return new(zone) ZoneList<v8::internal::Statement*>(size, zone); |
| 598 } |
595 | 599 |
596 // Temporary glue; these functions will move to ParserBase. | 600 // Temporary glue; these functions will move to ParserBase. |
597 Expression* ParseV8Intrinsic(bool* ok); | 601 Expression* ParseV8Intrinsic(bool* ok); |
598 FunctionLiteral* ParseFunctionLiteral( | 602 FunctionLiteral* ParseFunctionLiteral( |
599 Handle<String> name, | 603 Handle<String> name, |
600 Scanner::Location function_name_location, | 604 Scanner::Location function_name_location, |
601 bool name_is_strict_reserved, | 605 bool name_is_strict_reserved, |
602 bool is_generator, | 606 bool is_generator, |
603 int function_token_position, | 607 int function_token_position, |
604 FunctionLiteral::FunctionType type, | 608 FunctionLiteral::FunctionType type, |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
847 private: | 851 private: |
848 static const int kLiteralTypeSlot = 0; | 852 static const int kLiteralTypeSlot = 0; |
849 static const int kElementsSlot = 1; | 853 static const int kElementsSlot = 1; |
850 | 854 |
851 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); | 855 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); |
852 }; | 856 }; |
853 | 857 |
854 } } // namespace v8::internal | 858 } } // namespace v8::internal |
855 | 859 |
856 #endif // V8_PARSER_H_ | 860 #endif // V8_PARSER_H_ |
OLD | NEW |