| OLD | NEW |
| 1 // Portions of this code based on re2c: | 1 // Portions of this code based on re2c: |
| 2 // (re2c/examples/push.re) | 2 // (re2c/examples/push.re) |
| 3 // Copyright 2013 the V8 project authors. All rights reserved. | 3 // Copyright 2013 the V8 project authors. All rights reserved. |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
| 6 // met: | 6 // met: |
| 7 // | 7 // |
| 8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
| 9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
| 10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 #ifndef V8_LEXER_LEXER_H | 30 #ifndef V8_LEXER_LEXER_H |
| 31 #define V8_LEXER_LEXER_H | 31 #define V8_LEXER_LEXER_H |
| 32 | 32 |
| 33 #include "token.h" | 33 #include "token.h" |
| 34 #include "flags.h" | 34 #include "flags.h" |
| 35 | 35 |
| 36 namespace v8 { | 36 namespace v8 { |
| 37 namespace internal { | 37 namespace internal { |
| 38 | 38 |
| 39 class ExperimentalScanner; | 39 class ExperimentalScanner; |
| 40 class UnicodeCache; |
| 40 | 41 |
| 41 class PushScanner { | 42 class PushScanner { |
| 42 public: | 43 public: |
| 43 explicit PushScanner(ExperimentalScanner* sink); | 44 explicit PushScanner(ExperimentalScanner* sink, UnicodeCache* unicode_cache); |
| 44 | 45 |
| 45 ~PushScanner(); | 46 ~PushScanner(); |
| 46 | 47 |
| 47 void send(v8::internal::Token::Value token); | 48 void send(v8::internal::Token::Value token); |
| 48 uint32_t push(const void *input, int input_size); | 49 uint32_t push(const void *input, int input_size); |
| 49 | 50 |
| 50 private: | 51 private: |
| 52 bool ValidIdentifierStart(); |
| 53 bool ValidIdentifierPart(); |
| 54 uc32 ScanHexNumber(int length); |
| 55 |
| 56 UnicodeCache* unicode_cache_; |
| 57 |
| 51 bool eof_; | 58 bool eof_; |
| 52 int32_t state_; | 59 int32_t state_; |
| 53 int32_t condition_; | 60 int32_t condition_; |
| 54 | 61 |
| 55 uint8_t* limit_; | 62 uint8_t* limit_; |
| 56 uint8_t* start_; | 63 uint8_t* start_; |
| 57 uint8_t* cursor_; | 64 uint8_t* cursor_; |
| 58 uint8_t* marker_; | 65 uint8_t* marker_; |
| 59 int real_start_; | 66 int real_start_; |
| 60 | 67 |
| 61 uint8_t* buffer_; | 68 uint8_t* buffer_; |
| 62 uint8_t* buffer_end_; | 69 uint8_t* buffer_end_; |
| 63 | 70 |
| 64 uint8_t yych; | 71 uint8_t yych; |
| 65 uint32_t yyaccept; | 72 uint32_t yyaccept; |
| 66 | 73 |
| 67 ExperimentalScanner* sink_; | 74 ExperimentalScanner* sink_; |
| 68 }; | 75 }; |
| 69 | 76 |
| 70 } } | 77 } } |
| 71 | 78 |
| 72 #endif // V8_LEXER_LEXER_H | 79 #endif // V8_LEXER_LEXER_H |
| OLD | NEW |