37 #ifndef GOOGLE_PROTOBUF_IO_TOKENIZER_H__
38 #define GOOGLE_PROTOBUF_IO_TOKENIZER_H__
48 class ZeroCopyInputStream;
65 virtual void AddError(
int line,
int column,
const string& message) = 0;
132 const Token& current();
185 bool NextWithComments(
string* prev_trailing_comments,
186 vector<string>* detached_comments,
187 string* next_leading_comments);
194 static double ParseFloat(
const string& text);
199 static void ParseString(
const string& text,
string*
output);
202 static void ParseStringAppend(
const string& text,
string*
output);
209 static bool ParseInteger(
const string& text,
uint64 max_value,
235 require_space_after_number_ = require;
241 allow_multiline_strings_ = allow;
245 static bool IsIdentifier(
const string& text);
282 static const int kTabWidth = 8;
293 inline void RecordTo(
string* target);
294 inline void StopRecording();
298 inline void StartToken();
302 inline void EndToken();
306 error_collector_->
AddError(line_, column_, message);
317 void ConsumeString(
char delimiter);
325 TokenType ConsumeNumber(
bool started_with_zero,
bool started_with_dot);
328 void ConsumeLineComment(
string* content);
330 void ConsumeBlockComment(
string* content);
349 NextCommentStatus TryConsumeCommentStart();
361 template<
typename CharacterClass>
362 inline bool LookingAt();
367 template<
typename CharacterClass>
368 inline bool TryConsumeOne();
371 inline bool TryConsume(
char c);
374 template<
typename CharacterClass>
375 inline void ConsumeZeroOrMore();
380 template<
typename CharacterClass>
381 inline void ConsumeOneOrMore(
const char* error);
402 #endif // GOOGLE_PROTOBUF_IO_TOKENIZER_H__
Definition: tokenizer.h:57
void AddError(const string &message)
Definition: tokenizer.h:305
int line_
Definition: tokenizer.h:264
CommentStyle comment_style_
Definition: tokenizer.h:276
Definition: tokenizer.h:337
Definition: tokenizer.h:224
Definition: tokenizer.h:92
int column
Definition: tokenizer.h:126
int line
Definition: tokenizer.h:125
int end_column
Definition: tokenizer.h:127
virtual void AddError(int line, int column, const string &message)=0
int buffer_pos_
Definition: tokenizer.h:260
Token previous_
Definition: tokenizer.h:252
Token current_
Definition: tokenizer.h:251
Definition: tokenizer.h:83
#define GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(TypeName)
Definition: common.h:89
void set_require_space_after_number(bool require)
Definition: tokenizer.h:234
void set_allow_multiline_strings(bool allow)
Definition: tokenizer.h:240
int record_start_
Definition: tokenizer.h:272
string text
Definition: tokenizer.h:119
Definition: tokenizer.h:108
TokenType type
Definition: tokenizer.h:118
bool allow_multiline_strings_
Definition: tokenizer.h:278
const char * buffer_
Definition: tokenizer.h:258
static void ParseString(const string &text, string *output)
Definition: tokenizer.h:393
void set_allow_f_after_float(bool value)
Definition: tokenizer.h:218
TokenType
Definition: tokenizer.h:91
Definition: tokenizer.h:341
bool require_space_after_number_
Definition: tokenizer.h:277
void set_comment_style(CommentStyle style)
Definition: tokenizer.h:230
static void ParseStringAppend(const string &text, string *output)
ErrorCollector * error_collector_
Definition: tokenizer.h:255
string * record_target_
Definition: tokenizer.h:271
virtual void AddWarning(int, int, const string &)
Definition: tokenizer.h:70
NextCommentStatus
Definition: tokenizer.h:332
uint32_t previous(octet_iterator &it, octet_iterator pass_start)
Deprecated in versions that include "prior".
Definition: checked.h:179
char current_char_
Definition: tokenizer.h:257
uint64_t uint64
Definition: common.h:178
const Token & current()
Definition: tokenizer.h:385
bool read_error_
Definition: tokenizer.h:261
#define LIBPROTOBUF_EXPORT
Definition: common.h:105
Definition: tokenizer.h:95
const Token & previous()
Definition: tokenizer.h:389
ErrorCollector()
Definition: tokenizer.h:59
bool allow_f_after_float_
Definition: tokenizer.h:275
Definition: tokenizer.h:93
Definition: tokenizer.h:99
Definition: BnetFileGenerator.h:47
const FieldDescriptor value
Definition: descriptor.h:1522
ZeroCopyInputStream * input_
Definition: tokenizer.h:254
Definition: tokenizer.h:105
Definition: tokenizer.h:334
Definition: tokenizer.h:117
int buffer_size_
Definition: tokenizer.h:259
int column_
Definition: tokenizer.h:265
CommentStyle
Definition: tokenizer.h:221
Definition: tokenizer.h:111