Home | History | Annotate | Download | only in preprocessor
      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 
     37 NVIDIA Corporation("NVIDIA") supplies this software to you in
     38 consideration of your agreement to the following terms, and your use,
     39 installation, modification or redistribution of this NVIDIA software
     40 constitutes acceptance of these terms.  If you do not agree with these
     41 terms, please do not use, install, modify or redistribute this NVIDIA
     42 software.
     43 
     44 In consideration of your agreement to abide by the following terms, and
     45 subject to these terms, NVIDIA grants you a personal, non-exclusive
     46 license, under NVIDIA's copyrights in this original NVIDIA software (the
     47 "NVIDIA Software"), to use, reproduce, modify and redistribute the
     48 NVIDIA Software, with or without modifications, in source and/or binary
     49 forms; provided that if you redistribute the NVIDIA Software, you must
     50 retain the copyright notice of NVIDIA, this notice and the following
     51 text and disclaimers in all such redistributions of the NVIDIA Software.
     52 Neither the name, trademarks, service marks nor logos of NVIDIA
     53 Corporation may be used to endorse or promote products derived from the
     54 NVIDIA Software without specific prior written permission from NVIDIA.
     55 Except as expressly stated in this notice, no other rights or licenses
     56 express or implied, are granted by NVIDIA herein, including but not
     57 limited to any patent rights that may be infringed by your derivative
     58 works or by other works in which the NVIDIA Software may be
     59 incorporated. No hardware is licensed hereunder.
     60 
     61 THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT
     62 WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED,
     63 INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE,
     64 NON-INFRINGEMENT, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
     65 ITS USE AND OPERATION EITHER ALONE OR IN COMBINATION WITH OTHER
     66 PRODUCTS.
     67 
     68 IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT,
     69 INCIDENTAL, EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
     70 TO, LOST PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
     71 USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY
     72 OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE
     73 NVIDIA SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT,
     74 TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF
     75 NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     76 \****************************************************************************/
     77 
     78 #ifndef PARSER_H
     79 #define PARSER_H
     80 
     81 namespace glslang {
     82 
     83 // Multi-character tokens
     84 enum EFixedAtoms {
     85     // single character tokens get their own char value as their token; start here for multi-character tokens
     86     PpAtomMaxSingle = 127,
     87 
     88     // replace bad character tokens with this, to avoid accidental aliasing with the below
     89     PpAtomBadToken,
     90 
     91     // Operators
     92 
     93     PPAtomAddAssign,
     94     PPAtomSubAssign,
     95     PPAtomMulAssign,
     96     PPAtomDivAssign,
     97     PPAtomModAssign,
     98 
     99     PpAtomRight,
    100     PpAtomLeft,
    101 
    102     PpAtomRightAssign,
    103     PpAtomLeftAssign,
    104     PpAtomAndAssign,
    105     PpAtomOrAssign,
    106     PpAtomXorAssign,
    107 
    108     PpAtomAnd,
    109     PpAtomOr,
    110     PpAtomXor,
    111 
    112     PpAtomEQ,
    113     PpAtomNE,
    114     PpAtomGE,
    115     PpAtomLE,
    116 
    117     PpAtomDecrement,
    118     PpAtomIncrement,
    119 
    120     PpAtomColonColon,
    121 
    122     PpAtomPaste,
    123 
    124     // Constants
    125 
    126     PpAtomConstInt,
    127     PpAtomConstUint,
    128     PpAtomConstInt64,
    129     PpAtomConstUint64,
    130 #ifdef AMD_EXTENSIONS
    131     PpAtomConstInt16,
    132     PpAtomConstUint16,
    133 #endif
    134     PpAtomConstFloat,
    135     PpAtomConstDouble,
    136     PpAtomConstFloat16,
    137     PpAtomConstString,
    138 
    139     // Identifiers
    140     PpAtomIdentifier,
    141 
    142     // preprocessor "keywords"
    143 
    144     PpAtomDefine,
    145     PpAtomUndef,
    146 
    147     PpAtomIf,
    148     PpAtomIfdef,
    149     PpAtomIfndef,
    150     PpAtomElse,
    151     PpAtomElif,
    152     PpAtomEndif,
    153 
    154     PpAtomLine,
    155     PpAtomPragma,
    156     PpAtomError,
    157 
    158     // #version ...
    159     PpAtomVersion,
    160     PpAtomCore,
    161     PpAtomCompatibility,
    162     PpAtomEs,
    163 
    164     // #extension
    165     PpAtomExtension,
    166 
    167     // __LINE__, __FILE__, __VERSION__
    168 
    169     PpAtomLineMacro,
    170     PpAtomFileMacro,
    171     PpAtomVersionMacro,
    172 
    173     // #include
    174     PpAtomInclude,
    175 
    176     PpAtomLast,
    177 };
    178 
    179 } // end namespace glslang
    180 
    181 #endif /* not PARSER_H */
    182