Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 141 | 141 |
| 142 class JsonScanner : public Scanner { | 142 class JsonScanner : public Scanner { |
| 143 public: | 143 public: |
| 144 JsonScanner(); | 144 JsonScanner(); |
| 145 | 145 |
| 146 void Initialize(UC16CharacterStream* source); | 146 void Initialize(UC16CharacterStream* source); |
| 147 | 147 |
| 148 // Returns the next token. | 148 // Returns the next token. |
| 149 Token::Value Next(); | 149 Token::Value Next(); |
| 150 | 150 |
| 151 double number; | |
|
Lasse Reichstein
2011/02/04 13:53:36
Make it a private (or protected) property and call
sandholm
2011/02/04 14:26:37
Done.
| |
| 152 | |
| 151 protected: | 153 protected: |
| 152 // Skip past JSON whitespace (only space, tab, newline and carrige-return). | 154 // Skip past JSON whitespace (only space, tab, newline and carrige-return). |
| 153 bool SkipJsonWhiteSpace(); | 155 bool SkipJsonWhiteSpace(); |
| 154 | 156 |
| 155 // Scan a single JSON token. The JSON lexical grammar is specified in the | 157 // Scan a single JSON token. The JSON lexical grammar is specified in the |
| 156 // ECMAScript 5 standard, section 15.12.1.1. | 158 // ECMAScript 5 standard, section 15.12.1.1. |
| 157 // Recognizes all of the single-character tokens directly, or calls a function | 159 // Recognizes all of the single-character tokens directly, or calls a function |
| 158 // to scan a number, string or identifier literal. | 160 // to scan a number, string or identifier literal. |
| 159 // The only allowed whitespace characters between tokens are tab, | 161 // The only allowed whitespace characters between tokens are tab, |
| 160 // carriage-return, newline and space. | 162 // carriage-return, newline and space. |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 176 | 178 |
| 177 // Used to recognizes one of the literals "true", "false", or "null". These | 179 // Used to recognizes one of the literals "true", "false", or "null". These |
| 178 // are the only valid JSON identifiers (productions JSONBooleanLiteral, | 180 // are the only valid JSON identifiers (productions JSONBooleanLiteral, |
| 179 // JSONNullLiteral). | 181 // JSONNullLiteral). |
| 180 Token::Value ScanJsonIdentifier(const char* text, Token::Value token); | 182 Token::Value ScanJsonIdentifier(const char* text, Token::Value token); |
| 181 }; | 183 }; |
| 182 | 184 |
| 183 } } // namespace v8::internal | 185 } } // namespace v8::internal |
| 184 | 186 |
| 185 #endif // V8_SCANNER_H_ | 187 #endif // V8_SCANNER_H_ |
| OLD | NEW |