/* A Bison parser, made by GNU Bison 3.8.2.  */

/* Bison implementation for Yacc-like parsers in C

   Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 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 3 of the License, 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, see <https://www.gnu.org/licenses/>.  */

/* As a special exception, you may create a larger work that contains
   part or all of the Bison parser skeleton and distribute that work
   under terms of your choice, so long as that work isn't itself a
   parser generator using the skeleton or a modified version thereof
   as a parser skeleton.  Alternatively, if you modify or redistribute
   the parser skeleton itself, you may (at your option) remove this
   special exception, which will cause the skeleton and the resulting
   Bison output files to be licensed under the GNU General Public
   License without this special exception.

   This special exception was added by the Free Software Foundation in
   version 2.2 of Bison.  */

/* C LALR(1) parser skeleton written by Richard Stallman, by
   simplifying the original so-called "semantic" parser.  */

/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
   especially those whose name start with YY_ or yy_.  They are
   private implementation details that can be changed or removed.  */

/* All symbols defined below should begin with yy or YY, to avoid
   infringing on user name space.  This should be done even for local
   variables, as they might otherwise be expanded by user macros.
   There are some unavoidable exceptions within include files to
   define necessary library symbols; they are noted "INFRINGES ON
   USER NAME SPACE" below.  */

/* Identify Bison output, and Bison version.  */
#define YYBISON 30802

/* Bison version string.  */
#define YYBISON_VERSION "3.8.2"

/* Skeleton name.  */
#define YYSKELETON_NAME "yacc.c"

/* Pure parsers.  */
#define YYPURE 2

/* Push parsers.  */
#define YYPUSH 0

/* Pull parsers.  */
#define YYPULL 1


/* Substitute the variable and function names.  */
#define yyparse         oslparse
#define yylex           osllex
#define yyerror         oslerror
#define yydebug         osldebug
#define yynerrs         oslnerrs

/* First part of user prologue.  */
#line 15 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"


// C++ declarations

#include <iostream>
#include <cstdlib>
#include <vector>
#include <stack>
#include <string>

#include "oslcomp_pvt.h"

#ifdef __clang__
#pragma clang diagnostic ignored "-Wparentheses-equality"
#endif

#if (OSL_CLANG_VERSION >= 150000) || (OSL_APPLE_CLANG_VERSION >= 140000) \
    || (OSL_INTEL_CLANG_VERSION >= 140000)
#pragma clang diagnostic ignored "-Wunused-but-set-variable"
#endif

#if defined(__GNUC__) || defined(__clang__)
#pragma GCC visibility push(hidden)
#endif

using namespace OSL;
using namespace OSL::pvt;

#line 105 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"

# ifndef YY_CAST
#  ifdef __cplusplus
#   define YY_CAST(Type, Val) static_cast<Type> (Val)
#   define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
#  else
#   define YY_CAST(Type, Val) ((Type) (Val))
#   define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
#  endif
# endif
# ifndef YY_NULLPTR
#  if defined __cplusplus
#   if 201103L <= __cplusplus
#    define YY_NULLPTR nullptr
#   else
#    define YY_NULLPTR 0
#   endif
#  else
#   define YY_NULLPTR ((void*)0)
#  endif
# endif

#include "oslgram.hpp"
/* Symbol kind.  */
enum yysymbol_kind_t
{
  YYSYMBOL_YYEMPTY = -2,
  YYSYMBOL_YYEOF = 0,                      /* "end of file"  */
  YYSYMBOL_YYerror = 1,                    /* error  */
  YYSYMBOL_YYUNDEF = 2,                    /* "invalid token"  */
  YYSYMBOL_IDENTIFIER = 3,                 /* IDENTIFIER  */
  YYSYMBOL_STRING_LITERAL = 4,             /* STRING_LITERAL  */
  YYSYMBOL_INT_LITERAL = 5,                /* INT_LITERAL  */
  YYSYMBOL_FLOAT_LITERAL = 6,              /* FLOAT_LITERAL  */
  YYSYMBOL_COLORTYPE = 7,                  /* COLORTYPE  */
  YYSYMBOL_FLOATTYPE = 8,                  /* FLOATTYPE  */
  YYSYMBOL_INTTYPE = 9,                    /* INTTYPE  */
  YYSYMBOL_MATRIXTYPE = 10,                /* MATRIXTYPE  */
  YYSYMBOL_NORMALTYPE = 11,                /* NORMALTYPE  */
  YYSYMBOL_POINTTYPE = 12,                 /* POINTTYPE  */
  YYSYMBOL_STRINGTYPE = 13,                /* STRINGTYPE  */
  YYSYMBOL_VECTORTYPE = 14,                /* VECTORTYPE  */
  YYSYMBOL_VOIDTYPE = 15,                  /* VOIDTYPE  */
  YYSYMBOL_CLOSURE = 16,                   /* CLOSURE  */
  YYSYMBOL_OUTPUT = 17,                    /* OUTPUT  */
  YYSYMBOL_PUBLIC = 18,                    /* PUBLIC  */
  YYSYMBOL_STRUCT = 19,                    /* STRUCT  */
  YYSYMBOL_BREAK = 20,                     /* BREAK  */
  YYSYMBOL_CONTINUE = 21,                  /* CONTINUE  */
  YYSYMBOL_DO = 22,                        /* DO  */
  YYSYMBOL_ELSE = 23,                      /* ELSE  */
  YYSYMBOL_FOR = 24,                       /* FOR  */
  YYSYMBOL_IF_TOKEN = 25,                  /* IF_TOKEN  */
  YYSYMBOL_ILLUMINATE = 26,                /* ILLUMINATE  */
  YYSYMBOL_ILLUMINANCE = 27,               /* ILLUMINANCE  */
  YYSYMBOL_RETURN = 28,                    /* RETURN  */
  YYSYMBOL_WHILE = 29,                     /* WHILE  */
  YYSYMBOL_RESERVED = 30,                  /* RESERVED  */
  YYSYMBOL_31_ = 31,                       /* ','  */
  YYSYMBOL_32_ = 32,                       /* '='  */
  YYSYMBOL_ADD_ASSIGN = 33,                /* ADD_ASSIGN  */
  YYSYMBOL_SUB_ASSIGN = 34,                /* SUB_ASSIGN  */
  YYSYMBOL_MUL_ASSIGN = 35,                /* MUL_ASSIGN  */
  YYSYMBOL_DIV_ASSIGN = 36,                /* DIV_ASSIGN  */
  YYSYMBOL_BIT_AND_ASSIGN = 37,            /* BIT_AND_ASSIGN  */
  YYSYMBOL_BIT_OR_ASSIGN = 38,             /* BIT_OR_ASSIGN  */
  YYSYMBOL_XOR_ASSIGN = 39,                /* XOR_ASSIGN  */
  YYSYMBOL_SHL_ASSIGN = 40,                /* SHL_ASSIGN  */
  YYSYMBOL_SHR_ASSIGN = 41,                /* SHR_ASSIGN  */
  YYSYMBOL_42_ = 42,                       /* '?'  */
  YYSYMBOL_43_ = 43,                       /* ':'  */
  YYSYMBOL_OR_OP = 44,                     /* OR_OP  */
  YYSYMBOL_AND_OP = 45,                    /* AND_OP  */
  YYSYMBOL_46_ = 46,                       /* '|'  */
  YYSYMBOL_47_ = 47,                       /* '^'  */
  YYSYMBOL_48_ = 48,                       /* '&'  */
  YYSYMBOL_EQ_OP = 49,                     /* EQ_OP  */
  YYSYMBOL_NE_OP = 50,                     /* NE_OP  */
  YYSYMBOL_51_ = 51,                       /* '>'  */
  YYSYMBOL_GE_OP = 52,                     /* GE_OP  */
  YYSYMBOL_53_ = 53,                       /* '<'  */
  YYSYMBOL_LE_OP = 54,                     /* LE_OP  */
  YYSYMBOL_SHL_OP = 55,                    /* SHL_OP  */
  YYSYMBOL_SHR_OP = 56,                    /* SHR_OP  */
  YYSYMBOL_57_ = 57,                       /* '+'  */
  YYSYMBOL_58_ = 58,                       /* '-'  */
  YYSYMBOL_59_ = 59,                       /* '*'  */
  YYSYMBOL_60_ = 60,                       /* '/'  */
  YYSYMBOL_61_ = 61,                       /* '%'  */
  YYSYMBOL_UMINUS_PREC = 62,               /* UMINUS_PREC  */
  YYSYMBOL_NOT_OP = 63,                    /* NOT_OP  */
  YYSYMBOL_64_ = 64,                       /* '~'  */
  YYSYMBOL_INCREMENT = 65,                 /* INCREMENT  */
  YYSYMBOL_DECREMENT = 66,                 /* DECREMENT  */
  YYSYMBOL_67_ = 67,                       /* '('  */
  YYSYMBOL_68_ = 68,                       /* ')'  */
  YYSYMBOL_69_ = 69,                       /* '['  */
  YYSYMBOL_70_ = 70,                       /* ']'  */
  YYSYMBOL_METADATA_BEGIN = 71,            /* METADATA_BEGIN  */
  YYSYMBOL_72_ = 72,                       /* '{'  */
  YYSYMBOL_73_ = 73,                       /* '}'  */
  YYSYMBOL_74_ = 74,                       /* ';'  */
  YYSYMBOL_75_ = 75,                       /* '.'  */
  YYSYMBOL_76_ = 76,                       /* '!'  */
  YYSYMBOL_YYACCEPT = 77,                  /* $accept  */
  YYSYMBOL_shader_file = 78,               /* shader_file  */
  YYSYMBOL_global_declarations_opt = 79,   /* global_declarations_opt  */
  YYSYMBOL_global_declarations = 80,       /* global_declarations  */
  YYSYMBOL_global_declaration = 81,        /* global_declaration  */
  YYSYMBOL_shader_or_function_declaration = 82, /* shader_or_function_declaration  */
  YYSYMBOL_83_1 = 83,                      /* $@1  */
  YYSYMBOL_84_2 = 84,                      /* $@2  */
  YYSYMBOL_85_3 = 85,                      /* $@3  */
  YYSYMBOL_formal_params_opt = 86,         /* formal_params_opt  */
  YYSYMBOL_formal_params = 87,             /* formal_params  */
  YYSYMBOL_formal_param = 88,              /* formal_param  */
  YYSYMBOL_metadata_block_opt = 89,        /* metadata_block_opt  */
  YYSYMBOL_metadata = 90,                  /* metadata  */
  YYSYMBOL_metadatum = 91,                 /* metadatum  */
  YYSYMBOL_function_body_or_just_decl = 92, /* function_body_or_just_decl  */
  YYSYMBOL_function_declaration = 93,      /* function_declaration  */
  YYSYMBOL_94_4 = 94,                      /* $@4  */
  YYSYMBOL_struct_declaration = 95,        /* struct_declaration  */
  YYSYMBOL_96_5 = 96,                      /* $@5  */
  YYSYMBOL_field_declarations = 97,        /* field_declarations  */
  YYSYMBOL_field_declaration = 98,         /* field_declaration  */
  YYSYMBOL_typed_field_list = 99,          /* typed_field_list  */
  YYSYMBOL_typed_field = 100,              /* typed_field  */
  YYSYMBOL_local_declaration = 101,        /* local_declaration  */
  YYSYMBOL_variable_declaration = 102,     /* variable_declaration  */
  YYSYMBOL_def_expressions = 103,          /* def_expressions  */
  YYSYMBOL_def_expression = 104,           /* def_expression  */
  YYSYMBOL_initializer_opt = 105,          /* initializer_opt  */
  YYSYMBOL_initializer = 106,              /* initializer  */
  YYSYMBOL_initializer_list_opt = 107,     /* initializer_list_opt  */
  YYSYMBOL_initializer_list = 108,         /* initializer_list  */
  YYSYMBOL_compound_initializer = 109,     /* compound_initializer  */
  YYSYMBOL_init_expression_list = 110,     /* init_expression_list  */
  YYSYMBOL_init_expression_list_rev = 111, /* init_expression_list_rev  */
  YYSYMBOL_init_expression = 112,          /* init_expression  */
  YYSYMBOL_outputspec = 113,               /* outputspec  */
  YYSYMBOL_simple_typename = 114,          /* simple_typename  */
  YYSYMBOL_arrayspec = 115,                /* arrayspec  */
  YYSYMBOL_typespec = 116,                 /* typespec  */
  YYSYMBOL_typespec_or_shadertype = 117,   /* typespec_or_shadertype  */
  YYSYMBOL_statement_list = 118,           /* statement_list  */
  YYSYMBOL_statement = 119,                /* statement  */
  YYSYMBOL_scoped_statements = 120,        /* scoped_statements  */
  YYSYMBOL_121_6 = 121,                    /* $@6  */
  YYSYMBOL_conditional_statement = 122,    /* conditional_statement  */
  YYSYMBOL_loop_statement = 123,           /* loop_statement  */
  YYSYMBOL_124_7 = 124,                    /* $@7  */
  YYSYMBOL_loopmod_statement = 125,        /* loopmod_statement  */
  YYSYMBOL_return_statement = 126,         /* return_statement  */
  YYSYMBOL_for_init_statement = 127,       /* for_init_statement  */
  YYSYMBOL_expression_list = 128,          /* expression_list  */
  YYSYMBOL_expression_opt = 129,           /* expression_opt  */
  YYSYMBOL_compound_expression_opt = 130,  /* compound_expression_opt  */
  YYSYMBOL_compound_expression = 131,      /* compound_expression  */
  YYSYMBOL_expression = 132,               /* expression  */
  YYSYMBOL_variable_lvalue = 133,          /* variable_lvalue  */
  YYSYMBOL_id_or_field = 134,              /* id_or_field  */
  YYSYMBOL_variable_ref = 135,             /* variable_ref  */
  YYSYMBOL_binary_expression = 136,        /* binary_expression  */
  YYSYMBOL_unary_op = 137,                 /* unary_op  */
  YYSYMBOL_incdec_op_opt = 138,            /* incdec_op_opt  */
  YYSYMBOL_incdec_op = 139,                /* incdec_op  */
  YYSYMBOL_type_constructor = 140,         /* type_constructor  */
  YYSYMBOL_function_call = 141,            /* function_call  */
  YYSYMBOL_function_args_opt = 142,        /* function_args_opt  */
  YYSYMBOL_function_args = 143,            /* function_args  */
  YYSYMBOL_assign_expression = 144,        /* assign_expression  */
  YYSYMBOL_ternary_expression = 145,       /* ternary_expression  */
  YYSYMBOL_typecast_expression = 146,      /* typecast_expression  */
  YYSYMBOL_string_literal_group = 147      /* string_literal_group  */
};
typedef enum yysymbol_kind_t yysymbol_kind_t;


/* Second part of user prologue.  */
#line 54 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"

OSL_NAMESPACE_BEGIN
namespace pvt {

int yylex(YYSTYPE* yylval_param, YYLTYPE* yylloc_param, void* yyscanner, OSLCompilerImpl* oslcompiler);
void yyerror (YYLTYPE* yylloc_param, void* yyscanner, OSLCompilerImpl* oslcompiler, const char* err);

TypeDesc osllextype (int lex);

} // namespace pvt
OSL_NAMESPACE_END

#line 299 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"


#ifdef short
# undef short
#endif

/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
   <limits.h> and (if available) <stdint.h> are included
   so that the code can choose integer types of a good width.  */

#ifndef __PTRDIFF_MAX__
# include <limits.h> /* INFRINGES ON USER NAME SPACE */
# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
#  include <stdint.h> /* INFRINGES ON USER NAME SPACE */
#  define YY_STDINT_H
# endif
#endif

/* Narrow types that promote to a signed type and that can represent a
   signed or unsigned integer of at least N bits.  In tables they can
   save space and decrease cache pressure.  Promoting to a signed type
   helps avoid bugs in integer arithmetic.  */

#ifdef __INT_LEAST8_MAX__
typedef __INT_LEAST8_TYPE__ yytype_int8;
#elif defined YY_STDINT_H
typedef int_least8_t yytype_int8;
#else
typedef signed char yytype_int8;
#endif

#ifdef __INT_LEAST16_MAX__
typedef __INT_LEAST16_TYPE__ yytype_int16;
#elif defined YY_STDINT_H
typedef int_least16_t yytype_int16;
#else
typedef short yytype_int16;
#endif

/* Work around bug in HP-UX 11.23, which defines these macros
   incorrectly for preprocessor constants.  This workaround can likely
   be removed in 2023, as HPE has promised support for HP-UX 11.23
   (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
   <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>.  */
#ifdef __hpux
# undef UINT_LEAST8_MAX
# undef UINT_LEAST16_MAX
# define UINT_LEAST8_MAX 255
# define UINT_LEAST16_MAX 65535
#endif

#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
typedef __UINT_LEAST8_TYPE__ yytype_uint8;
#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
       && UINT_LEAST8_MAX <= INT_MAX)
typedef uint_least8_t yytype_uint8;
#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
typedef unsigned char yytype_uint8;
#else
typedef short yytype_uint8;
#endif

#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
typedef __UINT_LEAST16_TYPE__ yytype_uint16;
#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
       && UINT_LEAST16_MAX <= INT_MAX)
typedef uint_least16_t yytype_uint16;
#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
typedef unsigned short yytype_uint16;
#else
typedef int yytype_uint16;
#endif

#ifndef YYPTRDIFF_T
# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
#  define YYPTRDIFF_T __PTRDIFF_TYPE__
#  define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
# elif defined PTRDIFF_MAX
#  ifndef ptrdiff_t
#   include <stddef.h> /* INFRINGES ON USER NAME SPACE */
#  endif
#  define YYPTRDIFF_T ptrdiff_t
#  define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
# else
#  define YYPTRDIFF_T long
#  define YYPTRDIFF_MAXIMUM LONG_MAX
# endif
#endif

#ifndef YYSIZE_T
# ifdef __SIZE_TYPE__
#  define YYSIZE_T __SIZE_TYPE__
# elif defined size_t
#  define YYSIZE_T size_t
# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
#  define YYSIZE_T size_t
# else
#  define YYSIZE_T unsigned
# endif
#endif

#define YYSIZE_MAXIMUM                                  \
  YY_CAST (YYPTRDIFF_T,                                 \
           (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1)  \
            ? YYPTRDIFF_MAXIMUM                         \
            : YY_CAST (YYSIZE_T, -1)))

#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))


/* Stored state numbers (used for stacks). */
typedef yytype_int16 yy_state_t;

/* State numbers in computations.  */
typedef int yy_state_fast_t;

#ifndef YY_
# if defined YYENABLE_NLS && YYENABLE_NLS
#  if ENABLE_NLS
#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
#   define YY_(Msgid) dgettext ("bison-runtime", Msgid)
#  endif
# endif
# ifndef YY_
#  define YY_(Msgid) Msgid
# endif
#endif


#ifndef YY_ATTRIBUTE_PURE
# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
#  define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
# else
#  define YY_ATTRIBUTE_PURE
# endif
#endif

#ifndef YY_ATTRIBUTE_UNUSED
# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
#  define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
# else
#  define YY_ATTRIBUTE_UNUSED
# endif
#endif

/* Suppress unused-variable warnings by "using" E.  */
#if ! defined lint || defined __GNUC__
# define YY_USE(E) ((void) (E))
#else
# define YY_USE(E) /* empty */
#endif

/* Suppress an incorrect diagnostic about yylval being uninitialized.  */
#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
# if __GNUC__ * 100 + __GNUC_MINOR__ < 407
#  define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                           \
    _Pragma ("GCC diagnostic push")                                     \
    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
# else
#  define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                           \
    _Pragma ("GCC diagnostic push")                                     \
    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")              \
    _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
# endif
# define YY_IGNORE_MAYBE_UNINITIALIZED_END      \
    _Pragma ("GCC diagnostic pop")
#else
# define YY_INITIAL_VALUE(Value) Value
#endif
#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
# define YY_IGNORE_MAYBE_UNINITIALIZED_END
#endif
#ifndef YY_INITIAL_VALUE
# define YY_INITIAL_VALUE(Value) /* Nothing. */
#endif

#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
# define YY_IGNORE_USELESS_CAST_BEGIN                          \
    _Pragma ("GCC diagnostic push")                            \
    _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
# define YY_IGNORE_USELESS_CAST_END            \
    _Pragma ("GCC diagnostic pop")
#endif
#ifndef YY_IGNORE_USELESS_CAST_BEGIN
# define YY_IGNORE_USELESS_CAST_BEGIN
# define YY_IGNORE_USELESS_CAST_END
#endif


#define YY_ASSERT(E) ((void) (0 && (E)))

#if !defined yyoverflow

/* The parser invokes alloca or malloc; define the necessary symbols.  */

# ifdef YYSTACK_USE_ALLOCA
#  if YYSTACK_USE_ALLOCA
#   ifdef __GNUC__
#    define YYSTACK_ALLOC __builtin_alloca
#   elif defined __BUILTIN_VA_ARG_INCR
#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
#   elif defined _AIX
#    define YYSTACK_ALLOC __alloca
#   elif defined _MSC_VER
#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
#    define alloca _alloca
#   else
#    define YYSTACK_ALLOC alloca
#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
      /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
#     ifndef EXIT_SUCCESS
#      define EXIT_SUCCESS 0
#     endif
#    endif
#   endif
#  endif
# endif

# ifdef YYSTACK_ALLOC
   /* Pacify GCC's 'empty if-body' warning.  */
#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
#  ifndef YYSTACK_ALLOC_MAXIMUM
    /* The OS might guarantee only one guard page at the bottom of the stack,
       and a page size can be as small as 4096 bytes.  So we cannot safely
       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
       to allow for a few compiler-allocated temporary stack slots.  */
#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
#  endif
# else
#  define YYSTACK_ALLOC YYMALLOC
#  define YYSTACK_FREE YYFREE
#  ifndef YYSTACK_ALLOC_MAXIMUM
#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
#  endif
#  if (defined __cplusplus && ! defined EXIT_SUCCESS \
       && ! ((defined YYMALLOC || defined malloc) \
             && (defined YYFREE || defined free)))
#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
#   ifndef EXIT_SUCCESS
#    define EXIT_SUCCESS 0
#   endif
#  endif
#  ifndef YYMALLOC
#   define YYMALLOC malloc
#   if ! defined malloc && ! defined EXIT_SUCCESS
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
#   endif
#  endif
#  ifndef YYFREE
#   define YYFREE free
#   if ! defined free && ! defined EXIT_SUCCESS
void free (void *); /* INFRINGES ON USER NAME SPACE */
#   endif
#  endif
# endif
#endif /* !defined yyoverflow */

#if (! defined yyoverflow \
     && (! defined __cplusplus \
         || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
             && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))

/* A type that is properly aligned for any stack member.  */
union yyalloc
{
  yy_state_t yyss_alloc;
  YYSTYPE yyvs_alloc;
  YYLTYPE yyls_alloc;
};

/* The size of the maximum gap between one aligned stack and the next.  */
# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)

/* The size of an array large to enough to hold all stacks, each with
   N elements.  */
# define YYSTACK_BYTES(N) \
     ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE) \
             + YYSIZEOF (YYLTYPE)) \
      + 2 * YYSTACK_GAP_MAXIMUM)

# define YYCOPY_NEEDED 1

/* Relocate STACK from its old location to the new one.  The
   local variables YYSIZE and YYSTACKSIZE give the old and new number of
   elements in the stack, and YYPTR gives the new location of the
   stack.  Advance YYPTR to a properly aligned location for the next
   stack.  */
# define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
    do                                                                  \
      {                                                                 \
        YYPTRDIFF_T yynewbytes;                                         \
        YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
        Stack = &yyptr->Stack_alloc;                                    \
        yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
        yyptr += yynewbytes / YYSIZEOF (*yyptr);                        \
      }                                                                 \
    while (0)

#endif

#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
/* Copy COUNT objects from SRC to DST.  The source and destination do
   not overlap.  */
# ifndef YYCOPY
#  if defined __GNUC__ && 1 < __GNUC__
#   define YYCOPY(Dst, Src, Count) \
      __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
#  else
#   define YYCOPY(Dst, Src, Count)              \
      do                                        \
        {                                       \
          YYPTRDIFF_T yyi;                      \
          for (yyi = 0; yyi < (Count); yyi++)   \
            (Dst)[yyi] = (Src)[yyi];            \
        }                                       \
      while (0)
#  endif
# endif
#endif /* !YYCOPY_NEEDED */

/* YYFINAL -- State number of the termination state.  */
#define YYFINAL  23
/* YYLAST -- Last index in YYTABLE.  */
#define YYLAST   735

/* YYNTOKENS -- Number of terminals.  */
#define YYNTOKENS  77
/* YYNNTS -- Number of nonterminals.  */
#define YYNNTS  71
/* YYNRULES -- Number of rules.  */
#define YYNRULES  182
/* YYNSTATES -- Number of states.  */
#define YYNSTATES  311

/* YYMAXUTOK -- Last valid token kind.  */
#define YYMAXUTOK   307


/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
   as returned by yylex, with out-of-bounds checking.  */
#define YYTRANSLATE(YYX)                                \
  (0 <= (YYX) && (YYX) <= YYMAXUTOK                     \
   ? YY_CAST (yysymbol_kind_t, yytranslate[YYX])        \
   : YYSYMBOL_YYUNDEF)

/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
   as returned by yylex.  */
static const yytype_int8 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,    76,     2,     2,     2,    61,    48,     2,
      67,    68,    59,    57,    31,    58,    75,    60,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,    43,    74,
      53,    32,    51,    42,     2,     2,     2,     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,    47,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,    72,    46,    73,    64,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     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,     2,     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,    33,    34,    35,    36,
      37,    38,    39,    40,    41,    44,    45,    49,    50,    52,
      54,    55,    56,    62,    63,    65,    66,    71
};

#if YYDEBUG
/* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
static const yytype_int16 yyrline[] =
{
       0,   140,   140,   144,   145,   149,   150,   154,   155,   160,
     168,   173,   159,   211,   212,   216,   217,   218,   222,   238,
     251,   273,   274,   278,   279,   280,   287,   297,   316,   317,
     322,   321,   342,   341,   363,   364,   368,   372,   373,   377,
     391,   414,   415,   419,   423,   424,   428,   436,   449,   465,
     466,   470,   474,   475,   479,   483,   488,   501,   502,   529,
     530,   545,   546,   554,   555,   559,   560,   561,   562,   563,
     564,   565,   566,   567,   571,   579,   584,   589,   594,   612,
     617,   622,   653,   654,   658,   659,   660,   661,   662,   663,
     664,   665,   670,   669,   681,   686,   694,   701,   709,   708,
     723,   727,   734,   738,   745,   746,   750,   751,   755,   756,
     760,   761,   765,   766,   772,   773,   774,   775,   776,   780,
     781,   796,   811,   812,   813,   814,   815,   819,   820,   825,
     830,   838,   842,   850,   860,   866,   872,   878,   884,   890,
     896,   902,   908,   914,   920,   926,   932,   938,   944,   950,
     956,   962,   971,   972,   973,   974,   975,   979,   980,   984,
     985,   989,   998,  1006,  1007,  1011,  1012,  1013,  1014,  1018,
    1023,  1028,  1033,  1038,  1043,  1048,  1053,  1058,  1063,  1071,
    1079,  1088,  1089
};
#endif

/** Accessing symbol of state STATE.  */
#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])

#if YYDEBUG || 0
/* The user-facing name of the symbol whose (internal) number is
   YYSYMBOL.  No bounds checking.  */
static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;

/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
static const char *const yytname[] =
{
  "\"end of file\"", "error", "\"invalid token\"", "IDENTIFIER",
  "STRING_LITERAL", "INT_LITERAL", "FLOAT_LITERAL", "COLORTYPE",
  "FLOATTYPE", "INTTYPE", "MATRIXTYPE", "NORMALTYPE", "POINTTYPE",
  "STRINGTYPE", "VECTORTYPE", "VOIDTYPE", "CLOSURE", "OUTPUT", "PUBLIC",
  "STRUCT", "BREAK", "CONTINUE", "DO", "ELSE", "FOR", "IF_TOKEN",
  "ILLUMINATE", "ILLUMINANCE", "RETURN", "WHILE", "RESERVED", "','", "'='",
  "ADD_ASSIGN", "SUB_ASSIGN", "MUL_ASSIGN", "DIV_ASSIGN", "BIT_AND_ASSIGN",
  "BIT_OR_ASSIGN", "XOR_ASSIGN", "SHL_ASSIGN", "SHR_ASSIGN", "'?'", "':'",
  "OR_OP", "AND_OP", "'|'", "'^'", "'&'", "EQ_OP", "NE_OP", "'>'", "GE_OP",
  "'<'", "LE_OP", "SHL_OP", "SHR_OP", "'+'", "'-'", "'*'", "'/'", "'%'",
  "UMINUS_PREC", "NOT_OP", "'~'", "INCREMENT", "DECREMENT", "'('", "')'",
  "'['", "']'", "METADATA_BEGIN", "'{'", "'}'", "';'", "'.'", "'!'",
  "$accept", "shader_file", "global_declarations_opt",
  "global_declarations", "global_declaration",
  "shader_or_function_declaration", "$@1", "$@2", "$@3",
  "formal_params_opt", "formal_params", "formal_param",
  "metadata_block_opt", "metadata", "metadatum",
  "function_body_or_just_decl", "function_declaration", "$@4",
  "struct_declaration", "$@5", "field_declarations", "field_declaration",
  "typed_field_list", "typed_field", "local_declaration",
  "variable_declaration", "def_expressions", "def_expression",
  "initializer_opt", "initializer", "initializer_list_opt",
  "initializer_list", "compound_initializer", "init_expression_list",
  "init_expression_list_rev", "init_expression", "outputspec",
  "simple_typename", "arrayspec", "typespec", "typespec_or_shadertype",
  "statement_list", "statement", "scoped_statements", "$@6",
  "conditional_statement", "loop_statement", "$@7", "loopmod_statement",
  "return_statement", "for_init_statement", "expression_list",
  "expression_opt", "compound_expression_opt", "compound_expression",
  "expression", "variable_lvalue", "id_or_field", "variable_ref",
  "binary_expression", "unary_op", "incdec_op_opt", "incdec_op",
  "type_constructor", "function_call", "function_args_opt",
  "function_args", "assign_expression", "ternary_expression",
  "typecast_expression", "string_literal_group", YY_NULLPTR
};

static const char *
yysymbol_name (yysymbol_kind_t yysymbol)
{
  return yytname[yysymbol];
}
#endif

#define YYPACT_NINF (-222)

#define yypact_value_is_default(Yyn) \
  ((Yyn) == YYPACT_NINF)

#define YYTABLE_NINF (-79)

#define yytable_value_is_error(Yyn) \
  0

/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
   STATE-NUM.  */
static const yytype_int16 yypact[] =
{
     450,  -222,  -222,  -222,  -222,  -222,  -222,  -222,  -222,  -222,
    -222,   146,    20,    30,  -222,   450,  -222,  -222,  -222,  -222,
      28,  -222,   -35,  -222,  -222,  -222,  -222,   -33,   695,   146,
       7,  -222,   146,   135,  -222,  -222,    63,   -17,  -222,    73,
    -222,  -222,    38,  -222,    47,   -14,  -222,   146,    50,    -5,
      -1,  -222,     1,  -222,    63,  -222,  -222,  -222,   414,  -222,
      90,  -222,    55,    93,  -222,   695,    56,  -222,  -222,    58,
    -222,  -222,  -222,  -222,  -222,  -222,  -222,  -222,  -222,   414,
    -222,    60,   574,   180,    61,  -222,  -222,   414,   126,  -222,
    -222,  -222,  -222,  -222,   127,    62,  -222,  -222,    -7,   129,
    -222,   340,   -42,    65,   451,   414,   414,   414,   414,   414,
     414,   414,   414,   414,   414,   414,   414,   414,   414,   414,
     414,   414,   414,   414,   414,   414,   414,   414,   414,   414,
     414,   414,   414,   414,   414,   133,  -222,  -222,   414,  -222,
    -222,    64,  -222,   306,  -222,   -33,  -222,     3,  -222,   574,
      69,   132,   414,  -222,   414,    84,   574,   554,   591,   607,
     622,   636,   663,   674,   674,   -15,   -15,   -15,   -15,    -9,
      -9,     9,     9,  -222,  -222,  -222,   574,   574,   574,   574,
     574,   574,   574,   574,   574,   574,  -222,   471,  -222,  -222,
      91,   134,   136,   574,   -52,   340,   -33,  -222,   -33,  -222,
      90,  -222,   340,  -222,  -222,   414,  -222,   414,    97,  -222,
     340,   266,  -222,  -222,  -222,  -222,   -33,  -222,   574,   574,
     574,   414,   137,     6,    95,    96,   266,   105,   106,   340,
     107,  -222,  -222,  -222,  -222,  -222,    60,   172,   104,   266,
    -222,  -222,  -222,  -222,  -222,   108,  -222,   498,  -222,  -222,
     150,  -222,   414,   110,   111,   574,   414,   266,   -11,   -12,
    -222,  -222,  -222,  -222,   118,   121,   380,   122,  -222,  -222,
     123,   116,   125,  -222,  -222,    90,   190,  -222,   414,   414,
    -222,   190,   414,   120,   266,   266,  -222,    -1,  -222,     3,
    -222,   525,   128,   124,  -222,  -222,   177,  -222,   139,  -222,
     130,   414,   266,   -33,  -222,   141,  -222,   -52,   266,  -222,
    -222
};

/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
   Performed when YYTABLE does not specify something else to do.  Zero
   means the default is an error.  */
static const yytype_uint8 yydefact[] =
{
       4,    81,    65,    66,    67,    68,    69,    70,    71,    72,
      73,     0,     0,     0,     2,     3,     5,     7,     8,    79,
       0,    80,     0,     1,     6,     9,    32,    22,     0,     0,
       0,    78,     0,     0,    34,    76,     0,     0,    23,     0,
      10,    77,     0,    35,    39,     0,    37,    25,     0,     0,
      64,    33,     0,    40,     0,    36,    24,    21,     0,    26,
       0,    63,     0,    13,    15,     0,     0,    75,    38,   131,
     181,   114,   115,   153,   152,   155,   156,   159,   160,     0,
     154,     0,    51,   158,   127,   117,   119,     0,     0,   126,
     122,   123,   124,   125,   116,     0,    27,    11,    64,     0,
      74,   164,     0,     0,   112,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,   133,   157,     0,   120,
     131,   118,   182,     0,    54,    22,    16,    50,   166,   165,
       0,   163,     0,   121,     0,     0,   106,     0,   134,   135,
     136,   137,   138,   139,   140,   141,   142,   143,   144,   145,
     146,   147,   148,   149,   150,   151,   169,   172,   173,   170,
     171,   174,   175,   176,   177,   178,   132,     0,    56,    62,
       0,     0,    57,    61,     0,     0,    22,    49,    22,    52,
      53,   162,     0,   180,   113,     0,   161,     0,   128,    55,
       0,    83,    29,    12,    18,    20,    22,   168,   167,   107,
     179,     0,    58,   131,     0,     0,     0,     0,     0,   109,
       0,    92,    91,    41,    89,    42,    76,     0,     0,    83,
      84,    85,    86,    87,    88,     0,    19,     0,   100,   101,
       0,    98,     0,     0,     0,   108,     0,    83,    50,     0,
      44,    28,    82,    90,   129,     0,   109,     0,   103,   102,
       0,     0,     0,    46,    48,    53,     0,    43,     0,     0,
     105,     0,   111,     0,     0,     0,    93,    64,    47,    50,
      45,     0,     0,     0,   110,   104,    94,    96,     0,   130,
       0,   111,     0,    22,    97,     0,    95,     0,     0,    31,
      99
};

/* YYPGOTO[NTERM-NUM].  */
static const yytype_int16 yypgoto[] =
{
    -222,  -222,  -222,  -222,   186,  -222,  -222,  -222,  -222,   -92,
    -222,   112,  -141,  -222,   155,   -85,  -222,  -222,  -222,  -222,
    -222,   191,  -222,   169,  -222,   -39,  -222,   -48,    82,   182,
    -195,   -59,   -89,  -222,  -222,    22,  -222,     0,   -36,   -26,
    -222,  -221,  -167,  -222,  -222,  -222,  -222,  -222,  -222,  -222,
    -222,  -222,   -32,   -68,   -76,   -24,   147,  -222,  -222,  -222,
    -222,  -222,   153,  -222,  -222,  -222,  -222,  -222,  -222,  -222,
    -222
};

/* YYDEFGOTO[NTERM-NUM].  */
static const yytype_int16 yydefgoto[] =
{
       0,    13,    14,    15,    16,    17,    27,    50,   145,    62,
      63,    64,    30,    37,    38,   213,   233,   272,    18,    28,
      33,    34,    45,    46,   234,   235,   259,   260,   273,   197,
     198,   199,   144,   190,   191,   192,    65,    81,   275,   237,
      20,   238,   239,   240,   257,   241,   242,   266,   243,   244,
     282,   155,   254,   293,   245,   104,    83,    84,    85,    86,
      87,   136,    88,    89,    90,   150,   151,    91,    92,    93,
      94
};

/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
   positive, shift that token.  If negative, reduce the rule whose
   number is the opposite.  If YYTABLE_NINF, syntax error.  */
static const yytype_int16 yytable[] =
{
      19,    96,    36,   103,   194,   216,    66,    36,    53,   -78,
      61,    21,   148,    60,    47,    19,    61,    54,   262,   276,
     211,   195,   212,    22,   -17,   105,   152,    58,    35,    39,
      23,    25,    41,    35,    82,   195,   271,    26,    29,    99,
     118,   119,   120,   121,   122,   123,   124,    39,   120,   121,
     122,   123,   124,    48,   189,   214,   -30,   215,    52,   250,
      55,   -17,   277,   139,    52,    35,    44,   -14,   122,   123,
     124,    67,    52,   101,    40,   246,    49,   149,   204,   102,
     288,   156,   157,   158,   159,   160,   161,   162,   163,   164,
     165,   166,   167,   168,   169,   170,   171,   172,   173,   174,
     175,   176,   177,   178,   179,   180,   181,   182,   183,   184,
     185,   200,    51,   217,   187,   205,    52,   296,   297,   193,
      57,   189,    95,    97,    98,   101,   100,   105,   203,   140,
     138,   142,   147,   153,   143,   306,   186,   201,    31,   135,
     253,   310,     2,     3,     4,     5,     6,     7,     8,     9,
      10,    32,   206,     2,     3,     4,     5,     6,     7,     8,
       9,    10,   307,   202,   209,   210,   221,   -59,   -60,   248,
     249,    82,   251,   252,   256,   258,   267,   261,   218,   265,
     270,   219,   263,   220,   268,   269,   193,   278,   279,   286,
     284,   285,   287,   289,   295,   298,   300,   247,   301,   274,
     302,    24,    56,   292,   304,   255,   294,   303,    42,   308,
     146,   236,   125,   126,   127,   128,   129,   130,   131,   132,
     133,   134,   309,    68,    43,   294,   236,   280,   290,   196,
     274,    59,   222,   305,   283,   141,   137,     0,     0,   236,
     281,     0,   255,     0,     0,    77,    78,     0,     0,     0,
       0,     0,     0,     0,   291,   135,     0,   236,     0,     0,
       0,     0,     0,     0,     0,     0,   236,     0,     0,   223,
      70,    71,    72,     2,     3,     4,     5,     6,     7,     8,
       9,    10,    32,     0,   236,   236,   224,   225,   226,     0,
     227,   228,     0,     0,   229,   230,     0,     0,     0,     0,
       0,     0,   236,     0,     0,     0,     0,     0,   236,    69,
      70,    71,    72,     2,     3,     4,     5,     6,     7,     8,
       9,    10,     0,    73,    74,     0,     0,     0,     0,    75,
      76,    77,    78,    79,     0,     0,     0,     0,   231,     0,
     232,     0,    80,    69,    70,    71,    72,     2,     3,     4,
       5,     6,     7,     8,     9,    10,     0,     0,     0,     0,
       0,     0,     0,    73,    74,     0,     0,     0,     0,    75,
      76,    77,    78,    79,     0,     0,     0,     0,   143,   188,
       0,     0,    80,   223,    70,    71,    72,     2,     3,     4,
       5,     6,     7,     8,     9,    10,    32,    73,    74,     0,
       0,     0,     0,    75,    76,    77,    78,    79,     0,     0,
       0,     0,   143,     0,     0,     0,    80,    69,    70,    71,
      72,     2,     3,     4,     5,     6,     7,     8,     9,    10,
       0,     0,     0,     0,     0,     0,     0,    73,    74,     0,
       0,     0,     0,    75,    76,    77,    78,    79,     0,     0,
       0,     0,     0,     1,     0,     0,    80,     2,     3,     4,
       5,     6,     7,     8,     9,    10,    11,     0,     0,    12,
       0,    73,    74,     0,     0,     0,     0,    75,    76,    77,
      78,    79,   154,     0,     0,     0,     0,     0,     0,     0,
      80,     0,     0,   106,     0,   107,   108,   109,   110,   111,
     112,   113,   114,   115,   116,   117,   118,   119,   120,   121,
     122,   123,   124,   106,     0,   107,   108,   109,   110,   111,
     112,   113,   114,   115,   116,   117,   118,   119,   120,   121,
     122,   123,   124,     0,     0,     0,     0,     0,     0,     0,
     106,   208,   107,   108,   109,   110,   111,   112,   113,   114,
     115,   116,   117,   118,   119,   120,   121,   122,   123,   124,
       0,     0,     0,     0,     0,     0,     0,   106,   264,   107,
     108,   109,   110,   111,   112,   113,   114,   115,   116,   117,
     118,   119,   120,   121,   122,   123,   124,     0,     0,     0,
       0,     0,     0,     0,     0,   299,   106,   207,   107,   108,
     109,   110,   111,   112,   113,   114,   115,   116,   117,   118,
     119,   120,   121,   122,   123,   124,   106,     0,   107,   108,
     109,   110,   111,   112,   113,   114,   115,   116,   117,   118,
     119,   120,   121,   122,   123,   124,   108,   109,   110,   111,
     112,   113,   114,   115,   116,   117,   118,   119,   120,   121,
     122,   123,   124,   109,   110,   111,   112,   113,   114,   115,
     116,   117,   118,   119,   120,   121,   122,   123,   124,   110,
     111,   112,   113,   114,   115,   116,   117,   118,   119,   120,
     121,   122,   123,   124,   111,   112,   113,   114,   115,   116,
     117,   118,   119,   120,   121,   122,   123,   124,    31,     0,
       0,     0,     2,     3,     4,     5,     6,     7,     8,     9,
      10,    32,   112,   113,   114,   115,   116,   117,   118,   119,
     120,   121,   122,   123,   124,   114,   115,   116,   117,   118,
     119,   120,   121,   122,   123,   124
};

static const yytype_int16 yycheck[] =
{
       0,    60,    28,    79,   145,   200,     5,    33,    44,     3,
      17,    11,   101,    49,    31,    15,    17,    31,   239,    31,
      72,    32,    74,     3,    31,    67,    68,    32,    28,    29,
       0,     3,    32,    33,    58,    32,   257,    72,    71,    65,
      55,    56,    57,    58,    59,    60,    61,    47,    57,    58,
      59,    60,    61,    70,   143,   196,    67,   198,    69,   226,
      74,    68,    74,    87,    69,    65,     3,    68,    59,    60,
      61,    70,    69,    67,    67,   216,     3,   101,   154,    79,
     275,   105,   106,   107,   108,   109,   110,   111,   112,   113,
     114,   115,   116,   117,   118,   119,   120,   121,   122,   123,
     124,   125,   126,   127,   128,   129,   130,   131,   132,   133,
     134,   147,    74,   202,   138,    31,    69,   284,   285,   143,
      70,   210,    32,    68,    31,    67,    70,    67,   152,     3,
      69,     4,     3,    68,    72,   302,     3,    68,     3,    75,
     229,   308,     7,     8,     9,    10,    11,    12,    13,    14,
      15,    16,    68,     7,     8,     9,    10,    11,    12,    13,
      14,    15,   303,    31,    73,    31,    69,    31,    31,    74,
      74,   195,    67,    67,    67,     3,   252,    73,   202,    29,
     256,   205,    74,   207,    74,    74,   210,    69,    67,    73,
      68,    68,    67,     3,    74,   287,    68,   221,    74,   258,
      23,    15,    47,   279,    74,   229,   282,    68,    73,    68,
      98,   211,    32,    33,    34,    35,    36,    37,    38,    39,
      40,    41,   307,    54,    33,   301,   226,   266,   276,   147,
     289,    49,   210,   301,   266,    88,    83,    -1,    -1,   239,
     266,    -1,   266,    -1,    -1,    65,    66,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,   278,    75,    -1,   257,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,   266,    -1,    -1,     3,
       4,     5,     6,     7,     8,     9,    10,    11,    12,    13,
      14,    15,    16,    -1,   284,   285,    20,    21,    22,    -1,
      24,    25,    -1,    -1,    28,    29,    -1,    -1,    -1,    -1,
      -1,    -1,   302,    -1,    -1,    -1,    -1,    -1,   308,     3,
       4,     5,     6,     7,     8,     9,    10,    11,    12,    13,
      14,    15,    -1,    57,    58,    -1,    -1,    -1,    -1,    63,
      64,    65,    66,    67,    -1,    -1,    -1,    -1,    72,    -1,
      74,    -1,    76,     3,     4,     5,     6,     7,     8,     9,
      10,    11,    12,    13,    14,    15,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    57,    58,    -1,    -1,    -1,    -1,    63,
      64,    65,    66,    67,    -1,    -1,    -1,    -1,    72,    73,
      -1,    -1,    76,     3,     4,     5,     6,     7,     8,     9,
      10,    11,    12,    13,    14,    15,    16,    57,    58,    -1,
      -1,    -1,    -1,    63,    64,    65,    66,    67,    -1,    -1,
      -1,    -1,    72,    -1,    -1,    -1,    76,     3,     4,     5,
       6,     7,     8,     9,    10,    11,    12,    13,    14,    15,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    57,    58,    -1,
      -1,    -1,    -1,    63,    64,    65,    66,    67,    -1,    -1,
      -1,    -1,    -1,     3,    -1,    -1,    76,     7,     8,     9,
      10,    11,    12,    13,    14,    15,    16,    -1,    -1,    19,
      -1,    57,    58,    -1,    -1,    -1,    -1,    63,    64,    65,
      66,    67,    31,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      76,    -1,    -1,    42,    -1,    44,    45,    46,    47,    48,
      49,    50,    51,    52,    53,    54,    55,    56,    57,    58,
      59,    60,    61,    42,    -1,    44,    45,    46,    47,    48,
      49,    50,    51,    52,    53,    54,    55,    56,    57,    58,
      59,    60,    61,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      42,    70,    44,    45,    46,    47,    48,    49,    50,    51,
      52,    53,    54,    55,    56,    57,    58,    59,    60,    61,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    42,    70,    44,
      45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
      55,    56,    57,    58,    59,    60,    61,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    70,    42,    43,    44,    45,
      46,    47,    48,    49,    50,    51,    52,    53,    54,    55,
      56,    57,    58,    59,    60,    61,    42,    -1,    44,    45,
      46,    47,    48,    49,    50,    51,    52,    53,    54,    55,
      56,    57,    58,    59,    60,    61,    45,    46,    47,    48,
      49,    50,    51,    52,    53,    54,    55,    56,    57,    58,
      59,    60,    61,    46,    47,    48,    49,    50,    51,    52,
      53,    54,    55,    56,    57,    58,    59,    60,    61,    47,
      48,    49,    50,    51,    52,    53,    54,    55,    56,    57,
      58,    59,    60,    61,    48,    49,    50,    51,    52,    53,
      54,    55,    56,    57,    58,    59,    60,    61,     3,    -1,
      -1,    -1,     7,     8,     9,    10,    11,    12,    13,    14,
      15,    16,    49,    50,    51,    52,    53,    54,    55,    56,
      57,    58,    59,    60,    61,    51,    52,    53,    54,    55,
      56,    57,    58,    59,    60,    61
};

/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
   state STATE-NUM.  */
static const yytype_uint8 yystos[] =
{
       0,     3,     7,     8,     9,    10,    11,    12,    13,    14,
      15,    16,    19,    78,    79,    80,    81,    82,    95,   114,
     117,   114,     3,     0,    81,     3,    72,    83,    96,    71,
      89,     3,    16,    97,    98,   114,   116,    90,    91,   114,
      67,   114,    73,    98,     3,    99,   100,    31,    70,     3,
      84,    74,    69,   115,    31,    74,    91,    70,    32,   106,
     115,    17,    86,    87,    88,   113,     5,    70,   100,     3,
       4,     5,     6,    57,    58,    63,    64,    65,    66,    67,
      76,   114,   132,   133,   134,   135,   136,   137,   139,   140,
     141,   144,   145,   146,   147,    32,   108,    68,    31,   116,
      70,    67,   114,   131,   132,    67,    42,    44,    45,    46,
      47,    48,    49,    50,    51,    52,    53,    54,    55,    56,
      57,    58,    59,    60,    61,    32,    33,    34,    35,    36,
      37,    38,    39,    40,    41,    75,   138,   139,    69,   132,
       3,   133,     4,    72,   109,    85,    88,     3,   109,   132,
     142,   143,    68,    68,    31,   128,   132,   132,   132,   132,
     132,   132,   132,   132,   132,   132,   132,   132,   132,   132,
     132,   132,   132,   132,   132,   132,   132,   132,   132,   132,
     132,   132,   132,   132,   132,   132,     3,   132,    73,   109,
     110,   111,   112,   132,    89,    32,   105,   106,   107,   108,
     115,    68,    31,   132,   131,    31,    68,    43,    70,    73,
      31,    72,    74,    92,    89,    89,   107,   109,   132,   132,
     132,    69,   112,     3,    20,    21,    22,    24,    25,    28,
      29,    72,    74,    93,   101,   102,   114,   116,   118,   119,
     120,   122,   123,   125,   126,   131,    89,   132,    74,    74,
     119,    67,    67,   109,   129,   132,    67,   121,     3,   103,
     104,    73,   118,    74,    70,    29,   124,   131,    74,    74,
     131,   118,    94,   105,   108,   115,    31,    74,    69,    67,
     102,   116,   127,   129,    68,    68,    73,    67,   107,     3,
     104,   132,   131,   130,   131,    74,   119,   119,    86,    70,
      68,    74,    23,    68,    74,   130,   119,    89,    68,    92,
     119
};

/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM.  */
static const yytype_uint8 yyr1[] =
{
       0,    77,    78,    79,    79,    80,    80,    81,    81,    83,
      84,    85,    82,    86,    86,    87,    87,    87,    88,    88,
      88,    89,    89,    90,    90,    90,    91,    91,    92,    92,
      94,    93,    96,    95,    97,    97,    98,    99,    99,   100,
     100,   101,   101,   102,   103,   103,   104,   104,   104,   105,
     105,   106,   107,   107,   108,   109,   109,   110,   110,   111,
     111,   112,   112,   113,   113,   114,   114,   114,   114,   114,
     114,   114,   114,   114,   115,   115,   116,   116,   116,   117,
     117,   117,   118,   118,   119,   119,   119,   119,   119,   119,
     119,   119,   121,   120,   122,   122,   123,   123,   124,   123,
     125,   125,   126,   126,   127,   127,   128,   128,   129,   129,
     130,   130,   131,   131,   132,   132,   132,   132,   132,   132,
     132,   132,   132,   132,   132,   132,   132,   133,   133,   133,
     133,   134,   134,   135,   136,   136,   136,   136,   136,   136,
     136,   136,   136,   136,   136,   136,   136,   136,   136,   136,
     136,   136,   137,   137,   137,   137,   137,   138,   138,   139,
     139,   140,   141,   142,   142,   143,   143,   143,   143,   144,
     144,   144,   144,   144,   144,   144,   144,   144,   144,   145,
     146,   147,   147
};

/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM.  */
static const yytype_int8 yyr2[] =
{
       0,     2,     1,     1,     0,     1,     2,     1,     1,     0,
       0,     0,    11,     1,     0,     1,     3,     2,     5,     6,
       5,     4,     0,     1,     3,     2,     3,     4,     3,     1,
       0,     8,     0,     7,     1,     2,     3,     1,     3,     1,
       2,     1,     1,     3,     1,     3,     2,     3,     2,     1,
       0,     2,     1,     0,     2,     3,     2,     1,     3,     1,
       3,     1,     1,     1,     0,     1,     1,     1,     1,     1,
       1,     1,     1,     1,     3,     2,     1,     2,     1,     1,
       2,     1,     2,     0,     1,     1,     1,     1,     1,     1,
       2,     1,     0,     4,     5,     7,     5,     7,     0,     9,
       2,     2,     3,     3,     2,     1,     1,     3,     1,     0,
       1,     0,     1,     3,     1,     1,     1,     1,     2,     1,
       2,     3,     1,     1,     1,     1,     1,     1,     4,     7,
      10,     1,     3,     2,     3,     3,     3,     3,     3,     3,
       3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
       3,     3,     1,     1,     1,     1,     1,     1,     0,     1,
       1,     4,     4,     1,     0,     1,     1,     3,     3,     3,
       3,     3,     3,     3,     3,     3,     3,     3,     3,     5,
       4,     1,     2
};


enum { YYENOMEM = -2 };

#define yyerrok         (yyerrstatus = 0)
#define yyclearin       (yychar = YYEMPTY)

#define YYACCEPT        goto yyacceptlab
#define YYABORT         goto yyabortlab
#define YYERROR         goto yyerrorlab
#define YYNOMEM         goto yyexhaustedlab


#define YYRECOVERING()  (!!yyerrstatus)

#define YYBACKUP(Token, Value)                                    \
  do                                                              \
    if (yychar == YYEMPTY)                                        \
      {                                                           \
        yychar = (Token);                                         \
        yylval = (Value);                                         \
        YYPOPSTACK (yylen);                                       \
        yystate = *yyssp;                                         \
        goto yybackup;                                            \
      }                                                           \
    else                                                          \
      {                                                           \
        yyerror (&yylloc, scanner, oslcompiler, YY_("syntax error: cannot back up")); \
        YYERROR;                                                  \
      }                                                           \
  while (0)

/* Backward compatibility with an undocumented macro.
   Use YYerror or YYUNDEF. */
#define YYERRCODE YYUNDEF

/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
   If N is 0, then set CURRENT to the empty location which ends
   the previous symbol: RHS[0] (always defined).  */

#ifndef YYLLOC_DEFAULT
# define YYLLOC_DEFAULT(Current, Rhs, N)                                \
    do                                                                  \
      if (N)                                                            \
        {                                                               \
          (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
          (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
          (Current).last_line    = YYRHSLOC (Rhs, N).last_line;         \
          (Current).last_column  = YYRHSLOC (Rhs, N).last_column;       \
        }                                                               \
      else                                                              \
        {                                                               \
          (Current).first_line   = (Current).last_line   =              \
            YYRHSLOC (Rhs, 0).last_line;                                \
          (Current).first_column = (Current).last_column =              \
            YYRHSLOC (Rhs, 0).last_column;                              \
        }                                                               \
    while (0)
#endif

#define YYRHSLOC(Rhs, K) ((Rhs)[K])


/* Enable debugging if requested.  */
#if YYDEBUG

# ifndef YYFPRINTF
#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
#  define YYFPRINTF fprintf
# endif

# define YYDPRINTF(Args)                        \
do {                                            \
  if (yydebug)                                  \
    YYFPRINTF Args;                             \
} while (0)


/* YYLOCATION_PRINT -- Print the location on the stream.
   This macro was not mandated originally: define only if we know
   we won't break user code: when these are the locations we know.  */

# ifndef YYLOCATION_PRINT

#  if defined YY_LOCATION_PRINT

   /* Temporary convenience wrapper in case some people defined the
      undocumented and private YY_LOCATION_PRINT macros.  */
#   define YYLOCATION_PRINT(File, Loc)  YY_LOCATION_PRINT(File, *(Loc))

#  elif defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL

/* Print *YYLOCP on YYO.  Private, do not rely on its existence. */

YY_ATTRIBUTE_UNUSED
static int
yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
{
  int res = 0;
  int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
  if (0 <= yylocp->first_line)
    {
      res += YYFPRINTF (yyo, "%d", yylocp->first_line);
      if (0 <= yylocp->first_column)
        res += YYFPRINTF (yyo, ".%d", yylocp->first_column);
    }
  if (0 <= yylocp->last_line)
    {
      if (yylocp->first_line < yylocp->last_line)
        {
          res += YYFPRINTF (yyo, "-%d", yylocp->last_line);
          if (0 <= end_col)
            res += YYFPRINTF (yyo, ".%d", end_col);
        }
      else if (0 <= end_col && yylocp->first_column < end_col)
        res += YYFPRINTF (yyo, "-%d", end_col);
    }
  return res;
}

#   define YYLOCATION_PRINT  yy_location_print_

    /* Temporary convenience wrapper in case some people defined the
       undocumented and private YY_LOCATION_PRINT macros.  */
#   define YY_LOCATION_PRINT(File, Loc)  YYLOCATION_PRINT(File, &(Loc))

#  else

#   define YYLOCATION_PRINT(File, Loc) ((void) 0)
    /* Temporary convenience wrapper in case some people defined the
       undocumented and private YY_LOCATION_PRINT macros.  */
#   define YY_LOCATION_PRINT  YYLOCATION_PRINT

#  endif
# endif /* !defined YYLOCATION_PRINT */


# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)                    \
do {                                                                      \
  if (yydebug)                                                            \
    {                                                                     \
      YYFPRINTF (stderr, "%s ", Title);                                   \
      yy_symbol_print (stderr,                                            \
                  Kind, Value, Location, scanner, oslcompiler); \
      YYFPRINTF (stderr, "\n");                                           \
    }                                                                     \
} while (0)


/*-----------------------------------.
| Print this symbol's value on YYO.  |
`-----------------------------------*/

static void
yy_symbol_value_print (FILE *yyo,
                       yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, void *scanner, OSL::pvt::OSLCompilerImpl *oslcompiler)
{
  FILE *yyoutput = yyo;
  YY_USE (yyoutput);
  YY_USE (yylocationp);
  YY_USE (scanner);
  YY_USE (oslcompiler);
  if (!yyvaluep)
    return;
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  YY_USE (yykind);
  YY_IGNORE_MAYBE_UNINITIALIZED_END
}


/*---------------------------.
| Print this symbol on YYO.  |
`---------------------------*/

static void
yy_symbol_print (FILE *yyo,
                 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, void *scanner, OSL::pvt::OSLCompilerImpl *oslcompiler)
{
  YYFPRINTF (yyo, "%s %s (",
             yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));

  YYLOCATION_PRINT (yyo, yylocationp);
  YYFPRINTF (yyo, ": ");
  yy_symbol_value_print (yyo, yykind, yyvaluep, yylocationp, scanner, oslcompiler);
  YYFPRINTF (yyo, ")");
}

/*------------------------------------------------------------------.
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
| TOP (included).                                                   |
`------------------------------------------------------------------*/

static void
yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
{
  YYFPRINTF (stderr, "Stack now");
  for (; yybottom <= yytop; yybottom++)
    {
      int yybot = *yybottom;
      YYFPRINTF (stderr, " %d", yybot);
    }
  YYFPRINTF (stderr, "\n");
}

# define YY_STACK_PRINT(Bottom, Top)                            \
do {                                                            \
  if (yydebug)                                                  \
    yy_stack_print ((Bottom), (Top));                           \
} while (0)


/*------------------------------------------------.
| Report that the YYRULE is going to be reduced.  |
`------------------------------------------------*/

static void
yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp,
                 int yyrule, void *scanner, OSL::pvt::OSLCompilerImpl *oslcompiler)
{
  int yylno = yyrline[yyrule];
  int yynrhs = yyr2[yyrule];
  int yyi;
  YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
             yyrule - 1, yylno);
  /* The symbols being reduced.  */
  for (yyi = 0; yyi < yynrhs; yyi++)
    {
      YYFPRINTF (stderr, "   $%d = ", yyi + 1);
      yy_symbol_print (stderr,
                       YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
                       &yyvsp[(yyi + 1) - (yynrhs)],
                       &(yylsp[(yyi + 1) - (yynrhs)]), scanner, oslcompiler);
      YYFPRINTF (stderr, "\n");
    }
}

# define YY_REDUCE_PRINT(Rule)          \
do {                                    \
  if (yydebug)                          \
    yy_reduce_print (yyssp, yyvsp, yylsp, Rule, scanner, oslcompiler); \
} while (0)

/* Nonzero means print parse trace.  It is left uninitialized so that
   multiple parsers can coexist.  */
int yydebug;
#else /* !YYDEBUG */
# define YYDPRINTF(Args) ((void) 0)
# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
# define YY_STACK_PRINT(Bottom, Top)
# define YY_REDUCE_PRINT(Rule)
#endif /* !YYDEBUG */


/* YYINITDEPTH -- initial size of the parser's stacks.  */
#ifndef YYINITDEPTH
# define YYINITDEPTH 200
#endif

/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
   if the built-in stack extension method is used).

   Do not make this value too large; the results are undefined if
   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
   evaluated with infinite-precision integer arithmetic.  */

#ifndef YYMAXDEPTH
# define YYMAXDEPTH 10000
#endif






/*-----------------------------------------------.
| Release the memory associated to this symbol.  |
`-----------------------------------------------*/

static void
yydestruct (const char *yymsg,
            yysymbol_kind_t yykind, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, void *scanner, OSL::pvt::OSLCompilerImpl *oslcompiler)
{
  YY_USE (yyvaluep);
  YY_USE (yylocationp);
  YY_USE (scanner);
  YY_USE (oslcompiler);
  if (!yymsg)
    yymsg = "Deleting";
  YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);

  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  YY_USE (yykind);
  YY_IGNORE_MAYBE_UNINITIALIZED_END
}






/*----------.
| yyparse.  |
`----------*/

int
yyparse (void *scanner, OSL::pvt::OSLCompilerImpl *oslcompiler)
{
/* Lookahead token kind.  */
int yychar;


/* The semantic value of the lookahead symbol.  */
/* Default value used for initialization, for pacifying older GCCs
   or non-GCC compilers.  */
YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);

/* Location data for the lookahead symbol.  */
static YYLTYPE yyloc_default
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
  = { 1, 1, 1, 1 }
# endif
;
YYLTYPE yylloc = yyloc_default;

    /* Number of syntax errors so far.  */
    int yynerrs = 0;

    yy_state_fast_t yystate = 0;
    /* Number of tokens to shift before error messages enabled.  */
    int yyerrstatus = 0;

    /* Refer to the stacks through separate pointers, to allow yyoverflow
       to reallocate them elsewhere.  */

    /* Their size.  */
    YYPTRDIFF_T yystacksize = YYINITDEPTH;

    /* The state stack: array, bottom, top.  */
    yy_state_t yyssa[YYINITDEPTH];
    yy_state_t *yyss = yyssa;
    yy_state_t *yyssp = yyss;

    /* The semantic value stack: array, bottom, top.  */
    YYSTYPE yyvsa[YYINITDEPTH];
    YYSTYPE *yyvs = yyvsa;
    YYSTYPE *yyvsp = yyvs;

    /* The location stack: array, bottom, top.  */
    YYLTYPE yylsa[YYINITDEPTH];
    YYLTYPE *yyls = yylsa;
    YYLTYPE *yylsp = yyls;

  int yyn;
  /* The return value of yyparse.  */
  int yyresult;
  /* Lookahead symbol kind.  */
  yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
  /* The variables used to return semantic value and location from the
     action routines.  */
  YYSTYPE yyval;
  YYLTYPE yyloc;

  /* The locations where the error started and ended.  */
  YYLTYPE yyerror_range[3];



#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N), yylsp -= (N))

  /* The number of symbols on the RHS of the reduced rule.
     Keep to zero when no symbol should be popped.  */
  int yylen = 0;

  YYDPRINTF ((stderr, "Starting parse\n"));

  yychar = YYEMPTY; /* Cause a token to be read.  */

  yylsp[0] = yylloc;
  goto yysetstate;


/*------------------------------------------------------------.
| yynewstate -- push a new state, which is found in yystate.  |
`------------------------------------------------------------*/
yynewstate:
  /* In all cases, when you get here, the value and location stacks
     have just been pushed.  So pushing a state here evens the stacks.  */
  yyssp++;


/*--------------------------------------------------------------------.
| yysetstate -- set current state (the top of the stack) to yystate.  |
`--------------------------------------------------------------------*/
yysetstate:
  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
  YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
  YY_IGNORE_USELESS_CAST_BEGIN
  *yyssp = YY_CAST (yy_state_t, yystate);
  YY_IGNORE_USELESS_CAST_END
  YY_STACK_PRINT (yyss, yyssp);

  if (yyss + yystacksize - 1 <= yyssp)
#if !defined yyoverflow && !defined YYSTACK_RELOCATE
    YYNOMEM;
#else
    {
      /* Get the current used size of the three stacks, in elements.  */
      YYPTRDIFF_T yysize = yyssp - yyss + 1;

# if defined yyoverflow
      {
        /* Give user a chance to reallocate the stack.  Use copies of
           these so that the &'s don't force the real ones into
           memory.  */
        yy_state_t *yyss1 = yyss;
        YYSTYPE *yyvs1 = yyvs;
        YYLTYPE *yyls1 = yyls;

        /* Each stack pointer address is followed by the size of the
           data in use in that stack, in bytes.  This used to be a
           conditional around just the two extra args, but that might
           be undefined if yyoverflow is a macro.  */
        yyoverflow (YY_("memory exhausted"),
                    &yyss1, yysize * YYSIZEOF (*yyssp),
                    &yyvs1, yysize * YYSIZEOF (*yyvsp),
                    &yyls1, yysize * YYSIZEOF (*yylsp),
                    &yystacksize);
        yyss = yyss1;
        yyvs = yyvs1;
        yyls = yyls1;
      }
# else /* defined YYSTACK_RELOCATE */
      /* Extend the stack our own way.  */
      if (YYMAXDEPTH <= yystacksize)
        YYNOMEM;
      yystacksize *= 2;
      if (YYMAXDEPTH < yystacksize)
        yystacksize = YYMAXDEPTH;

      {
        yy_state_t *yyss1 = yyss;
        union yyalloc *yyptr =
          YY_CAST (union yyalloc *,
                   YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
        if (! yyptr)
          YYNOMEM;
        YYSTACK_RELOCATE (yyss_alloc, yyss);
        YYSTACK_RELOCATE (yyvs_alloc, yyvs);
        YYSTACK_RELOCATE (yyls_alloc, yyls);
#  undef YYSTACK_RELOCATE
        if (yyss1 != yyssa)
          YYSTACK_FREE (yyss1);
      }
# endif

      yyssp = yyss + yysize - 1;
      yyvsp = yyvs + yysize - 1;
      yylsp = yyls + yysize - 1;

      YY_IGNORE_USELESS_CAST_BEGIN
      YYDPRINTF ((stderr, "Stack size increased to %ld\n",
                  YY_CAST (long, yystacksize)));
      YY_IGNORE_USELESS_CAST_END

      if (yyss + yystacksize - 1 <= yyssp)
        YYABORT;
    }
#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */


  if (yystate == YYFINAL)
    YYACCEPT;

  goto yybackup;


/*-----------.
| yybackup.  |
`-----------*/
yybackup:
  /* Do appropriate processing given the current state.  Read a
     lookahead token if we need one and don't already have one.  */

  /* First try to decide what to do without reference to lookahead token.  */
  yyn = yypact[yystate];
  if (yypact_value_is_default (yyn))
    goto yydefault;

  /* Not known => get a lookahead token if don't already have one.  */

  /* YYCHAR is either empty, or end-of-input, or a valid lookahead.  */
  if (yychar == YYEMPTY)
    {
      YYDPRINTF ((stderr, "Reading a token\n"));
      yychar = yylex (&yylval, &yylloc, scanner, oslcompiler);
    }

  if (yychar <= YYEOF)
    {
      yychar = YYEOF;
      yytoken = YYSYMBOL_YYEOF;
      YYDPRINTF ((stderr, "Now at end of input.\n"));
    }
  else if (yychar == YYerror)
    {
      /* The scanner already issued an error message, process directly
         to error recovery.  But do not keep the error token as
         lookahead, it is too special and may lead us to an endless
         loop in error recovery. */
      yychar = YYUNDEF;
      yytoken = YYSYMBOL_YYerror;
      yyerror_range[1] = yylloc;
      goto yyerrlab1;
    }
  else
    {
      yytoken = YYTRANSLATE (yychar);
      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
    }

  /* If the proper action on seeing token YYTOKEN is to reduce or to
     detect an error, take that action.  */
  yyn += yytoken;
  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
    goto yydefault;
  yyn = yytable[yyn];
  if (yyn <= 0)
    {
      if (yytable_value_is_error (yyn))
        goto yyerrlab;
      yyn = -yyn;
      goto yyreduce;
    }

  /* Count tokens shifted since error; after three, turn off error
     status.  */
  if (yyerrstatus)
    yyerrstatus--;

  /* Shift the lookahead token.  */
  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
  yystate = yyn;
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  *++yyvsp = yylval;
  YY_IGNORE_MAYBE_UNINITIALIZED_END
  *++yylsp = yylloc;

  /* Discard the shifted token.  */
  yychar = YYEMPTY;
  goto yynewstate;


/*-----------------------------------------------------------.
| yydefault -- do the default action for the current state.  |
`-----------------------------------------------------------*/
yydefault:
  yyn = yydefact[yystate];
  if (yyn == 0)
    goto yyerrlab;
  goto yyreduce;


/*-----------------------------.
| yyreduce -- do a reduction.  |
`-----------------------------*/
yyreduce:
  /* yyn is the number of a rule to reduce with.  */
  yylen = yyr2[yyn];

  /* If YYLEN is nonzero, implement the default value of the action:
     '$$ = $1'.

     Otherwise, the following line sets YYVAL to garbage.
     This behavior is undocumented and Bison
     users should not rely upon it.  Assigning to YYVAL
     unconditionally makes the parser a bit smaller, and it avoids a
     GCC warning that YYVAL may be used uninitialized.  */
  yyval = yyvsp[1-yylen];

  /* Default location. */
  YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
  yyerror_range[1] = yyloc;
  YY_REDUCE_PRINT (yyn);
  switch (yyn)
    {
  case 4: /* global_declarations_opt: %empty  */
#line 145 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                                        { (yyval.n) = 0; }
#line 1712 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 6: /* global_declarations: global_declarations global_declaration  */
#line 150 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                                                    { (yyval.n) = concat ((yyvsp[-1].n), (yyvsp[0].n)); }
#line 1718 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 7: /* global_declaration: shader_or_function_declaration  */
#line 154 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                                            { (yyval.n) = 0; }
#line 1724 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 8: /* global_declaration: struct_declaration  */
#line 155 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                                            { (yyval.n) = 0; }
#line 1730 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 9: /* $@1: %empty  */
#line 160 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    if ((yyvsp[-1].i) == (int)ShaderType::Unknown) {
                        // It's a function declaration, not a shader
                        oslcompiler->symtab().push ();  // new scope
                        oslcompiler->typespec_stack().push (oslcompiler->current_typespec());
                    }
                }
#line 1742 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 10: /* $@2: %empty  */
#line 168 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    if ((yyvsp[-4].i) != (int)ShaderType::Unknown)
                        oslcompiler->declaring_shader_formals (true);
                }
#line 1751 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 11: /* $@3: %empty  */
#line 173 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    oslcompiler->declaring_shader_formals (false);
                }
#line 1759 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 12: /* shader_or_function_declaration: typespec_or_shadertype IDENTIFIER $@1 metadata_block_opt '(' $@2 formal_params_opt ')' $@3 metadata_block_opt function_body_or_just_decl  */
#line 177 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    if ((yyvsp[-10].i) == (int)ShaderType::Unknown) {
                        // Function declaration
                        oslcompiler->symtab().pop ();  // restore scope
                        ASTfunction_declaration *f;
                        f = new ASTfunction_declaration (oslcompiler,
                                                         oslcompiler->typespec_stack().top(),
                                                         ustring((yyvsp[-9].s)), (yyvsp[-4].n) /*formals*/,
                                                         (yyvsp[0].n) /*statements*/,
                                                         NULL /*metadata*/,
                                                         (yylsp[-9]).first_line);
                        oslcompiler->remember_function_decl (f);
                        f->add_meta (concat((yyvsp[-7].n), (yyvsp[-1].n)));
                        (yyval.n) = f;
                        oslcompiler->typespec_stack().pop ();
                    } else {
                        // Shader declaration
                        (yyval.n) = new ASTshader_declaration (oslcompiler, (yyvsp[-10].i),
                                                        ustring((yyvsp[-9].s)), (yyvsp[-4].n) /*formals*/,
                                                        (yyvsp[0].n) /*statements*/,
                                                        concat((yyvsp[-7].n),(yyvsp[-1].n)) /*meta*/);
                        (yyval.n)->sourceline ((yylsp[-9]).first_line);
                        if (oslcompiler->shader_is_defined()) {
                        yyerror (&yylloc, scanner, oslcompiler, YY_("Only one shader is allowed per file."));
                            delete (yyval.n);
                            (yyval.n) = NULL;
                        } else {
                            oslcompiler->shader ((yyval.n));
                        }
                    }
                }
#line 1795 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 14: /* formal_params_opt: %empty  */
#line 212 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                                        { (yyval.n) = 0; }
#line 1801 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 16: /* formal_params: formal_params ',' formal_param  */
#line 217 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                                                { (yyval.n) = concat ((yyvsp[-2].n), (yyvsp[0].n)); }
#line 1807 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 17: /* formal_params: formal_params ','  */
#line 218 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                                                { (yyval.n) = (yyvsp[-1].n); }
#line 1813 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 18: /* formal_param: outputspec typespec IDENTIFIER initializer_opt metadata_block_opt  */
#line 223 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    TypeSpec t = oslcompiler->current_typespec();
                    bool is_output = (yyvsp[-4].i);
                    auto var = new ASTvariable_declaration (oslcompiler,
                                            t, ustring((yyvsp[-2].s)), (yyvsp[-1].n) /*init*/,
                                            oslcompiler->declaring_shader_formals() /*isparam*/,
                                            false /*ismeta*/, is_output,
                                            false /*instlist*/, (yylsp[-2]).first_line);
                    if (! oslcompiler->declaring_shader_formals() && !is_output) {
                        // these are function formals, not shader formals,
                        var->sym()->readonly (true);
                    }
                    var->add_meta ((yyvsp[0].n));
                    (yyval.n) = var;
                }
#line 1833 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 19: /* formal_param: outputspec typespec IDENTIFIER arrayspec initializer_list_opt metadata_block_opt  */
#line 239 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    // Grab the current declaration type, modify it to be array
                    TypeSpec t = oslcompiler->current_typespec();
                    t.make_array ((yyvsp[-2].i));
                    auto var = new ASTvariable_declaration (oslcompiler, t, 
                                            ustring((yyvsp[-3].s)), (yyvsp[-1].n) /*init*/,
                                            oslcompiler->declaring_shader_formals() /*isparam*/,
                                            false /*ismeta*/, (yyvsp[-5].i) /*isoutput*/,
                                            true /* initlist */, (yylsp[-3]).first_line);
                    var->add_meta ((yyvsp[0].n));
                    (yyval.n) = var;
                }
#line 1850 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 20: /* formal_param: outputspec typespec IDENTIFIER initializer_list_opt metadata_block_opt  */
#line 252 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    // Grab the current declaration type, modify it to be array
                    TypeSpec t = oslcompiler->current_typespec();
                    if (! t.is_structure() && ! t.is_triple() && ! t.is_matrix())
                        oslcompiler->errorfmt(oslcompiler->filename(),
                                              oslcompiler->lineno(),
                                              "Can't use '= {{...}}' initializer "
                                              "except with arrays, structs, vectors, "
                                              "or matrix ({})", (yyvsp[-2].s));
                    auto var = new ASTvariable_declaration (oslcompiler, t,
                                            ustring((yyvsp[-2].s)), (yyvsp[-1].n) /*init*/,
                                            oslcompiler->declaring_shader_formals() /*isparam*/,
                                            false /*ismeta*/, (yyvsp[-4].i) /*isoutput*/,
                                            true /* initializer list */,
                                            (yylsp[-2]).first_line);
                    var->add_meta ((yyvsp[0].n));
                    (yyval.n) = var;
                }
#line 1873 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 21: /* metadata_block_opt: METADATA_BEGIN metadata ']' ']'  */
#line 273 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                                                { (yyval.n) = (yyvsp[-2].n); }
#line 1879 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 22: /* metadata_block_opt: %empty  */
#line 274 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                                                { (yyval.n) = 0; }
#line 1885 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 24: /* metadata: metadata ',' metadatum  */
#line 279 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                                        { (yyval.n) = concat ((yyvsp[-2].n), (yyvsp[0].n)); }
#line 1891 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 25: /* metadata: metadata ','  */
#line 281 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                { 
                    (yyval.n) = (yyvsp[-1].n); 
                }
#line 1899 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 26: /* metadatum: simple_typename IDENTIFIER initializer  */
#line 288 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    auto var = new ASTvariable_declaration (oslcompiler, osllextype((yyvsp[-2].i)),
                                           ustring ((yyvsp[-1].s)), (yyvsp[0].n), false /* isparam */,
                                           true /* ismeta */,
                                           false /* isoutput */,
                                           false /* initlist */,
                                           (yylsp[-1]).first_line);
                    (yyval.n) = var;
                }
#line 1913 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 27: /* metadatum: simple_typename IDENTIFIER arrayspec initializer_list  */
#line 298 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    TypeDesc simple = osllextype ((yyvsp[-3].i));
                    simple.arraylen = (yyvsp[-1].i);
                    if (simple.arraylen < 1)
                        oslcompiler->errorfmt(oslcompiler->filename(),
                                              oslcompiler->lineno(),
                                              "Invalid array length for {}", (yyvsp[-2].s));
                    TypeSpec t (simple, false);
                    auto var = new ASTvariable_declaration (oslcompiler, t, 
                                     ustring ((yyvsp[-2].s)), (yyvsp[0].n), false,
                                     true /* ismeata */, false /* output */,
                                     true /* initializer list */,
                                     (yylsp[-2]).first_line);
                    (yyval.n) = var;
                }
#line 1933 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 28: /* function_body_or_just_decl: '{' statement_list '}'  */
#line 316 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                                        { (yyval.n) = (yyvsp[-1].n); }
#line 1939 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 29: /* function_body_or_just_decl: ';'  */
#line 317 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                                        { (yyval.n) = NULL; }
#line 1945 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 30: /* $@4: %empty  */
#line 322 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    oslcompiler->symtab().push ();  // new scope
                    oslcompiler->typespec_stack().push (oslcompiler->current_typespec());
                }
#line 1954 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 31: /* function_declaration: typespec IDENTIFIER $@4 '(' formal_params_opt ')' metadata_block_opt function_body_or_just_decl  */
#line 327 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    oslcompiler->symtab().pop ();  // restore scope
                    auto f = new ASTfunction_declaration (oslcompiler,
                                                     oslcompiler->typespec_stack().top(),
                                                     ustring((yyvsp[-6].s)), (yyvsp[-3].n), (yyvsp[0].n), NULL,
                                                     (yylsp[-6]).first_line);
                    oslcompiler->remember_function_decl (f);
                    f->add_meta ((yyvsp[-1].n));
                    (yyval.n) = f;
                    oslcompiler->typespec_stack().pop ();
                }
#line 1970 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 32: /* $@5: %empty  */
#line 342 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    ustring name ((yyvsp[-1].s));
                    Symbol *s = oslcompiler->symtab().clash (name);
                    if (s) {
                        oslcompiler->errorfmt(oslcompiler->filename(), oslcompiler->lineno(),
                                              "\"{}\" already declared in this scope", name);
                        // FIXME -- print the file and line of the other definition
                    }
                    if (OIIO::Strutil::starts_with (name, "___")) {
                        oslcompiler->errorfmt(oslcompiler->filename(), oslcompiler->lineno(),
                                              "\"{}\" : sorry, can't start with three underscores", name);
                    }
                    oslcompiler->symtab().new_struct (name);
                }
#line 1989 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 33: /* struct_declaration: STRUCT IDENTIFIER '{' $@5 field_declarations '}' ';'  */
#line 357 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = 0;
                }
#line 1997 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 39: /* typed_field: IDENTIFIER  */
#line 378 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    ustring name ((yyvsp[0].s));
                    TypeSpec t = oslcompiler->current_typespec();
                    StructSpec *s = oslcompiler->symtab().current_struct();
                    if (s->lookup_field (name) >= 0)
                        oslcompiler->errorfmt(oslcompiler->filename(),
                                              oslcompiler->lineno(),
                                              "Field \"{}\" already exists in struct \"{}\"",
                                              name, s->name());
                    else
                        oslcompiler->symtab().add_struct_field (t, name);
                    (yyval.n) = 0;
                }
#line 2015 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 40: /* typed_field: IDENTIFIER arrayspec  */
#line 392 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    // Grab the current declaration type, modify it to be array
                    ustring name ((yyvsp[-1].s));
                    TypeSpec t = oslcompiler->current_typespec();
                    t.make_array ((yyvsp[0].i));
                    if (t.arraylength() < 1)
                        oslcompiler->errorfmt(oslcompiler->filename(),
                                              oslcompiler->lineno(),
                                              "Invalid array length for {}", name);
                    StructSpec *s = oslcompiler->symtab().current_struct();
                    if (s->lookup_field (name) >= 0)
                        oslcompiler->errorfmt(oslcompiler->filename(),
                                              oslcompiler->lineno(),
                                              "Field \"{}\" already exists in struct \"{}\"",
                                              name, s->name());
                    else
                        oslcompiler->symtab().add_struct_field (t, name);
                    (yyval.n) = 0;
                }
#line 2039 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 43: /* variable_declaration: typespec def_expressions ';'  */
#line 419 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                                                { (yyval.n) = (yyvsp[-1].n); }
#line 2045 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 45: /* def_expressions: def_expressions ',' def_expression  */
#line 424 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                                                { (yyval.n) = concat ((yyvsp[-2].n), (yyvsp[0].n)); }
#line 2051 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 46: /* def_expression: IDENTIFIER initializer_opt  */
#line 429 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    TypeSpec t = oslcompiler->current_typespec();
                    (yyval.n) = new ASTvariable_declaration (oslcompiler,
                                      t, ustring((yyvsp[-1].s)), (yyvsp[0].n), false /*isparam*/,
                                      false /*ismeta*/, false /*isoutput*/,
                                      false /*initlist*/, (yylsp[-1]).first_line);
                }
#line 2063 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 47: /* def_expression: IDENTIFIER arrayspec initializer_list_opt  */
#line 437 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    // Grab the current declaration type, modify it to be array
                    TypeSpec t = oslcompiler->current_typespec();
                    t.make_array ((yyvsp[-1].i));
                    if ((yyvsp[-1].i) < 1)
                        oslcompiler->errorfmt(oslcompiler->filename(),
                                              oslcompiler->lineno(),
                                              "Invalid array length for {}", (yyvsp[-2].s));
                    (yyval.n) = new ASTvariable_declaration (oslcompiler, t,
                                 ustring((yyvsp[-2].s)), (yyvsp[0].n), false, false, false,
                                 true /* initlist */, (yylsp[-2]).first_line);
                }
#line 2080 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 48: /* def_expression: IDENTIFIER initializer_list  */
#line 450 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    TypeSpec t = oslcompiler->current_typespec();
                    if (! t.is_structure() && ! t.is_triple() && ! t.is_matrix())
                        oslcompiler->errorfmt(oslcompiler->filename(),
                                              oslcompiler->lineno(),
                                              "Can't use '= {{...}}' initializer "
                                              "except with arrays, struct, vectors, "
                                              "or matrix ({})", (yyvsp[-1].s));
                    (yyval.n) = new ASTvariable_declaration (oslcompiler, t,
                                 ustring((yyvsp[-1].s)), (yyvsp[0].n), false, false, false,
                                 true /* initlist */, (yylsp[-1]).first_line);
                }
#line 2097 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 50: /* initializer_opt: %empty  */
#line 466 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                                        { (yyval.n) = 0; }
#line 2103 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 51: /* initializer: '=' expression  */
#line 470 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                                        { (yyval.n) = (yyvsp[0].n); }
#line 2109 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 53: /* initializer_list_opt: %empty  */
#line 475 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                                        { (yyval.n) = 0; }
#line 2115 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 54: /* initializer_list: '=' compound_initializer  */
#line 479 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                                        { (yyval.n) = (yyvsp[0].n); }
#line 2121 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 55: /* compound_initializer: '{' init_expression_list '}'  */
#line 484 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = new ASTcompound_initializer (oslcompiler, (yyvsp[-1].n));
                    (yyval.n)->sourceline ((yylsp[-2]).first_line);
                }
#line 2130 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 56: /* compound_initializer: '{' '}'  */
#line 489 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    if (!oslcompiler->declaring_shader_formals())
                        oslcompiler->errorfmt(oslcompiler->filename(),
                                              oslcompiler->lineno(),
                                              "Empty compound initializers '{{ }}' "
                                              "only allowed for shader parameters.");
                    (yyval.n) = new ASTcompound_initializer (oslcompiler, nullptr);
                    (yyval.n)->sourceline ((yylsp[-1]).first_line);
                }
#line 2144 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 58: /* init_expression_list: init_expression_list_rev ',' init_expression  */
#line 503 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                #ifdef OIIO_REFCNT_HAS_RELEASE
                    // Left recursion is much more efficient for Bison, but
                    // concatenating the sole last expression ($3) on the
                    // far end of the running list ($1) leads to an
                    // inadvertently quadratic algorithm, which is very
                    // painful for long initializer lists of thousands of
                    // items (like for a big table). So we use a trick:
                    // accumulate the list in referse order (lets us prepend
                    // as O(1) instead of append with O(n)) and then reverse
                    // it right before we return the list. BUT... note that
                    // we only do this for sufficiently new OIIO that lets
                    // us safely convert the ref-counted pointer to a raw
                    // pointer.
                    ASTNode::ref revlist = concat ((yyvsp[0].n), (yyvsp[-2].n));
                    revlist = reverse (revlist);
                    (yyval.n) = revlist.release ();
                #else
                    // OIIO too old to support reverse(), so just do it
                    // the old way, normal order.
                    (yyval.n) = concat ((yyvsp[-2].n), (yyvsp[0].n));
                #endif
                }
#line 2172 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 60: /* init_expression_list_rev: init_expression_list_rev ',' init_expression  */
#line 531 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                #ifdef OIIO_REFCNT_HAS_RELEASE
                    (yyval.n) = concat ((yyvsp[0].n), (yyvsp[-2].n));
                    // NOTE: intentionally concat in reverse order!
                    // Because this is init_expression_list_rev!
                #else
                    // OIIO too old to support reverse(), so just do it
                    // the old way, normal order.
                    (yyval.n) = concat ((yyvsp[-2].n), (yyvsp[0].n));
                #endif
                }
#line 2188 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 63: /* outputspec: OUTPUT  */
#line 554 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                                { oslcompiler->current_output (true); (yyval.i) = 1; }
#line 2194 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 64: /* outputspec: %empty  */
#line 555 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                                { oslcompiler->current_output (false); (yyval.i) = 0; }
#line 2200 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 74: /* arrayspec: '[' INT_LITERAL ']'  */
#line 572 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    if ((yyvsp[-1].i) < 1)
                        oslcompiler->errorfmt(oslcompiler->filename(),
                                              oslcompiler->lineno(),
                                              "Invalid array length ({})", (yyvsp[-1].i));
                    (yyval.i) = (yyvsp[-1].i);
                }
#line 2212 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 75: /* arrayspec: '[' ']'  */
#line 579 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                                        { (yyval.i) = -1; }
#line 2218 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 76: /* typespec: simple_typename  */
#line 585 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    oslcompiler->current_typespec (TypeSpec (osllextype ((yyvsp[0].i))));
                    (yyval.i) = 0;
                }
#line 2227 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 77: /* typespec: CLOSURE simple_typename  */
#line 590 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    oslcompiler->current_typespec (TypeSpec (osllextype ((yyvsp[0].i)), true));
                    (yyval.i) = 0;
                }
#line 2236 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 78: /* typespec: IDENTIFIER  */
#line 595 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    ustring name ((yyvsp[0].s));
                    Symbol *s = oslcompiler->symtab().find (name);
                    if (s && s->is_structure())
                        oslcompiler->current_typespec (TypeSpec ("", s->typespec().structure()));
                    else {
                        oslcompiler->current_typespec (TypeSpec (TypeDesc::UNKNOWN));
                        oslcompiler->errorfmt(oslcompiler->filename(),
                                              oslcompiler->lineno(),
                                              "Unknown struct name: {}", (yyvsp[0].s));
                    }
                    (yyval.i) = 0;
                }
#line 2254 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 79: /* typespec_or_shadertype: simple_typename  */
#line 613 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    oslcompiler->current_typespec (TypeSpec (osllextype ((yyvsp[0].i))));
                    (yyval.i) = 0;
                }
#line 2263 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 80: /* typespec_or_shadertype: CLOSURE simple_typename  */
#line 618 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    oslcompiler->current_typespec (TypeSpec (osllextype ((yyvsp[0].i)), true));
                    (yyval.i) = 0;
                }
#line 2272 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 81: /* typespec_or_shadertype: IDENTIFIER  */
#line 623 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    /* N.B. Shader types are considered obsolete. We are
                     * promoting 'shader' for all, now (OSL 2.0). Some day
                     * we may add a warning for using the old names.
                     */
                    ustring name ((yyvsp[0].s));
                    if (name == "shader")
                        (yyval.i) = (int)ShaderType::Generic;
                    else if (name == "surface")
                        (yyval.i) = (int)ShaderType::Surface;
                    else if (name == "displacement")
                        (yyval.i) = (int)ShaderType::Displacement;
                    else if (name == "volume")
                        (yyval.i) = (int)ShaderType::Volume;
                    else {
                        Symbol *s = oslcompiler->symtab().find (name);
                        if (s && s->is_structure())
                            oslcompiler->current_typespec (TypeSpec ("", s->typespec().structure()));
                        else {
                            oslcompiler->current_typespec (TypeSpec (TypeDesc::UNKNOWN));
                            oslcompiler->errorfmt(oslcompiler->filename(),
                                                  oslcompiler->lineno(),
                                                  "Unknown struct name: {}", (yyvsp[0].s));
                        }
                        (yyval.i) = (int)ShaderType::Unknown;
                    }
                }
#line 2304 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 82: /* statement_list: statement statement_list  */
#line 653 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                                        { (yyval.n) = concat ((yyvsp[-1].n), (yyvsp[0].n)); }
#line 2310 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 83: /* statement_list: %empty  */
#line 654 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                                        { (yyval.n) = 0; }
#line 2316 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 91: /* statement: ';'  */
#line 665 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                                        { (yyval.n) = 0; }
#line 2322 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 92: /* $@6: %empty  */
#line 670 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    oslcompiler->symtab().push ();  // new scope
                }
#line 2330 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 93: /* scoped_statements: '{' $@6 statement_list '}'  */
#line 674 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    oslcompiler->symtab().pop ();  // restore scope
                    (yyval.n) = (yyvsp[-1].n);
                }
#line 2339 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 94: /* conditional_statement: IF_TOKEN '(' compound_expression ')' statement  */
#line 682 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = new ASTconditional_statement (oslcompiler, (yyvsp[-2].n), (yyvsp[0].n));
                    (yyval.n)->sourceline ((yylsp[-4]).first_line);
                }
#line 2348 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 95: /* conditional_statement: IF_TOKEN '(' compound_expression ')' statement ELSE statement  */
#line 687 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = new ASTconditional_statement (oslcompiler, (yyvsp[-4].n), (yyvsp[-2].n), (yyvsp[0].n));
                    (yyval.n)->sourceline ((yylsp[-6]).first_line);
                }
#line 2357 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 96: /* loop_statement: WHILE '(' compound_expression ')' statement  */
#line 695 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = new ASTloop_statement (oslcompiler,
                                                ASTloop_statement::LoopWhile,
                                                NULL, (yyvsp[-2].n), NULL, (yyvsp[0].n));
                    (yyval.n)->sourceline ((yylsp[-4]).first_line);
                }
#line 2368 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 97: /* loop_statement: DO statement WHILE '(' compound_expression ')' ';'  */
#line 702 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = new ASTloop_statement (oslcompiler,
                                                ASTloop_statement::LoopDo,
                                                NULL, (yyvsp[-2].n), NULL, (yyvsp[-5].n));
                    (yyval.n)->sourceline ((yylsp[-6]).first_line);
                }
#line 2379 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 98: /* $@7: %empty  */
#line 709 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    oslcompiler->symtab().push (); // new declaration scope
                }
#line 2387 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 99: /* loop_statement: FOR '(' $@7 for_init_statement compound_expression_opt ';' compound_expression_opt ')' statement  */
#line 713 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = new ASTloop_statement (oslcompiler,
                                                ASTloop_statement::LoopFor,
                                                (yyvsp[-5].n), (yyvsp[-4].n), (yyvsp[-2].n), (yyvsp[0].n));
                    (yyval.n)->sourceline ((yylsp[-8]).first_line);
                    oslcompiler->symtab().pop ();
                }
#line 2399 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 100: /* loopmod_statement: BREAK ';'  */
#line 724 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = new ASTloopmod_statement (oslcompiler, ASTloopmod_statement::LoopModBreak);
                }
#line 2407 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 101: /* loopmod_statement: CONTINUE ';'  */
#line 728 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = new ASTloopmod_statement (oslcompiler, ASTloopmod_statement::LoopModContinue);
                }
#line 2415 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 102: /* return_statement: RETURN expression_opt ';'  */
#line 735 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = new ASTreturn_statement (oslcompiler, (yyvsp[-1].n));
                }
#line 2423 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 103: /* return_statement: RETURN compound_initializer ';'  */
#line 739 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = new ASTreturn_statement (oslcompiler, (yyvsp[-1].n));
                }
#line 2431 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 107: /* expression_list: expression_list ',' expression  */
#line 751 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                                                { (yyval.n) = concat ((yyvsp[-2].n), (yyvsp[0].n)); }
#line 2437 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 109: /* expression_opt: %empty  */
#line 756 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                                        { (yyval.n) = 0; }
#line 2443 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 111: /* compound_expression_opt: %empty  */
#line 761 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                                        { (yyval.n) = 0; }
#line 2449 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 113: /* compound_expression: expression ',' compound_expression  */
#line 767 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = new ASTcomma_operator (oslcompiler, concat ((yyvsp[-2].n), (yyvsp[0].n)));
                }
#line 2457 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 114: /* expression: INT_LITERAL  */
#line 772 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                                { (yyval.n) = new ASTliteral (oslcompiler, (yyvsp[0].i)); }
#line 2463 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 115: /* expression: FLOAT_LITERAL  */
#line 773 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                                { (yyval.n) = new ASTliteral (oslcompiler, (yyvsp[0].f)); }
#line 2469 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 116: /* expression: string_literal_group  */
#line 774 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                                { (yyval.n) = new ASTliteral (oslcompiler, ustring((yyvsp[0].s))); }
#line 2475 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 118: /* expression: incdec_op variable_lvalue  */
#line 777 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = new ASTpreincdec (oslcompiler, (yyvsp[-1].i), (yyvsp[0].n));
                }
#line 2483 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 120: /* expression: unary_op expression  */
#line 782 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    // Correct for literal +float -float
                    if ((yyvsp[-1].i) == ASTNode::Add) {
                        (yyval.n) = (yyvsp[0].n);
                    } else if ((yyvsp[-1].i) == ASTNode::Sub &&
                               (yyvsp[0].n)->nodetype() == ASTNode::literal_node &&
                               (yyvsp[0].n)->typespec().is_numeric()) {
                         ((ASTliteral *)(yyvsp[0].n))->negate ();
                         (yyval.n) = (yyvsp[0].n);
                    } else {
                        (yyval.n) = new ASTunary_expression (oslcompiler, (yyvsp[-1].i), (yyvsp[0].n));
                        (yyval.n)->sourceline ((yylsp[-1]).first_line);
                    }
                }
#line 2502 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 121: /* expression: '(' compound_expression ')'  */
#line 797 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    if ((yyvsp[-1].n)->nodetype() == ASTNode::comma_operator_node) {
                        // Warning for comma operator ïn parenthesized
                        // expressions, which sometimes happens when somebody
                        // forgets the proper syntax for triple constructors:
                        //     color x = Cd * (a, b, c); // same as:  x = Cd * c
                        // when they really meant
                        //     color x = Cd * color(a, b, c);
                        oslcompiler->warningfmt(oslcompiler->filename(),
                                                (yylsp[-2]).first_line,
                                                "Comma operator inside parenthesis is probably an error -- it is not a vector/color.");
                    }
                    (yyval.n) = (yyvsp[-1].n);
                }
#line 2521 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 128: /* variable_lvalue: id_or_field '[' expression ']'  */
#line 821 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = new ASTindex (oslcompiler, (yyvsp[-3].n), (yyvsp[-1].n));
                    (yyval.n)->sourceline ((yylsp[-2]).first_line);
                }
#line 2530 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 129: /* variable_lvalue: id_or_field '[' expression ']' '[' expression ']'  */
#line 826 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = new ASTindex (oslcompiler, (yyvsp[-6].n), (yyvsp[-4].n), (yyvsp[-1].n));
                    (yyval.n)->sourceline ((yylsp[-5]).first_line);
                }
#line 2539 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 130: /* variable_lvalue: id_or_field '[' expression ']' '[' expression ']' '[' expression ']'  */
#line 831 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = new ASTindex (oslcompiler, (yyvsp[-9].n), (yyvsp[-7].n), (yyvsp[-4].n), (yyvsp[-1].n));
                    (yyval.n)->sourceline ((yylsp[-8]).first_line);
                }
#line 2548 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 131: /* id_or_field: IDENTIFIER  */
#line 839 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = new ASTvariable_ref (oslcompiler, ustring((yyvsp[0].s)));
                }
#line 2556 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 132: /* id_or_field: variable_lvalue '.' IDENTIFIER  */
#line 843 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = new ASTstructselect (oslcompiler, (yyvsp[-2].n), ustring((yyvsp[0].s)));
                    (yyval.n)->sourceline ((yylsp[-1]).first_line);
                }
#line 2565 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 133: /* variable_ref: variable_lvalue incdec_op_opt  */
#line 851 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    if ((yyvsp[0].i))
                        (yyval.n) = new ASTpostincdec (oslcompiler, (yyvsp[0].i), (yyvsp[-1].n));
                    else
                        (yyval.n) = (yyvsp[-1].n);
                }
#line 2576 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 134: /* binary_expression: expression OR_OP expression  */
#line 861 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = ASTbinary_expression::make(oslcompiler,
                                    ASTNode::Or, (yyvsp[-2].n), (yyvsp[0].n));
                    (yyval.n)->sourceline ((yylsp[-1]).first_line);
                }
#line 2586 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 135: /* binary_expression: expression AND_OP expression  */
#line 867 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = ASTbinary_expression::make(oslcompiler,
                                    ASTNode::And, (yyvsp[-2].n), (yyvsp[0].n));
                    (yyval.n)->sourceline ((yylsp[-1]).first_line);
                }
#line 2596 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 136: /* binary_expression: expression '|' expression  */
#line 873 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = ASTbinary_expression::make(oslcompiler,
                                    ASTNode::BitOr, (yyvsp[-2].n), (yyvsp[0].n));
                    (yyval.n)->sourceline ((yylsp[-1]).first_line);
                }
#line 2606 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 137: /* binary_expression: expression '^' expression  */
#line 879 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = ASTbinary_expression::make(oslcompiler,
                                    ASTNode::Xor, (yyvsp[-2].n), (yyvsp[0].n));
                    (yyval.n)->sourceline ((yylsp[-1]).first_line);
                }
#line 2616 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 138: /* binary_expression: expression '&' expression  */
#line 885 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = ASTbinary_expression::make(oslcompiler,
                                    ASTNode::BitAnd, (yyvsp[-2].n), (yyvsp[0].n));
                    (yyval.n)->sourceline ((yylsp[-1]).first_line);
                }
#line 2626 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 139: /* binary_expression: expression EQ_OP expression  */
#line 891 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = ASTbinary_expression::make(oslcompiler,
                                    ASTNode::Equal, (yyvsp[-2].n), (yyvsp[0].n));
                    (yyval.n)->sourceline ((yylsp[-1]).first_line);
                }
#line 2636 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 140: /* binary_expression: expression NE_OP expression  */
#line 897 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = ASTbinary_expression::make(oslcompiler,
                                    ASTNode::NotEqual, (yyvsp[-2].n), (yyvsp[0].n));
                    (yyval.n)->sourceline ((yylsp[-1]).first_line);
                }
#line 2646 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 141: /* binary_expression: expression '>' expression  */
#line 903 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = ASTbinary_expression::make(oslcompiler,
                                    ASTNode::Greater, (yyvsp[-2].n), (yyvsp[0].n));
                    (yyval.n)->sourceline ((yylsp[-1]).first_line);
                }
#line 2656 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 142: /* binary_expression: expression GE_OP expression  */
#line 909 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = ASTbinary_expression::make(oslcompiler,
                                    ASTNode::GreaterEqual, (yyvsp[-2].n), (yyvsp[0].n));
                    (yyval.n)->sourceline ((yylsp[-1]).first_line);
                }
#line 2666 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 143: /* binary_expression: expression '<' expression  */
#line 915 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = ASTbinary_expression::make(oslcompiler,
                                    ASTNode::Less, (yyvsp[-2].n), (yyvsp[0].n));
                    (yyval.n)->sourceline ((yylsp[-1]).first_line);
                }
#line 2676 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 144: /* binary_expression: expression LE_OP expression  */
#line 921 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = ASTbinary_expression::make(oslcompiler,
                                    ASTNode::LessEqual, (yyvsp[-2].n), (yyvsp[0].n));
                    (yyval.n)->sourceline ((yylsp[-1]).first_line);
                }
#line 2686 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 145: /* binary_expression: expression SHL_OP expression  */
#line 927 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = ASTbinary_expression::make(oslcompiler,
                                    ASTNode::ShiftLeft, (yyvsp[-2].n), (yyvsp[0].n));
                    (yyval.n)->sourceline ((yylsp[-1]).first_line);
                }
#line 2696 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 146: /* binary_expression: expression SHR_OP expression  */
#line 933 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = ASTbinary_expression::make(oslcompiler,
                                    ASTNode::ShiftRight, (yyvsp[-2].n), (yyvsp[0].n));
                    (yyval.n)->sourceline ((yylsp[-1]).first_line);
                }
#line 2706 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 147: /* binary_expression: expression '+' expression  */
#line 939 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = ASTbinary_expression::make(oslcompiler,
                                    ASTNode::Add, (yyvsp[-2].n), (yyvsp[0].n));
                    (yyval.n)->sourceline ((yylsp[-1]).first_line);
                }
#line 2716 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 148: /* binary_expression: expression '-' expression  */
#line 945 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = ASTbinary_expression::make(oslcompiler,
                                    ASTNode::Sub, (yyvsp[-2].n), (yyvsp[0].n));
                    (yyval.n)->sourceline ((yylsp[-1]).first_line);
                }
#line 2726 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 149: /* binary_expression: expression '*' expression  */
#line 951 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = ASTbinary_expression::make(oslcompiler,
                                    ASTNode::Mul, (yyvsp[-2].n), (yyvsp[0].n));
                    (yyval.n)->sourceline ((yylsp[-1]).first_line);
                }
#line 2736 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 150: /* binary_expression: expression '/' expression  */
#line 957 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = ASTbinary_expression::make(oslcompiler,
                                    ASTNode::Div, (yyvsp[-2].n), (yyvsp[0].n));
                    (yyval.n)->sourceline ((yylsp[-1]).first_line);
                }
#line 2746 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 151: /* binary_expression: expression '%' expression  */
#line 963 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = ASTbinary_expression::make(oslcompiler,
                                    ASTNode::Mod, (yyvsp[-2].n), (yyvsp[0].n));
                    (yyval.n)->sourceline ((yylsp[-1]).first_line);
                }
#line 2756 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 152: /* unary_op: '-'  */
#line 971 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                                        { (yyval.i) = ASTNode::Sub; }
#line 2762 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 153: /* unary_op: '+'  */
#line 972 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                                        { (yyval.i) = ASTNode::Add; }
#line 2768 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 154: /* unary_op: '!'  */
#line 973 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                                        { (yyval.i) = ASTNode::Not; }
#line 2774 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 155: /* unary_op: NOT_OP  */
#line 974 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                                        { (yyval.i) = ASTNode::Not; }
#line 2780 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 156: /* unary_op: '~'  */
#line 975 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                                        { (yyval.i) = ASTNode::Compl; }
#line 2786 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 158: /* incdec_op_opt: %empty  */
#line 980 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                                        { (yyval.i) = 0; }
#line 2792 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 159: /* incdec_op: INCREMENT  */
#line 984 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                                        { (yyval.i) = ASTNode::Incr; }
#line 2798 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 160: /* incdec_op: DECREMENT  */
#line 985 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                                        { (yyval.i) = ASTNode::Decr; }
#line 2804 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 161: /* type_constructor: simple_typename '(' expression_list ')'  */
#line 990 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = new ASTtype_constructor (oslcompiler,
                                                  TypeSpec (osllextype ((yyvsp[-3].i))), (yyvsp[-1].n));
                    (yyval.n)->sourceline ((yylsp[-3]).first_line);
                }
#line 2814 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 162: /* function_call: IDENTIFIER '(' function_args_opt ')'  */
#line 999 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = new ASTfunction_call (oslcompiler, ustring((yyvsp[-3].s)), (yyvsp[-1].n));
                    (yyval.n)->sourceline ((yylsp[-3]).first_line);
                }
#line 2823 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 164: /* function_args_opt: %empty  */
#line 1007 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                                        { (yyval.n) = 0; }
#line 2829 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 167: /* function_args: function_args ',' expression  */
#line 1013 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                                           { (yyval.n) = concat ((yyvsp[-2].n), (yyvsp[0].n)); }
#line 2835 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 168: /* function_args: function_args ',' compound_initializer  */
#line 1014 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                                                     { (yyval.n) = concat ((yyvsp[-2].n), (yyvsp[0].n)); }
#line 2841 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 169: /* assign_expression: variable_lvalue '=' expression  */
#line 1019 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = new ASTassign_expression (oslcompiler, (yyvsp[-2].n), ASTNode::Assign, (yyvsp[0].n));
                    (yyval.n)->sourceline ((yylsp[-1]).first_line);
                }
#line 2850 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 170: /* assign_expression: variable_lvalue MUL_ASSIGN expression  */
#line 1024 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = new ASTassign_expression (oslcompiler, (yyvsp[-2].n), ASTNode::Mul, (yyvsp[0].n));
                    (yyval.n)->sourceline ((yylsp[-1]).first_line);
                }
#line 2859 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 171: /* assign_expression: variable_lvalue DIV_ASSIGN expression  */
#line 1029 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = new ASTassign_expression (oslcompiler, (yyvsp[-2].n), ASTNode::Div, (yyvsp[0].n));
                    (yyval.n)->sourceline ((yylsp[-1]).first_line);
                }
#line 2868 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 172: /* assign_expression: variable_lvalue ADD_ASSIGN expression  */
#line 1034 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = new ASTassign_expression (oslcompiler, (yyvsp[-2].n), ASTNode::Add, (yyvsp[0].n));
                    (yyval.n)->sourceline ((yylsp[-1]).first_line);
                }
#line 2877 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 173: /* assign_expression: variable_lvalue SUB_ASSIGN expression  */
#line 1039 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = new ASTassign_expression (oslcompiler, (yyvsp[-2].n), ASTNode::Sub, (yyvsp[0].n));
                    (yyval.n)->sourceline ((yylsp[-1]).first_line);
                }
#line 2886 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 174: /* assign_expression: variable_lvalue BIT_AND_ASSIGN expression  */
#line 1044 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = new ASTassign_expression (oslcompiler, (yyvsp[-2].n), ASTNode::BitAnd, (yyvsp[0].n));
                    (yyval.n)->sourceline ((yylsp[-1]).first_line);
                }
#line 2895 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 175: /* assign_expression: variable_lvalue BIT_OR_ASSIGN expression  */
#line 1049 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = new ASTassign_expression (oslcompiler, (yyvsp[-2].n), ASTNode::BitOr, (yyvsp[0].n));
                    (yyval.n)->sourceline ((yylsp[-1]).first_line);
                }
#line 2904 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 176: /* assign_expression: variable_lvalue XOR_ASSIGN expression  */
#line 1054 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = new ASTassign_expression (oslcompiler, (yyvsp[-2].n), ASTNode::Xor, (yyvsp[0].n));
                    (yyval.n)->sourceline ((yylsp[-1]).first_line);
                }
#line 2913 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 177: /* assign_expression: variable_lvalue SHL_ASSIGN expression  */
#line 1059 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = new ASTassign_expression (oslcompiler, (yyvsp[-2].n), ASTNode::ShiftLeft, (yyvsp[0].n));
                    (yyval.n)->sourceline ((yylsp[-1]).first_line);
                }
#line 2922 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 178: /* assign_expression: variable_lvalue SHR_ASSIGN expression  */
#line 1064 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = new ASTassign_expression (oslcompiler, (yyvsp[-2].n), ASTNode::ShiftRight, (yyvsp[0].n));
                    (yyval.n)->sourceline ((yylsp[-1]).first_line);
                }
#line 2931 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 179: /* ternary_expression: expression '?' expression ':' expression  */
#line 1072 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = new ASTternary_expression (oslcompiler, (yyvsp[-4].n), (yyvsp[-2].n), (yyvsp[0].n));
                    (yyval.n)->sourceline ((yylsp[-3]).first_line);
                }
#line 2940 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 180: /* typecast_expression: '(' simple_typename ')' expression  */
#line 1080 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.n) = new ASTtypecast_expression (oslcompiler, 
                                                     TypeSpec (osllextype ((yyvsp[-2].i))),
                                                     (yyvsp[0].n));
                }
#line 2950 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;

  case 182: /* string_literal_group: string_literal_group STRING_LITERAL  */
#line 1090 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"
                {
                    (yyval.s) = ustring (std::string((yyvsp[-1].s)) + std::string((yyvsp[0].s))).c_str();
                }
#line 2958 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"
    break;


#line 2962 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/build/src/liboslcomp/oslgram.cpp"

      default: break;
    }
  /* User semantic actions sometimes alter yychar, and that requires
     that yytoken be updated with the new translation.  We take the
     approach of translating immediately before every use of yytoken.
     One alternative is translating here after every semantic action,
     but that translation would be missed if the semantic action invokes
     YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
     if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
     incorrect destructor might then be invoked immediately.  In the
     case of YYERROR or YYBACKUP, subsequent parser actions might lead
     to an incorrect destructor call or verbose syntax error message
     before the lookahead is translated.  */
  YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);

  YYPOPSTACK (yylen);
  yylen = 0;

  *++yyvsp = yyval;
  *++yylsp = yyloc;

  /* Now 'shift' the result of the reduction.  Determine what state
     that goes to, based on the state we popped back to and the rule
     number reduced by.  */
  {
    const int yylhs = yyr1[yyn] - YYNTOKENS;
    const int yyi = yypgoto[yylhs] + *yyssp;
    yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
               ? yytable[yyi]
               : yydefgoto[yylhs]);
  }

  goto yynewstate;


/*--------------------------------------.
| yyerrlab -- here on detecting error.  |
`--------------------------------------*/
yyerrlab:
  /* Make sure we have latest lookahead translation.  See comments at
     user semantic actions for why this is necessary.  */
  yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
  /* If not already recovering from an error, report this error.  */
  if (!yyerrstatus)
    {
      ++yynerrs;
      yyerror (&yylloc, scanner, oslcompiler, YY_("syntax error"));
    }

  yyerror_range[1] = yylloc;
  if (yyerrstatus == 3)
    {
      /* If just tried and failed to reuse lookahead token after an
         error, discard it.  */

      if (yychar <= YYEOF)
        {
          /* Return failure if at end of input.  */
          if (yychar == YYEOF)
            YYABORT;
        }
      else
        {
          yydestruct ("Error: discarding",
                      yytoken, &yylval, &yylloc, scanner, oslcompiler);
          yychar = YYEMPTY;
        }
    }

  /* Else will try to reuse lookahead token after shifting the error
     token.  */
  goto yyerrlab1;


/*---------------------------------------------------.
| yyerrorlab -- error raised explicitly by YYERROR.  |
`---------------------------------------------------*/
yyerrorlab:
  /* Pacify compilers when the user code never invokes YYERROR and the
     label yyerrorlab therefore never appears in user code.  */
  if (0)
    YYERROR;
  ++yynerrs;

  /* Do not reclaim the symbols of the rule whose action triggered
     this YYERROR.  */
  YYPOPSTACK (yylen);
  yylen = 0;
  YY_STACK_PRINT (yyss, yyssp);
  yystate = *yyssp;
  goto yyerrlab1;


/*-------------------------------------------------------------.
| yyerrlab1 -- common code for both syntax error and YYERROR.  |
`-------------------------------------------------------------*/
yyerrlab1:
  yyerrstatus = 3;      /* Each real token shifted decrements this.  */

  /* Pop stack until we find a state that shifts the error token.  */
  for (;;)
    {
      yyn = yypact[yystate];
      if (!yypact_value_is_default (yyn))
        {
          yyn += YYSYMBOL_YYerror;
          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
            {
              yyn = yytable[yyn];
              if (0 < yyn)
                break;
            }
        }

      /* Pop the current state because it cannot handle the error token.  */
      if (yyssp == yyss)
        YYABORT;

      yyerror_range[1] = *yylsp;
      yydestruct ("Error: popping",
                  YY_ACCESSING_SYMBOL (yystate), yyvsp, yylsp, scanner, oslcompiler);
      YYPOPSTACK (1);
      yystate = *yyssp;
      YY_STACK_PRINT (yyss, yyssp);
    }

  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  *++yyvsp = yylval;
  YY_IGNORE_MAYBE_UNINITIALIZED_END

  yyerror_range[2] = yylloc;
  ++yylsp;
  YYLLOC_DEFAULT (*yylsp, yyerror_range, 2);

  /* Shift the error token.  */
  YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);

  yystate = yyn;
  goto yynewstate;


/*-------------------------------------.
| yyacceptlab -- YYACCEPT comes here.  |
`-------------------------------------*/
yyacceptlab:
  yyresult = 0;
  goto yyreturnlab;


/*-----------------------------------.
| yyabortlab -- YYABORT comes here.  |
`-----------------------------------*/
yyabortlab:
  yyresult = 1;
  goto yyreturnlab;


/*-----------------------------------------------------------.
| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here.  |
`-----------------------------------------------------------*/
yyexhaustedlab:
  yyerror (&yylloc, scanner, oslcompiler, YY_("memory exhausted"));
  yyresult = 2;
  goto yyreturnlab;


/*----------------------------------------------------------.
| yyreturnlab -- parsing is finished, clean up and return.  |
`----------------------------------------------------------*/
yyreturnlab:
  if (yychar != YYEMPTY)
    {
      /* Make sure we have latest lookahead translation.  See comments at
         user semantic actions for why this is necessary.  */
      yytoken = YYTRANSLATE (yychar);
      yydestruct ("Cleanup: discarding lookahead",
                  yytoken, &yylval, &yylloc, scanner, oslcompiler);
    }
  /* Do not reclaim the symbols of the rule whose action triggered
     this YYABORT or YYACCEPT.  */
  YYPOPSTACK (yylen);
  YY_STACK_PRINT (yyss, yyssp);
  while (yyssp != yyss)
    {
      yydestruct ("Cleanup: popping",
                  YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, yylsp, scanner, oslcompiler);
      YYPOPSTACK (1);
    }
#ifndef yyoverflow
  if (yyss != yyssa)
    YYSTACK_FREE (yyss);
#endif

  return yyresult;
}

#line 1095 "/build/openshadinglanguage/src/OpenShadingLanguage-1.15.3.0/src/liboslcomp/oslgram.y"




void
OSL::pvt::yyerror (YYLTYPE* yylloc_param, void* yyscanner, OSLCompilerImpl* oslcompiler, const char* err)
{
    oslcompiler->errorfmt(oslcompiler->filename(), oslcompiler->lineno(),
                          "Syntax error: {}", err);
}



// Convert from the lexer's symbolic type (COLORTYPE, etc.) to a TypeDesc.
inline TypeDesc
OSL::pvt::osllextype (int lex)
{
    switch (lex) {
    case COLORTYPE  : return TypeColor;
    case FLOATTYPE  : return TypeFloat;
    case INTTYPE    : return TypeInt;
    case MATRIXTYPE : return TypeMatrix;
    case NORMALTYPE : return TypeNormal;
    case POINTTYPE  : return TypePoint;
    case STRINGTYPE : return TypeString;
    case VECTORTYPE : return TypeVector;
    case VOIDTYPE   : return TypeDesc::NONE;
    default: return TypeDesc::UNKNOWN;
    }
}

#if defined(__GNUC__) || defined(__clang__)
#pragma GCC visibility pop
#endif
