blob: a40b99e40048fe1f5c1c4f8eb4bdf2d112ca5270 [file] [log] [blame]
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +00001//
2// Copyright (c) 2002-2010 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/****************************************************************************\
7Copyright (c) 2002, NVIDIA Corporation.
8
9NVIDIA Corporation("NVIDIA") supplies this software to you in
10consideration of your agreement to the following terms, and your use,
11installation, modification or redistribution of this NVIDIA software
12constitutes acceptance of these terms. If you do not agree with these
13terms, please do not use, install, modify or redistribute this NVIDIA
14software.
15
16In consideration of your agreement to abide by the following terms, and
17subject to these terms, NVIDIA grants you a personal, non-exclusive
18license, under NVIDIA's copyrights in this original NVIDIA software (the
19"NVIDIA Software"), to use, reproduce, modify and redistribute the
20NVIDIA Software, with or without modifications, in source and/or binary
21forms; provided that if you redistribute the NVIDIA Software, you must
22retain the copyright notice of NVIDIA, this notice and the following
23text and disclaimers in all such redistributions of the NVIDIA Software.
24Neither the name, trademarks, service marks nor logos of NVIDIA
25Corporation may be used to endorse or promote products derived from the
26NVIDIA Software without specific prior written permission from NVIDIA.
27Except as expressly stated in this notice, no other rights or licenses
28express or implied, are granted by NVIDIA herein, including but not
29limited to any patent rights that may be infringed by your derivative
30works or by other works in which the NVIDIA Software may be
31incorporated. No hardware is licensed hereunder.
32
33THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT
34WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED,
35INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE,
36NON-INFRINGEMENT, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
37ITS USE AND OPERATION EITHER ALONE OR IN COMBINATION WITH OTHER
38PRODUCTS.
39
40IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT,
41INCIDENTAL, EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
42TO, LOST PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
43USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY
44OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE
45NVIDIA SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT,
46TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF
47NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
48\****************************************************************************/
49//
50// compile.h
51//
52
53#if !defined(__COMPILE_H)
54#define __COMPILE_H 1
55
56int InitCPPStruct(void);
57
58typedef struct Options_Rec{
59 const char *profileString;
60 int ErrorMode;
61 int Quiet;
62
63 // Debug The Compiler options:
64 int DumpAtomTable;
65} Options;
66
67struct CPPStruct_Rec {
68 // Public members
69 SourceLoc *pLastSourceLoc; // Set at the start of each statement by the tree walkers
70 Options options; // Compile options and parameters
71
72 // Private members
73 SourceLoc lastSourceLoc;
74
75 // Scanner data:
76
77 SourceLoc *tokenLoc; // Source location of most recent token seen by the scanner
78 int mostRecentToken; // Most recent token seen by the scanner
79 InputSrc *currentInput;
80 int previous_token;
daniel@transgaming.comdec19e22010-04-29 03:35:42 +000081 int pastFirstStatement; // used to make sure that #version is the first statement seen in the file, if present
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000082
83 void *pC; // storing the parseContext of the compile object in cpp.
84
85 // Private members:
86 SourceLoc ltokenLoc;
87 int ifdepth; //current #if-#else-#endif nesting in the cpp.c file (pre-processor)
88 int elsedepth[64]; //Keep a track of #if depth..Max allowed is 64.
89 int elsetracker; //#if-#else and #endif constructs...Counter.
90 const char *ErrMsg;
91 int CompileError; //Indicate compile error when #error, #else,#elif mismatch.
92
93 //
94 // Globals used to communicate between PaParseStrings() and yy_input()and
95 // also across the files.(gen_glslang.cpp and scanner.c)
96 //
97 int PaWhichStr; // which string we're parsing
98 int* PaStrLen; // array of lengths of the PaArgv strings
99 int PaArgc; // count of strings in the array
100 char** PaArgv; // our array of strings to parse
101 unsigned int tokensBeforeEOF : 1;
102};
103
104#endif // !defined(__COMPILE_H)