zenilib: zenilib/jni/external/angle/src/compiler/preprocessor/Tokenizer.h Source File

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Tokenizer.h
Go to the documentation of this file.
1 //
2 // Copyright (c) 2012 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5 //
6
7 #ifndef COMPILER_PREPROCESSOR_TOKENIZER_H_
8 #define COMPILER_PREPROCESSOR_TOKENIZER_H_
9
10 #include "Input.h"
11 #include "Lexer.h"
12 #include "pp_utils.h"
13
14 namespace pp
15 {
16
17 class Diagnostics;
18
19 class Tokenizer : public Lexer
20 {
21 public:
22 struct Context
23 {
24 Diagnostics* diagnostics;
25
26 Input input;
27 // The location where yytext points to. Token location should track
28 // scanLoc instead of Input::mReadLoc because they may not be the same
29 // if text is buffered up in the scanner input buffer.
30 Input::Location scanLoc;
31
32 bool leadingSpace;
33 bool lineStart;
34 };
35 static const std::size_t kMaxTokenLength;
36
37 Tokenizer(Diagnostics* diagnostics);
38 ~Tokenizer();
39
40 bool init(size_t count, const char* const string[], const int length[]);
41
42 void setFileNumber(int file);
43 void setLineNumber(int line);
44
45 virtual void lex(Token* token);
46
47 private:
48 PP_DISALLOW_COPY_AND_ASSIGN(Tokenizer);
49 bool initScanner();
50 void destroyScanner();
51
52 void* mHandle; // Scanner handle.
53 Context mContext; // Scanner extra.
54 };
55
56 } // namespace pp
57 #endif // COMPILER_PREPROCESSOR_TOKENIZER_H_
58
pp::Tokenizer::Context
Definition: Tokenizer.h:22
pp::Tokenizer::Context::lineStart
bool lineStart
Definition: Tokenizer.h:33
pp::Tokenizer::Context::input
Input input
Definition: Tokenizer.h:26
pp::Tokenizer::kMaxTokenLength
static const std::size_t kMaxTokenLength
Definition: Tokenizer.h:35
pp::Tokenizer::init
bool init(size_t count, const char *const string[], const int length[])
Definition: Tokenizer.cpp:2307
pp
png_sPLT_entryp pp
Definition: pngrutil.c:1375
pp::Tokenizer::~Tokenizer
~Tokenizer()
Definition: Tokenizer.cpp:2302
file
FILE * file
Definition: visualinfo.c:88
pp::Tokenizer
Definition: Tokenizer.h:19
pp::Tokenizer::setFileNumber
void setFileNumber(int file)
Definition: Tokenizer.cpp:2315
pp::Tokenizer::setLineNumber
void setLineNumber(int line)
Definition: Tokenizer.cpp:2322
pp::Tokenizer::Context::leadingSpace
bool leadingSpace
Definition: Tokenizer.h:32
pp::Lexer
Definition: Lexer.h:15
length
GLsizei GLsizei * length
Definition: gl2ext.h:792
count
GLint GLsizei count
Definition: gl2ext.h:1011
pp::Tokenizer::Context::diagnostics
Diagnostics * diagnostics
Definition: Tokenizer.h:24
pp::Tokenizer::lex
virtual void lex(Token *token)
Definition: Tokenizer.cpp:2327
Lexer.h
pp::Diagnostics
Definition: DiagnosticsBase.h:19
pp::Tokenizer::Tokenizer
Tokenizer(Diagnostics *diagnostics)
Definition: Tokenizer.cpp:2297
pp::Tokenizer::Context::scanLoc
Input::Location scanLoc
Definition: Tokenizer.h:30
pp_utils.h
pp::Token
Definition: Token.h:18
pp::Input
Definition: Input.h:17
pp::Input::Location
Definition: Input.h:29
Input.h
size_t
unsigned int size_t
Definition: SDL_config_windows.h:67