daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 1 | // |
| 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 | /****************************************************************************\ |
| 7 | Copyright (c) 2002, NVIDIA Corporation. |
| 8 | |
| 9 | NVIDIA Corporation("NVIDIA") supplies this software to you in |
| 10 | consideration of your agreement to the following terms, and your use, |
| 11 | installation, modification or redistribution of this NVIDIA software |
| 12 | constitutes acceptance of these terms. If you do not agree with these |
| 13 | terms, please do not use, install, modify or redistribute this NVIDIA |
| 14 | software. |
| 15 | |
| 16 | In consideration of your agreement to abide by the following terms, and |
| 17 | subject to these terms, NVIDIA grants you a personal, non-exclusive |
| 18 | license, under NVIDIA's copyrights in this original NVIDIA software (the |
| 19 | "NVIDIA Software"), to use, reproduce, modify and redistribute the |
| 20 | NVIDIA Software, with or without modifications, in source and/or binary |
| 21 | forms; provided that if you redistribute the NVIDIA Software, you must |
| 22 | retain the copyright notice of NVIDIA, this notice and the following |
| 23 | text and disclaimers in all such redistributions of the NVIDIA Software. |
| 24 | Neither the name, trademarks, service marks nor logos of NVIDIA |
| 25 | Corporation may be used to endorse or promote products derived from the |
| 26 | NVIDIA Software without specific prior written permission from NVIDIA. |
| 27 | Except as expressly stated in this notice, no other rights or licenses |
| 28 | express or implied, are granted by NVIDIA herein, including but not |
| 29 | limited to any patent rights that may be infringed by your derivative |
| 30 | works or by other works in which the NVIDIA Software may be |
| 31 | incorporated. No hardware is licensed hereunder. |
| 32 | |
| 33 | THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT |
| 34 | WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, |
| 35 | INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE, |
| 36 | NON-INFRINGEMENT, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR |
| 37 | ITS USE AND OPERATION EITHER ALONE OR IN COMBINATION WITH OTHER |
| 38 | PRODUCTS. |
| 39 | |
| 40 | IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, |
| 41 | INCIDENTAL, EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED |
| 42 | TO, LOST PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
| 43 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY |
| 44 | OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE |
| 45 | NVIDIA SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, |
| 46 | TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF |
| 47 | NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 48 | \****************************************************************************/ |
| 49 | // |
| 50 | // cpp.h |
| 51 | // |
| 52 | |
| 53 | #if !defined(__CPP_H) |
| 54 | #define __CPP_H 1 |
| 55 | |
daniel@transgaming.com | e684229 | 2010-04-20 18:52:50 +0000 | [diff] [blame^] | 56 | #include "compiler/preprocessor/parser.h" |
| 57 | #include "compiler/preprocessor/tokens.h" |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 58 | |
| 59 | int InitCPP(void); |
| 60 | int FinalCPP(void); |
| 61 | int readCPPline(yystypepp * yylvalpp); |
| 62 | int MacroExpand(int atom, yystypepp * yylvalpp); |
| 63 | int ChkCorrectElseNesting(void); |
| 64 | |
| 65 | typedef struct MacroSymbol { |
| 66 | int argc; |
| 67 | int *args; |
| 68 | TokenStream *body; |
| 69 | unsigned busy:1; |
| 70 | unsigned undef:1; |
| 71 | } MacroSymbol; |
| 72 | |
| 73 | void FreeMacro(MacroSymbol *); |
| 74 | int PredefineMacro(char *); |
| 75 | |
| 76 | void CPPDebugLogMsg(const char *msg); // Prints information into debug log |
| 77 | void CPPShInfoLogMsg(const char*); // Store cpp Err Msg into Sh.Info.Log |
| 78 | void CPPWarningToInfoLog(const char *msg); // Prints warning messages into info log |
| 79 | void HandlePragma(const char**, int numTokens); // #pragma directive container. |
| 80 | void ResetTString(void); // #error Message as TString. |
| 81 | void CPPErrorToInfoLog(char*); // Stick all cpp errors into Sh.Info.log . |
| 82 | void StoreStr(char*); // Store the TString in Parse Context. |
| 83 | void SetLineNumber(int); // Set line number. |
| 84 | void SetStringNumber(int); // Set string number. |
| 85 | int GetLineNumber(void); // Get the current String Number. |
| 86 | int GetStringNumber(void); // Get the current String Number. |
| 87 | const char* GetStrfromTStr(void); // Convert TString to String. |
| 88 | void updateExtensionBehavior(const char* extName, const char* behavior); |
| 89 | int FreeCPP(void); |
| 90 | |
| 91 | #endif // !(defined(__CPP_H) |