PpTokens.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. //
  2. // Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
  3. // All rights reserved.
  4. //
  5. // Redistribution and use in source and binary forms, with or without
  6. // modification, are permitted provided that the following conditions
  7. // are met:
  8. //
  9. // Redistributions of source code must retain the above copyright
  10. // notice, this list of conditions and the following disclaimer.
  11. //
  12. // Redistributions in binary form must reproduce the above
  13. // copyright notice, this list of conditions and the following
  14. // disclaimer in the documentation and/or other materials provided
  15. // with the distribution.
  16. //
  17. // Neither the name of 3Dlabs Inc. Ltd. nor the names of its
  18. // contributors may be used to endorse or promote products derived
  19. // from this software without specific prior written permission.
  20. //
  21. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  24. // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  25. // COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  26. // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  27. // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  28. // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  29. // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  30. // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  31. // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  32. // POSSIBILITY OF SUCH DAMAGE.
  33. //
  34. /****************************************************************************\
  35. Copyright (c) 2002, NVIDIA Corporation.
  36. NVIDIA Corporation("NVIDIA") supplies this software to you in
  37. consideration of your agreement to the following terms, and your use,
  38. installation, modification or redistribution of this NVIDIA software
  39. constitutes acceptance of these terms. If you do not agree with these
  40. terms, please do not use, install, modify or redistribute this NVIDIA
  41. software.
  42. In consideration of your agreement to abide by the following terms, and
  43. subject to these terms, NVIDIA grants you a personal, non-exclusive
  44. license, under NVIDIA's copyrights in this original NVIDIA software (the
  45. "NVIDIA Software"), to use, reproduce, modify and redistribute the
  46. NVIDIA Software, with or without modifications, in source and/or binary
  47. forms; provided that if you redistribute the NVIDIA Software, you must
  48. retain the copyright notice of NVIDIA, this notice and the following
  49. text and disclaimers in all such redistributions of the NVIDIA Software.
  50. Neither the name, trademarks, service marks nor logos of NVIDIA
  51. Corporation may be used to endorse or promote products derived from the
  52. NVIDIA Software without specific prior written permission from NVIDIA.
  53. Except as expressly stated in this notice, no other rights or licenses
  54. express or implied, are granted by NVIDIA herein, including but not
  55. limited to any patent rights that may be infringed by your derivative
  56. works or by other works in which the NVIDIA Software may be
  57. incorporated. No hardware is licensed hereunder.
  58. THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT
  59. WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED,
  60. INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE,
  61. NON-INFRINGEMENT, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
  62. ITS USE AND OPERATION EITHER ALONE OR IN COMBINATION WITH OTHER
  63. PRODUCTS.
  64. IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT,
  65. INCIDENTAL, EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
  66. TO, LOST PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  67. USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY
  68. OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE
  69. NVIDIA SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT,
  70. TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF
  71. NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  72. \****************************************************************************/
  73. #ifndef PARSER_H
  74. #define PARSER_H
  75. namespace glslang {
  76. // Multi-character tokens
  77. enum EFixedAtoms {
  78. // single character tokens get their own char value as their token; start here for multi-character tokens
  79. PpAtomMaxSingle = 127,
  80. // replace bad character tokens with this, to avoid accidental aliasing with the below
  81. PpAtomBadToken,
  82. // Operators
  83. PPAtomAddAssign,
  84. PPAtomSubAssign,
  85. PPAtomMulAssign,
  86. PPAtomDivAssign,
  87. PPAtomModAssign,
  88. PpAtomRight,
  89. PpAtomLeft,
  90. PpAtomRightAssign,
  91. PpAtomLeftAssign,
  92. PpAtomAndAssign,
  93. PpAtomOrAssign,
  94. PpAtomXorAssign,
  95. PpAtomAnd,
  96. PpAtomOr,
  97. PpAtomXor,
  98. PpAtomEQ,
  99. PpAtomNE,
  100. PpAtomGE,
  101. PpAtomLE,
  102. PpAtomDecrement,
  103. PpAtomIncrement,
  104. PpAtomColonColon,
  105. PpAtomPaste,
  106. // Constants
  107. PpAtomConstInt,
  108. PpAtomConstUint,
  109. PpAtomConstInt64,
  110. PpAtomConstUint64,
  111. PpAtomConstInt16,
  112. PpAtomConstUint16,
  113. PpAtomConstFloat,
  114. PpAtomConstDouble,
  115. PpAtomConstFloat16,
  116. PpAtomConstString,
  117. // Identifiers
  118. PpAtomIdentifier,
  119. // preprocessor "keywords"
  120. PpAtomDefine,
  121. PpAtomUndef,
  122. PpAtomIf,
  123. PpAtomIfdef,
  124. PpAtomIfndef,
  125. PpAtomElse,
  126. PpAtomElif,
  127. PpAtomEndif,
  128. PpAtomLine,
  129. PpAtomPragma,
  130. PpAtomError,
  131. // #version ...
  132. PpAtomVersion,
  133. PpAtomCore,
  134. PpAtomCompatibility,
  135. PpAtomEs,
  136. // #extension
  137. PpAtomExtension,
  138. // __LINE__, __FILE__, __VERSION__
  139. PpAtomLineMacro,
  140. PpAtomFileMacro,
  141. PpAtomVersionMacro,
  142. // #include
  143. PpAtomInclude,
  144. PpAtomLast,
  145. };
  146. } // end namespace glslang
  147. #endif /* not PARSER_H */