| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 int end_pos; | 55 int end_pos; |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 struct SavedToken { | 58 struct SavedToken { |
| 59 int beg, end; | 59 int beg, end; |
| 60 Token::Value value; | 60 Token::Value value; |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 ExperimentalScanner(const char* fname, | 63 ExperimentalScanner(const char* fname, |
| 64 bool read_all_at_once, | 64 bool read_all_at_once, |
| 65 Isolate* isolate); | 65 Isolate* isolate, |
| 66 int repeat); |
| 66 ~ExperimentalScanner(); | 67 ~ExperimentalScanner(); |
| 67 | 68 |
| 68 Token::Value Next(); | 69 Token::Value Next(); |
| 69 Token::Value current_token(); | 70 Token::Value current_token(); |
| 70 Location location(); | 71 Location location(); |
| 71 | 72 |
| 72 void Record(v8::internal::Token::Value token, int beg_pos, int end_pos); | 73 void Record(v8::internal::Token::Value token, int beg_pos, int end_pos); |
| 73 | 74 |
| 74 private: | 75 private: |
| 75 void FillTokens(); | 76 void FillTokens(); |
| 76 static const int BUFFER_SIZE = 256; | 77 static const int BUFFER_SIZE = 256; |
| 77 std::vector<SavedToken> token_; | 78 std::vector<SavedToken> token_; |
| 78 size_t current_; | 79 size_t current_; |
| 79 size_t fetched_; | 80 size_t fetched_; |
| 80 FILE* file_; | 81 FILE* file_; |
| 81 // python generated version | 82 // python generated version |
| 82 EvenMoreExperimentalScanner* scanner_; | 83 EvenMoreExperimentalScanner* scanner_; |
| 83 // re2c version | 84 // re2c version |
| 84 // PushScanner* scanner_; | 85 // PushScanner* scanner_; |
| 85 bool read_all_at_once_; | 86 bool read_all_at_once_; |
| 86 bool already_pushed_; | 87 bool already_pushed_; |
| 87 const v8::internal::byte* source_; | 88 const v8::internal::byte* source_; |
| 88 int length_; | 89 int length_; |
| 89 }; | 90 }; |
| 90 | 91 |
| 92 const byte* ReadFile(const char* name, Isolate* isolate, int* size, int repeat); |
| 93 |
| 91 } } // namespace v8::internal | 94 } } // namespace v8::internal |
| 92 | 95 |
| 93 #endif | 96 #endif |
| OLD | NEW |