2 // Copyright (c) 2012 The ANGLE Project Authors. All rights reserved.
\r
3 // Use of this source code is governed by a BSD-style license that can be
\r
4 // found in the LICENSE file.
\r
7 #ifndef COMPILER_PREPROCESSOR_TOKENIZER_H_
\r
8 #define COMPILER_PREPROCESSOR_TOKENIZER_H_
\r
12 #include "pp_utils.h"
\r
14 #include <algorithm>
\r
21 class Tokenizer : public Lexer
\r
26 Diagnostics* diagnostics;
\r
29 // The location where yytext points to. Token location should track
\r
30 // scanLoc instead of Input::mReadLoc because they may not be the same
\r
31 // if text is buffered up in the scanner input buffer.
\r
32 Input::Location scanLoc;
\r
37 static const size_t kMaxTokenLength;
\r
39 Tokenizer(Diagnostics* diagnostics);
\r
42 bool init(int count, const char* const string[], const int length[]);
\r
44 void setFileNumber(int file);
\r
45 void setLineNumber(int line);
\r
47 virtual void lex(Token* token);
\r
50 PP_DISALLOW_COPY_AND_ASSIGN(Tokenizer);
\r
52 void destroyScanner();
\r
54 void* mHandle; // Scanner handle.
\r
55 Context mContext; // Scanner extra.
\r
59 #endif // COMPILER_PREPROCESSOR_TOKENIZER_H_
\r