2 // Copyright (c) 2011 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_PREPROCESSOR_H_
\r
8 #define COMPILER_PREPROCESSOR_PREPROCESSOR_H_
\r
10 #include "pp_utils.h"
\r
16 class DirectiveHandler;
\r
17 struct PreprocessorImpl;
\r
23 Preprocessor(Diagnostics* diagnostics, DirectiveHandler* directiveHandler);
\r
26 // count: specifies the number of elements in the string and length arrays.
\r
27 // string: specifies an array of pointers to strings.
\r
28 // length: specifies an array of string lengths.
\r
29 // If length is NULL, each string is assumed to be null terminated.
\r
30 // If length is a value other than NULL, it points to an array containing
\r
31 // a string length for each of the corresponding elements of string.
\r
32 // Each element in the length array may contain the length of the
\r
33 // corresponding string or a value less than 0 to indicate that the string
\r
34 // is null terminated.
\r
35 bool init(int count, const char* const string[], const int length[]);
\r
36 // Adds a pre-defined macro.
\r
37 void predefineMacro(const char* name, int value);
\r
39 void lex(Token* token);
\r
42 PP_DISALLOW_COPY_AND_ASSIGN(Preprocessor);
\r
44 PreprocessorImpl* mImpl;
\r
48 #endif // COMPILER_PREPROCESSOR_PREPROCESSOR_H_
\r