⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 parser.c

📁 cg编译器
💻 C
📖 第 1 页 / 共 5 页
字号:
/* A Bison parser, made from parser.y
   by GNU bison 1.35.  */

#define YYBISON 1  /* Identify Bison output.  */

# define	AND_SY	257
# define	ASM_SY	258
# define	ASSIGNMINUS_SY	259
# define	ASSIGNMOD_SY	260
# define	ASSIGNPLUS_SY	261
# define	ASSIGNSLASH_SY	262
# define	ASSIGNSTAR_SY	263
# define	BOOLEAN_SY	264
# define	BREAK_SY	265
# define	CASE_SY	266
# define	CFLOATCONST_SY	267
# define	COLONCOLON_SY	268
# define	CONST_SY	269
# define	CONTINUE_SY	270
# define	DEFAULT_SY	271
# define	DISCARD_SY	272
# define	DO_SY	273
# define	EQ_SY	274
# define	ELSE_SY	275
# define	ERROR_SY	276
# define	EXTERN_SY	277
# define	FLOAT_SY	278
# define	FLOATCONST_SY	279
# define	FLOATHCONST_SY	280
# define	FLOATXCONST_SY	281
# define	FOR_SY	282
# define	GE_SY	283
# define	GG_SY	284
# define	GOTO_SY	285
# define	IDENT_SY	286
# define	IF_SY	287
# define	IN_SY	288
# define	INLINE_SY	289
# define	INOUT_SY	290
# define	INT_SY	291
# define	INTCONST_SY	292
# define	INTERNAL_SY	293
# define	LE_SY	294
# define	LL_SY	295
# define	MINUSMINUS_SY	296
# define	NE_SY	297
# define	OR_SY	298
# define	OUT_SY	299
# define	PACKED_SY	300
# define	PLUSPLUS_SY	301
# define	RETURN_SY	302
# define	STATIC_SY	303
# define	STRCONST_SY	304
# define	STRUCT_SY	305
# define	SWITCH_SY	306
# define	TEXOBJ_SY	307
# define	THIS_SY	308
# define	TYPEDEF_SY	309
# define	TYPEIDENT_SY	310
# define	UNIFORM_SY	311
# define	VARYING_SY	312
# define	VOID_SY	313
# define	WHILE_SY	314
# define	FIRST_USER_TOKEN_SY	315

#line 1 "parser.y"

/****************************************************************************\
Copyright (c) 2002, NVIDIA Corporation.

NVIDIA Corporation("NVIDIA") supplies this software to you in
consideration of your agreement to the following terms, and your use,
installation, modification or redistribution of this NVIDIA software
constitutes acceptance of these terms.  If you do not agree with these
terms, please do not use, install, modify or redistribute this NVIDIA
software.

In consideration of your agreement to abide by the following terms, and
subject to these terms, NVIDIA grants you a personal, non-exclusive
license, under NVIDIA's copyrights in this original NVIDIA software (the
"NVIDIA Software"), to use, reproduce, modify and redistribute the
NVIDIA Software, with or without modifications, in source and/or binary
forms; provided that if you redistribute the NVIDIA Software, you must
retain the copyright notice of NVIDIA, this notice and the following
text and disclaimers in all such redistributions of the NVIDIA Software.
Neither the name, trademarks, service marks nor logos of NVIDIA
Corporation may be used to endorse or promote products derived from the
NVIDIA Software without specific prior written permission from NVIDIA.
Except as expressly stated in this notice, no other rights or licenses
express or implied, are granted by NVIDIA herein, including but not
limited to any patent rights that may be infringed by your derivative
works or by other works in which the NVIDIA Software may be
incorporated. No hardware is licensed hereunder. 

THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED,
INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE,
NON-INFRINGEMENT, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
ITS USE AND OPERATION EITHER ALONE OR IN COMBINATION WITH OTHER
PRODUCTS.

IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT,
INCIDENTAL, EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, LOST PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY
OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE
NVIDIA SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT,
TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF
NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\****************************************************************************/

#include <stdio.h>
#include <stdlib.h>

#define NO_PARSER 1
#include "slglobals.h"


#line 56 "parser.y"
#ifndef YYSTYPE
typedef union {
    int    sc_token;
    int    sc_int;
    float  sc_fval;
    int    sc_ident;
    spec   sc_specifiers;
    dtype  sc_type;
    Type   *sc_ptype;
    decl   *sc_decl;
    expr   *sc_expr;
    symb   *sc_symb;
    stmt   *sc_stmt;
    /* Dummy palce holder: */
    int    dummy;
} yystype;
# define YYSTYPE yystype
# define YYSTYPE_IS_TRIVIAL 1
#endif
#ifndef YYDEBUG
# define YYDEBUG 0
#endif



#define	YYFINAL		330
#define	YYFLAG		-32768
#define	YYNTBASE	86

/* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */
#define YYTRANSLATE(x) ((unsigned)(x) <= 315 ? yytranslate[x] : 174)

/* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */
static const char yytranslate[] =
{
       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,    77,     2,     2,     2,    81,    82,     2,
      72,    71,    79,    75,    63,    76,    74,    80,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,    66,    62,
      67,    64,    68,    85,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,    69,     2,    70,    83,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,    73,    84,    65,    78,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     1,     3,     4,     5,
       6,     7,     8,     9,    10,    11,    12,    13,    14,    15,
      16,    17,    18,    19,    20,    21,    22,    23,    24,    25,
      26,    27,    28,    29,    30,    31,    32,    33,    34,    35,
      36,    37,    38,    39,    40,    41,    42,    43,    44,    45,
      46,    47,    48,    49,    50,    51,    52,    53,    54,    55,
      56,    57,    58,    59,    60,    61
};

#if YYDEBUG
static const short yyprhs[] =
{
       0,     0,     2,     5,     7,     9,    12,    16,    19,    22,
      24,    27,    29,    32,    35,    38,    41,    44,    47,    49,
      52,    55,    58,    61,    64,    67,    69,    73,    75,    79,
      81,    83,    85,    87,    89,    91,    93,    95,    97,    99,
     101,   103,   105,   107,   109,   111,   113,   118,   123,   125,
     127,   130,   135,   137,   139,   141,   143,   146,   148,   149,
     154,   155,   158,   160,   163,   165,   169,   171,   176,   180,
     184,   188,   191,   192,   197,   201,   203,   207,   210,   215,
     216,   218,   220,   224,   226,   230,   235,   237,   241,   243,
     247,   249,   251,   253,   257,   262,   264,   267,   270,   274,
     279,   284,   285,   287,   289,   293,   295,   299,   301,   304,
     307,   310,   313,   316,   319,   321,   326,   328,   332,   336,
     340,   342,   346,   350,   352,   356,   360,   362,   366,   370,
     374,   378,   380,   384,   388,   390,   394,   396,   400,   402,
     406,   408,   412,   414,   418,   420,   426,   428,   430,   434,
     437,   441,   443,   445,   447,   449,   451,   453,   455,   457,
     459,   461,   464,   468,   473,   476,   481,   486,   490,   493,
     495,   497,   499,   502,   504,   506,   509,   511,   515,   517,
     521,   525,   529,   533,   537,   543,   551,   561,   567,   577,
     579,   581,   582,   584,   588,   590,   591,   595,   598,   600,
     602,   604,   606,   608,   610,   612,   614,   616,   618
};
static const short yyrhs[] =
{
      87,     0,    86,    87,     0,    88,     0,   144,     0,    90,
      62,     0,    90,    93,    62,     0,    22,    62,     0,    91,
     115,     0,    91,     0,    55,    91,     0,    92,     0,    96,
      91,     0,    98,    91,     0,    97,    91,     0,   100,    91,
       0,    99,    91,     0,    46,    91,     0,    95,     0,    92,
      96,     0,    92,    98,     0,    92,    97,     0,    92,   100,
       0,    92,    99,     0,    92,    46,     0,    94,     0,    93,
      63,    94,     0,   111,     0,   111,    64,   120,     0,    37,
       0,    24,     0,    59,     0,    10,     0,    53,     0,   101,
       0,   170,     0,     1,     0,    15,     0,    57,     0,    49,
       0,    23,     0,    35,     0,    39,     0,    34,     0,    45,
       0,    36,     0,   103,   102,   106,    65,     0,   105,   102,
     106,    65,     0,   103,     0,   154,     0,    51,   104,     0,
      51,   104,    66,   169,     0,   172,     0,   170,     0,    51,
       0,   107,     0,   106,   107,     0,    88,     0,     0,    67,
     109,   110,    68,     0,     0,   110,    88,     0,   112,     0,
     112,   108,     0,   113,     0,   113,    66,   169,     0,   172,
       0,   113,    69,    38,    70,     0,   113,    69,    70,     0,
     114,   116,    71,     0,   114,   118,    71,     0,   113,    72,
       0,     0,   115,    69,    38,    70,     0,   115,    69,    70,
       0,   117,     0,   116,    63,   117,     0,    90,   111,     0,
      90,   111,    64,   120,     0,     0,   119,     0,    89,     0,
     119,    63,    89,     0,   143,     0,    73,   121,    65,     0,
      73,   121,    63,    65,     0,   120,     0,   121,    63,   120,
       0,   123,     0,   168,    14,   123,     0,   171,     0,   122,
       0,   173,     0,    72,   143,    71,     0,    95,    72,   128,
      71,     0,   124,     0,   125,    47,     0,   125,    42,     0,
     125,    74,   167,     0,   125,    69,   143,    70,     0,   125,
      72,   126,    71,     0,     0,   127,     0,   143,     0,   127,
      63,   143,     0,   143,     0,   128,    63,   143,     0,   125,
       0,    47,   129,     0,    42,   129,     0,    75,   129,     0,
      76,   129,     0,    77,   129,     0,    78,   129,     0,   129,
       0,    72,    89,    71,   130,     0,   130,     0,   131,    79,
     130,     0,   131,    80,   130,     0,   131,    81,   130,     0,
     131,     0,   132,    75,   131,     0,   132,    76,   131,     0,
     132,     0,   133,    41,   132,     0,   133,    30,   132,     0,
     133,     0,   134,    67,   133,     0,   134,    68,   133,     0,
     134,    40,   133,     0,   134,    29,   133,     0,   134,     0,
     135,    20,   134,     0,   135,    43,   134,     0,   135,     0,
     136,    82,   135,     0,   136,     0,   137,    83,   136,     0,
     137,     0,   138,    84,   137,     0,   138,     0,   139,     3,
     138,     0,   139,     0,   140,    44,   139,     0,   140,     0,
     142,    85,   143,    66,   141,     0,   140,     0,   141,     0,
     145,   156,    65,     0,   145,    65,     0,    90,   111,    73,
       0,   147,     0,   148,     0,   153,     0,   149,     0,   158,
       0,   160,     0,   150,     0,   166,     0,   151,     0,   161,
       0,    18,    62,     0,    18,   143,    62,     0,   152,   147,
      21,   147,     0,   152,   146,     0,   152,   147,    21,   148,
       0,    33,    72,   162,    71,     0,   154,   156,   155,     0,
     154,   155,     0,    73,     0,    65,     0,   157,     0,   156,
     157,     0,    88,     0,   146,     0,   159,    62,     0,    62,
       0,   125,    64,   143,     0,   143,     0,   125,     5,   143,
       0,   125,     6,   143,     0,   125,     7,   143,     0,   125,
       8,   143,     0,   125,     9,   143,     0,    60,    72,   162,
      71,   147,     0,    19,   146,    60,    72,   162,    71,    62,
       0,    28,    72,   163,    62,   165,    62,   163,    71,   147,
       0,    60,    72,   162,    71,   148,     0,    28,    72,   163,
      62,   165,    62,   163,    71,   148,     0,   143,     0,   164,
       0,     0,   159,     0,   164,    63,   159,     0,   162,     0,
       0,    48,   143,    62,     0,    48,    62,     0,   172,     0,
     172,     0,   172,     0,    56,     0,   172,     0,    32,     0,
      38,     0,    13,     0,    25,     0,    26,     0,    27,     0
};

#endif

#if YYDEBUG
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -