| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 bool IsValid() const { | 47 bool IsValid() const { |
| 48 return beg_pos >= 0 && end_pos >= beg_pos; | 48 return beg_pos >= 0 && end_pos >= beg_pos; |
| 49 } | 49 } |
| 50 | 50 |
| 51 static Location invalid() { return Location(-1, -1); } | 51 static Location invalid() { return Location(-1, -1); } |
| 52 | 52 |
| 53 int beg_pos; | 53 int beg_pos; |
| 54 int end_pos; | 54 int end_pos; |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 ExperimentalScanner(const char* fname, bool read_all_at_once); | 57 ExperimentalScanner(const char* fname, |
| 58 bool read_all_at_once, |
| 59 Isolate* isolate); |
| 58 ~ExperimentalScanner(); | 60 ~ExperimentalScanner(); |
| 59 | 61 |
| 60 Token::Value Next(); | 62 Token::Value Next(); |
| 61 Token::Value current_token(); | 63 Token::Value current_token(); |
| 62 Location location(); | 64 Location location(); |
| 63 | 65 |
| 64 void Record(v8::internal::Token::Value token, int beg_pos, int end_pos); | 66 void Record(v8::internal::Token::Value token, int beg_pos, int end_pos); |
| 65 | 67 |
| 66 private: | 68 private: |
| 67 void FillTokens(); | 69 void FillTokens(); |
| 68 static const int BUFFER_SIZE = 256; | 70 static const int BUFFER_SIZE = 256; |
| 69 std::vector<v8::internal::Token::Value> token_; | 71 std::vector<v8::internal::Token::Value> token_; |
| 70 std::vector<int> beg_; | 72 std::vector<int> beg_; |
| 71 std::vector<int> end_; | 73 std::vector<int> end_; |
| 72 size_t current_; | 74 size_t current_; |
| 73 size_t fetched_; | 75 size_t fetched_; |
| 74 FILE* file_; | 76 FILE* file_; |
| 75 PushScanner* scanner_; | 77 PushScanner* scanner_; |
| 76 bool read_all_at_once_; | 78 bool read_all_at_once_; |
| 77 const v8::internal::byte* source_; | 79 const v8::internal::byte* source_; |
| 78 int length_; | 80 int length_; |
| 79 }; | 81 }; |
| 80 | 82 |
| 81 } } // namespace v8::internal | 83 } } // namespace v8::internal |
| 82 | 84 |
| 83 #endif | 85 #endif |
| OLD | NEW |