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

📄 _rc1.0_parser.cpp

📁 使用stl技术,(还没看,是听说的)
💻 CPP
📖 第 1 页 / 共 4 页
字号:

/*  A Bison parser, made from rc1.0_grammar.y
    by GNU Bison version 1.28  */

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

#define yyparse rc10_parse
#define yylex rc10_lex
#define yyerror rc10_error
#define yylval rc10_lval
#define yychar rc10_char
#define yydebug rc10_debug
#define yynerrs rc10_nerrs
#define	regVariable	257
#define	constVariable	258
#define	color_sum	259
#define	final_product	260
#define	expandString	261
#define	halfBiasString	262
#define	unsignedString	263
#define	unsignedInvertString	264
#define	muxString	265
#define	sumString	266
#define	rgb_portion	267
#define	alpha_portion	268
#define	openParen	269
#define	closeParen	270
#define	openBracket	271
#define	closeBracket	272
#define	semicolon	273
#define	comma	274
#define	dot	275
#define	times	276
#define	minus	277
#define	equals	278
#define	plus	279
#define	bias_by_negative_one_half_scale_by_two	280
#define	bias_by_negative_one_half	281
#define	scale_by_one_half	282
#define	scale_by_two	283
#define	scale_by_four	284
#define	clamp_color_sum	285
#define	lerp	286
#define	fragment_rgb	287
#define	fragment_alpha	288
#define	floatValue	289

#line 2 "rc1.0_grammar.y"

void yyerror(char* s);
int yylex ( void );

#ifdef _WIN32
# include <windows.h>
#endif

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

#include "rc1.0_combiners.h"
#include "nvparse_errors.h"
#include "nvparse_externs.h"



#line 19 "rc1.0_grammar.y"
typedef union {
  int ival;
  float fval;
  RegisterEnum registerEnum;
  BiasScaleEnum biasScaleEnum;
  MappedRegisterStruct mappedRegisterStruct;
  ConstColorStruct constColorStruct;
  GeneralPortionStruct generalPortionStruct;
  GeneralFunctionStruct generalFunctionStruct;
  OpStruct opStruct;
  GeneralCombinerStruct generalCombinerStruct;
  GeneralCombinersStruct generalCombinersStruct;
  FinalProductStruct finalProductStruct;
  FinalRgbFunctionStruct finalRgbFunctionStruct;
  FinalAlphaFunctionStruct finalAlphaFunctionStruct;
  FinalCombinerStruct finalCombinerStruct;
  CombinersStruct combinersStruct;
} YYSTYPE;
#include <stdio.h>

#ifndef __cplusplus
#ifndef __STDC__
#define const
#endif
#endif



#define	YYFINAL		220
#define	YYFLAG		-32768
#define	YYNTBASE	36

#define YYTRANSLATE(x) ((unsigned)(x) <= 289 ? yytranslate[x] : 57)

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,     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,     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
};

#if YYDEBUG != 0
static const short yyprhs[] = {     0,
     0,     2,     6,    11,    14,    17,    21,    23,    36,    39,
    41,    46,    52,    59,    63,    68,    74,    80,    85,    87,
    89,    91,    94,    99,   105,   110,   116,   121,   126,   129,
   132,   135,   137,   140,   144,   148,   150,   157,   164,   169,
   176,   183,   188,   193,   198,   203,   208,   210,   215,   220,
   222,   227,   232,   234,   239,   244,   247,   251,   255,   260,
   265,   268,   272,   276,   281,   286,   288,   291,   294,   298,
   302,   304,   307,   310,   314,   318,   323,   330,   344,   358,
   370,   377,   386,   391,   398,   403,   405
};

static const short yyrhs[] = {    37,
     0,    38,    39,    51,     0,    38,    38,    39,    51,     0,
    39,    51,     0,    38,    51,     0,    38,    38,    51,     0,
    51,     0,     4,    24,    15,    35,    20,    35,    20,    35,
    20,    35,    16,    19,     0,    39,    40,     0,    40,     0,
    17,    41,    41,    18,     0,    17,    38,    41,    41,    18,
     0,    17,    38,    38,    41,    41,    18,     0,    17,    41,
    18,     0,    17,    38,    41,    18,     0,    17,    38,    38,
    41,    18,     0,    42,    17,    44,    49,    18,     0,    42,
    17,    44,    18,     0,    13,     0,    14,     0,    56,     0,
    23,    56,     0,     7,    15,    56,    16,     0,    23,     7,
    15,    56,    16,     0,     8,    15,    56,    16,     0,    23,
     8,    15,    56,    16,     0,     9,    15,    56,    16,     0,
    10,    15,    56,    16,     0,    45,    45,     0,    45,    46,
     0,    46,    45,     0,    45,     0,    46,    46,     0,    46,
    46,    47,     0,    46,    46,    48,     0,    46,     0,    56,
    24,    43,    21,    43,    19,     0,    56,    24,    43,    22,
    43,    19,     0,    56,    24,    43,    19,     0,    56,    24,
    11,    15,    16,    19,     0,    56,    24,    12,    15,    16,
    19,     0,    26,    15,    16,    19,     0,    27,    15,    16,
    19,     0,    28,    15,    16,    19,     0,    29,    15,    16,
    19,     0,    30,    15,    16,    19,     0,    56,     0,     9,
    15,    56,    16,     0,    10,    15,    56,    16,     0,     5,
     0,     9,    15,     5,    16,     0,    10,    15,     5,    16,
     0,     6,     0,     9,    15,     6,    16,     0,    10,    15,
     6,    16,     0,    55,    54,     0,    52,    55,    54,     0,
    53,    55,    54,     0,    52,    53,    55,    54,     0,    53,
    52,    55,    54,     0,    54,    55,     0,    52,    54,    55,
     0,    53,    54,    55,     0,    52,    53,    54,    55,     0,
    53,    52,    54,    55,     0,    54,     0,    52,    54,     0,
    53,    54,     0,    52,    53,    54,     0,    53,    52,    54,
     0,    55,     0,    52,    55,     0,    53,    55,     0,    52,
    53,    55,     0,    53,    52,    55,     0,    31,    15,    16,
    19,     0,     6,    24,    50,    22,    50,    19,     0,    33,
    24,    32,    15,    50,    20,    50,    20,    50,    16,    25,
    50,    19,     0,    33,    24,    50,    25,    32,    15,    50,
    20,    50,    20,    50,    16,    19,     0,    33,    24,    32,
    15,    50,    20,    50,    20,    50,    16,    19,     0,    33,
    24,    50,    22,    50,    19,     0,    33,    24,    50,    22,
    50,    25,    50,    19,     0,    33,    24,    50,    19,     0,
    33,    24,    50,    25,    50,    19,     0,    34,    24,    50,
    19,     0,     4,     0,     3,     0
};

#endif

#if YYDEBUG != 0
static const short yyrline[] = { 0,
    72,    79,    85,    91,    97,   105,   113,   123,   132,   137,
   145,   151,   157,   163,   169,   175,   183,   189,   199,   203,
   209,   215,   221,   227,   233,   239,   245,   251,   259,   265,
   271,   277,   283,   289,   295,   301,   309,   317,   323,   335,
   343,   351,   355,   359,   363,   367,   373,   379,   385,   391,
   397,   403,   409,   415,   421,   429,   435,   441,   447,   453,
   460,   466,   472,   478,   484,   491,   499,   507,   515,   523,
   532,   540,   548,   556,   564,   574,   580,   588,   594,   600,
   610,   622,   632,   646,   660,   668,   672
};
#endif


#if YYDEBUG != 0 || defined (YYERROR_VERBOSE)

static const char * const yytname[] = {   "$","error","$undefined.","regVariable",
"constVariable","color_sum","final_product","expandString","halfBiasString",
"unsignedString","unsignedInvertString","muxString","sumString","rgb_portion",
"alpha_portion","openParen","closeParen","openBracket","closeBracket","semicolon",
"comma","dot","times","minus","equals","plus","bias_by_negative_one_half_scale_by_two",
"bias_by_negative_one_half","scale_by_one_half","scale_by_two","scale_by_four",
"clamp_color_sum","lerp","fragment_rgb","fragment_alpha","floatValue","WholeEnchilada",
"Combiners","ConstColor","GeneralCombiners","GeneralCombiner","GeneralPortion",
"PortionDesignator","GeneralMappedRegister","GeneralFunction","Dot","Mul","Mux",
"Sum","BiasScale","FinalMappedRegister","FinalCombiner","ClampColorSum","FinalProduct",
"FinalRgbFunction","FinalAlphaFunction","Register", NULL
};
#endif

static const short yyr1[] = {     0,
    36,    37,    37,    37,    37,    37,    37,    38,    39,    39,
    40,    40,    40,    40,    40,    40,    41,    41,    42,    42,
    43,    43,    43,    43,    43,    43,    43,    43,    44,    44,
    44,    44,    44,    44,    44,    44,    45,    46,    46,    47,
    48,    49,    49,    49,    49,    49,    50,    50,    50,    50,
    50,    50,    50,    50,    50,    51,    51,    51,    51,    51,
    51,    51,    51,    51,    51,    51,    51,    51,    51,    51,
    51,    51,    51,    51,    51,    52,    53,    54,    54,    54,
    54,    54,    54,    54,    55,    56,    56
};

static const short yyr2[] = {     0,
     1,     3,     4,     2,     2,     3,     1,    12,     2,     1,
     4,     5,     6,     3,     4,     5,     5,     4,     1,     1,
     1,     2,     4,     5,     4,     5,     4,     4,     2,     2,
     2,     1,     2,     3,     3,     1,     6,     6,     4,     6,
     6,     4,     4,     4,     4,     4,     1,     4,     4,     1,
     4,     4,     1,     4,     4,     2,     3,     3,     4,     4,
     2,     3,     3,     4,     4,     1,     2,     2,     3,     3,
     1,     2,     2,     3,     3,     4,     6,    13,    13,    11,
     6,     8,     4,     6,     4,     1,     1
};

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

static const short yydefgoto[] = {   218,
     7,     8,     9,    10,    21,    22,   141,    76,    77,    78,
   133,   134,   108,    46,    11,    12,    13,    14,    15,    47
};

static const short yypact[] = {     4,
   -17,   -15,    26,    17,    -6,    19,-32768,     4,    68,-32768,
-32768,     8,   113,    57,    67,    58,   133,-32768,-32768,    26,
    98,    93,   104,    66,   133,    68,    68,-32768,-32768,-32768,
    44,    57,    67,    44,    57,    67,-32768,-32768,   118,-32768,
-32768,-32768,-32768,   144,   146,   153,-32768,    81,   127,-32768,
   150,   100,   157,   162,    31,   159,    68,-32768,-32768,    57,
    67,-32768,-32768,    57,    67,-32768,-32768,   161,   152,   160,
   133,   136,-32768,   165,-32768,    97,   100,   100,   155,-32768,
   133,-32768,   133,    77,-32768,-32768,-32768,-32768,-32768,-32768,
   145,   168,   169,   170,   172,   173,   174,   175,-32768,   177,
-32768,-32768,   176,   178,   181,   182,   183,   184,-32768,-32768,
-32768,   100,   125,   179,    27,   185,   186,   187,-32768,-32768,
-32768,-32768,-32768,-32768,-32768,-32768,   188,   190,   192,   193,
   194,-32768,-32768,-32768,   189,   196,   197,   199,   200,    85,
   148,-32768,   133,-32768,   133,   133,-32768,   166,   198,   201,
   202,   203,   204,   106,   100,   100,   100,   100,   209,   210,
-32768,-32768,   125,   125,   206,   208,   211,   212,-32768,-32768,
-32768,-32768,-32768,   213,   214,   217,   218,   219,   220,   100,
   100,   221,   222,   133,-32768,   133,   195,   223,   226,-32768,
-32768,-32768,-32768,   227,   228,-32768,-32768,   229,   230,   231,
   232,   233,-32768,-32768,    39,   133,   234,-32768,-32768,-32768,
   133,   238,-32768,   236,   237,-32768,-32768,   216,   246,-32768
};

static const short yypgoto[] = {-32768,
-32768,    76,     3,    -3,    -4,-32768,   -12,-32768,    94,    96,
-32768,-32768,-32768,   -24,    40,   205,   180,     0,    -9,   -50
};


#define	YYLAST		256


static const short yytable[] = {    55,
    56,    79,    33,    36,    37,    29,    16,     1,    17,     2,
    27,    32,    35,     2,    38,    49,    51,    24,    94,    97,
     3,    61,    62,    29,    65,    66,    79,    79,    57,     1,
    60,    23,    63,    64,     4,    67,     5,     6,    18,    19,
     5,     6,    25,    72,    74,   144,    98,    28,    30,    82,
    87,   145,    83,    29,    89,    84,   114,   210,   115,   117,
    88,   135,   142,   211,    90,    58,    59,   100,    40,    41,
    42,    43,    39,     2,    44,    45,     5,     6,    20,    40,
    41,    42,    43,    26,     3,    44,    45,    40,    41,   161,
     6,   159,   160,    18,    19,    48,    86,    54,     4,     5,
     5,     6,    40,    41,   176,   177,   178,   179,   116,    52,
    18,    19,   142,   142,   102,    50,   174,   175,   165,    53,
   166,   167,   103,   104,   105,   106,   107,    40,    41,   194,
   195,   136,   137,   138,   139,    40,    41,    42,    43,    18,
    19,    44,    45,     4,    73,     5,     6,   140,    18,    19,
   182,   183,    68,    99,    40,    41,    92,    93,    69,   198,
    70,   199,    40,    41,    95,    96,   162,    75,   163,   164,
   109,   111,   110,   112,    71,    80,    81,    85,   113,   118,
    91,   212,   101,   119,   120,   121,   214,   122,   123,   124,
   127,    31,   128,   125,   126,   129,   130,   131,   143,   146,
   168,   132,     0,   149,   147,   150,   148,   151,   152,   153,
   155,   156,   154,   157,   158,   219,   169,    34,     0,   170,
   171,   172,   173,   180,   181,   184,   185,   188,   189,   200,
   186,   187,   190,   191,   192,   193,     0,     0,   201,   196,
   197,   202,   203,   204,   205,   220,   207,     0,     0,   206,
   208,   209,   213,   215,   216,   217
};

static const short yycheck[] = {    24,
    25,    52,    12,    13,    14,     9,    24,     4,    24,     6,
     8,    12,    13,     6,    15,    20,    21,    24,    69,    70,
    17,    31,    32,    27,    34,    35,    77,    78,    26,     4,
    31,    15,    33,    34,    31,    36,    33,    34,    13,    14,
    33,    34,    24,    48,    49,    19,    71,     8,     9,    19,
    60,    25,    22,    57,    64,    25,    81,    19,    83,    84,
    61,   112,   113,    25,    65,    26,    27,    72,     3,     4,
     5,     6,    15,     6,     9,    10,    33,    34,     3,     3,
     4,     5,     6,     8,    17,     9,    10,     3,     4,   140,
    34,     7,     8,    13,    14,    20,    57,    32,    31,    33,
    33,    34,     3,     4,   155,   156,   157,   158,    32,    17,
    13,    14,   163,   164,    18,    18,    11,    12,   143,    16,
   145,   146,    26,    27,    28,    29,    30,     3,     4,   180,
   181,     7,     8,     9,    10,     3,     4,     5,     6,    13,
    14,     9,    10,    31,    18,    33,    34,    23,    13,    14,
   163,   164,    35,    18,     3,     4,     5,     6,    15,   184,
    15,   186,     3,     4,     5,     6,    19,    18,    21,    22,
    77,    78,    77,    78,    22,    19,    15,    19,    24,    35,
    20,   206,    18,    16,    16,    16,   211,    16,    16,    16,
    15,    12,    15,    19,    18,    15,    15,    15,    20,    15,
    35,    18,    -1,    16,    19,    16,    20,    16,    16,    16,
    15,    15,    24,    15,    15,     0,    19,    13,    -1,    19,
    19,    19,    19,    15,    15,    20,    19,    15,    15,    35,
    20,    20,    16,    16,    16,    16,    -1,    -1,    16,    19,
    19,    16,    16,    16,    16,     0,    16,    -1,    -1,    20,
    19,    19,    19,    16,    19,    19
};
/* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
#line 3 "/usr/share/bison.simple"
/* This file comes from bison-1.28.  */

/* Skeleton output parser for bison,
   Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2, or (at your option)
   any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.  */

/* As a special exception, when this file is copied by Bison into a
   Bison output file, you may use that output file without restriction.
   This special exception was added by the Free Software Foundation
   in version 1.24 of Bison.  */

/* This is the parser code that is written into each bison parser
  when the %semantic_parser declaration is not specified in the grammar.
  It was written by Richard Stallman by simplifying the hairy parser
  used when %semantic_parser is specified.  */

#ifndef YYSTACK_USE_ALLOCA
#ifdef alloca
#define YYSTACK_USE_ALLOCA
#else /* alloca not defined */
#ifdef __GNUC__
#define YYSTACK_USE_ALLOCA
#define alloca __builtin_alloca
#else /* not GNU C.  */
#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
#define YYSTACK_USE_ALLOCA
#include <alloca.h>
#else /* not sparc */
/* We think this test detects Watcom and Microsoft C.  */
/* This used to test MSDOS, but that is a bad idea
   since that symbol is in the user namespace.  */
#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
#if 0 /* No need for malloc.h, which pollutes the namespace;
	 instead, just don't use alloca.  */
#include <malloc.h>
#endif
#else /* not MSDOS, or __TURBOC__ */
#if defined(_AIX)
/* I don't know what this was needed for, but it pollutes the namespace.
   So I turned it off.   rms, 2 May 1997.  */
/* #include <malloc.h>  */
 #pragma alloca
#define YYSTACK_USE_ALLOCA
#else /* not MSDOS, or __TURBOC__, or _AIX */
#if 0
#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
		 and on HPUX 10.  Eventually we can turn this on.  */
#define YYSTACK_USE_ALLOCA
#define alloca __builtin_alloca
#endif /* __hpux */
#endif
#endif /* not _AIX */
#endif /* not MSDOS, or __TURBOC__ */
#endif /* not sparc */
#endif /* not GNU C */
#endif /* alloca not defined */
#endif /* YYSTACK_USE_ALLOCA not defined */

#ifdef YYSTACK_USE_ALLOCA
#define YYSTACK_ALLOC alloca
#else
#define YYSTACK_ALLOC malloc
#endif

/* Note: there must be only one dollar sign in this file.
   It is replaced by the list of actions, each action
   as one case of the switch.  */

#define yyerrok		(yyerrstatus = 0)
#define yyclearin	(yychar = YYEMPTY)
#define YYEMPTY		-2
#define YYEOF		0
#define YYACCEPT	goto yyacceptlab
#define YYABORT 	goto yyabortlab
#define YYERROR		goto yyerrlab1
/* Like YYERROR except do call yyerror.
   This remains here temporarily to ease the
   transition to the new meaning of YYERROR, for GCC.
   Once GCC version 2 has supplanted version 1, this can go.  */
#define YYFAIL		goto yyerrlab
#define YYRECOVERING()  (!!yyerrstatus)
#define YYBACKUP(token, value) \
do								\
  if (yychar == YYEMPTY && yylen == 1)				\
    { yychar = (token), yylval = (value);			\
      yychar1 = YYTRANSLATE (yychar);				\

⌨️ 快捷键说明

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