Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 //
2 // Copyright (c) 2011 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 //
7 #ifndef COMPILER_PREPROCESSOR_PREPROCESSOR_H_
8 #define COMPILER_PREPROCESSOR_PREPROCESSOR_H_
10 #include <stddef.h>
12 #include "pp_utils.h"
14 namespace pp
15 {
17 class Diagnostics;
18 class DirectiveHandler;
19 struct PreprocessorImpl;
20 struct Token;
22 class Preprocessor
23 {
24 public:
25 Preprocessor(Diagnostics* diagnostics, DirectiveHandler* directiveHandler);
26 ~Preprocessor();
28 // count: specifies the number of elements in the string and length arrays.
29 // string: specifies an array of pointers to strings.
30 // length: specifies an array of string lengths.
31 // If length is NULL, each string is assumed to be null terminated.
32 // If length is a value other than NULL, it points to an array containing
33 // a string length for each of the corresponding elements of string.
34 // Each element in the length array may contain the length of the
35 // corresponding string or a value less than 0 to indicate that the string
36 // is null terminated.
37 bool init(size_t count, const char* const string[], const int length[]);
38 // Adds a pre-defined macro.
39 void predefineMacro(const char* name, int value);
41 void lex(Token* token);
43 private:
44 PP_DISALLOW_COPY_AND_ASSIGN(Preprocessor);
46 PreprocessorImpl* mImpl;
47 };
49 } // namespace pp
50 #endif // COMPILER_PREPROCESSOR_PREPROCESSOR_H_