"L. Spiro Engine"

F:/My Projects/LSEngine/Modules/LSGraphicsLib/Src/ShaderLangGen/LSGShaderParser.h

00001 /* A Bison CShaderParser, made by GNU Bison 2.4.2.  */
00002 
00003 /* Skeleton interface for Bison LALR(1) parsers in C++
00004    
00005       Copyright (C) 2002-2010 Free Software Foundation, Inc.
00006    
00007    This program is free software: you can redistribute it and/or modify
00008    it under the terms of the GNU General Public License as published by
00009    the Free Software Foundation, either version 3 of the License, or
00010    (at your option) any later version.
00011    
00012    This program is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015    GNU General Public License for more details.
00016    
00017    You should have received a copy of the GNU General Public License
00018    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
00019 
00020 /* As a special exception, you may create a larger work that contains
00021    part or all of the Bison CShaderParser skeleton and distribute that work
00022    under terms of your choice, so long as that work isn't itself a
00023    CShaderParser generator using the skeleton or a modified version thereof
00024    as a CShaderParser skeleton.  Alternatively, if you modify or redistribute
00025    the CShaderParser skeleton itself, you may (at your option) remove this
00026    special exception, which will cause the skeleton and the resulting
00027    Bison output files to be licensed under the GNU General Public
00028    License without this special exception.
00029    
00030    This special exception was added by the Free Software Foundation in
00031    version 2.2 of Bison.  */
00032 
00033 /* C++ LALR(1) CShaderParser skeleton written by Akim Demaille.  */
00034 
00035 #ifndef __LSG_SHADER_PARSER_H__
00036 # define __LSG_SHADER_PARSER_H__
00037 
00038 
00039 
00040 
00041 
00042 #include "LSGShaderParserStack.h"
00043 
00044 
00045 namespace yy {
00046 
00047   class position;
00048   class location;
00049 
00050 } // yy
00051 
00052 
00053 #include "LSGShaderParserLocation.h"
00054 
00055 /* Enabling traces.  */
00056 #ifndef YYDEBUG
00057 # define YYDEBUG 0
00058 #endif
00059 
00060 /* Enabling verbose error messages.  */
00061 #ifdef YYERROR_VERBOSE
00062 # undef YYERROR_VERBOSE
00063 # define YYERROR_VERBOSE 1
00064 #else
00065 # define YYERROR_VERBOSE 0
00066 #endif
00067 
00068 /* Enabling the token table.  */
00069 #ifndef YYTOKEN_TABLE
00070 # define YYTOKEN_TABLE 0
00071 #endif
00072 
00073 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
00074    If N is 0, then set CURRENT to the empty location which ends
00075    the previous symbol: RHS[0] (always defined).  */
00076 
00077 #ifndef YYLLOC_DEFAULT
00078 # define YYLLOC_DEFAULT(Current, Rhs, N)                \
00079 do {                                                    \
00080   if (N)                                                \
00081     {                                                   \
00082       (Current).begin = (Rhs)[1].begin;                 \
00083       (Current).end   = (Rhs)[N].end;                   \
00084     }                                                   \
00085   else                                                  \
00086     {                                                   \
00087       (Current).begin = (Current).end = (Rhs)[0].end;   \
00088     }                                                   \
00089 } while (false)
00090 #endif
00091 
00092 
00093 namespace yy {
00094 
00095 
00097   class CShaderParser
00098   {
00099   public:
00101 #ifndef YYSTYPE
00102     typedef YYSTYPE semantic_type;
00103 #else
00104     typedef YYSTYPE semantic_type;
00105 #endif
00106 
00107     typedef location location_type;
00109     struct token
00110     {
00111       /* Tokens.  */
00112    enum yytokentype {
00113      LSG_SLT_CHAR_CONSTANT = 258,
00114      LSG_SLT_STRING_CONSTANT = 259,
00115      LSG_SLT_FLOAT_CONSTANT = 260,
00116      LSG_SLT_DEC_CONSTANT = 261,
00117      LSG_SLT_HEX_CONSTANT = 262,
00118      LSG_SLT_OCT_CONSTANT = 263,
00119      LSG_SLT_IDENTIFIER = 264,
00120      LSG_SLT_TYPENAME = 265,
00121      LSG_SLT_PLUS_EQUALS = 266,
00122      LSG_SLT_MINUS_EQUALS = 267,
00123      LSG_SLT_TIMES_EQUALS = 268,
00124      LSG_SLT_DIV_EQUALS = 269,
00125      LSG_SLT_MOD_EQUALS = 270,
00126      LSG_SLT_SHIFT_LEFT = 271,
00127      LSG_SLT_SHIFT_RIGHT = 272,
00128      LSG_SLT_AND_EQUALS = 273,
00129      LSG_SLT_XOR_EQUALS = 274,
00130      LSG_SLT_OR_EQUALS = 275,
00131      LSG_SLT_SHIFT_LEFT_EQUALS = 276,
00132      LSG_SLT_SHIFT_RIGHT_EQUALS = 277,
00133      LSG_SLT_NOT = 278,
00134      LSG_SLT_UMINUS = 279,
00135      LSG_SLT_UPLUS = 280,
00136      LSG_SLT_AND = 281,
00137      LSG_SLT_XOR = 282,
00138      LSG_SLT_OR = 283,
00139      LSG_SLT_GE = 284,
00140      LSG_SLT_LE = 285,
00141      LSG_SLT_EQUALS = 286,
00142      LSG_SLT_NOT_EQUALS = 287,
00143      LSG_SLT_PLUS_PLUS = 288,
00144      LSG_SLT_MINUS_MINUS = 289,
00145      LSG_SLT_BLENDSTATE = 290,
00146      LSG_SLT_BOOL = 291,
00147      LSG_SLT_BREAK = 292,
00148      LSG_SLT_CONST = 293,
00149      LSG_SLT_CONTINUE = 294,
00150      LSG_SLT_DISCARD = 295,
00151      LSG_SLT_DO = 296,
00152      LSG_SLT_ELSE = 297,
00153      LSG_SLT_FALSE = 298,
00154      LSG_SLT_FLOAT = 299,
00155      LSG_SLT_FOR = 300,
00156      LSG_SLT_IF = 301,
00157      LSG_SLT_IN = 302,
00158      LSG_SLT_INOUT = 303,
00159      LSG_SLT_INT = 304,
00160      LSG_SLT_MATRIX = 305,
00161      LSG_SLT_NOINTERPOLATION = 306,
00162      LSG_SLT_OUT = 307,
00163      LSG_SLT_RETURN = 308,
00164      LSG_SLT_SAMPLER1D = 309,
00165      LSG_SLT_SAMPLER2D = 310,
00166      LSG_SLT_SAMPLER3D = 311,
00167      LSG_SLT_SAMPLERCUBE = 312,
00168      LSG_SLT_SMOOTH = 313,
00169      LSG_SLT_STRUCT = 314,
00170      LSG_SLT_SWITCH = 315,
00171      LSG_SLT_TRUE = 316,
00172      LSG_SLT_UINT = 317,
00173      LSG_SLT_UNIFORM = 318,
00174      LSG_SLT_VEC2 = 319,
00175      LSG_SLT_VEC3 = 320,
00176      LSG_SLT_VEC4 = 321,
00177      LSG_SLT_VECTOR = 322,
00178      LSG_SLT_VOID = 323,
00179      LSG_SLT_WHILE = 324,
00180      LSG_SLT_ABS = 325,
00181      LSG_SLT_ACOS = 326,
00182      LSG_SLT_ANY = 327,
00183      LSG_SLT_ASIN = 328,
00184      LSG_SLT_ATAN = 329,
00185      LSG_SLT_ATAN2 = 330,
00186      LSG_SLT_CEIL = 331,
00187      LSG_SLT_CLAMP = 332,
00188      LSG_SLT_COS = 333,
00189      LSG_SLT_CROSS = 334,
00190      LSG_SLT_DEGREES = 335,
00191      LSG_SLT_DETERMINANT = 336,
00192      LSG_SLT_DISTANCE = 337,
00193      LSG_SLT_DOT = 338,
00194      LSG_SLT_EXP = 339,
00195      LSG_SLT_EXP2 = 340,
00196      LSG_SLT_FLOOR = 341,
00197      LSG_SLT_ISINF = 342,
00198      LSG_SLT_ISNAN = 343,
00199      LSG_SLT_LENGTH = 344,
00200      LSG_SLT_LERP = 345,
00201      LSG_SLT_LOG = 346,
00202      LSG_SLT_LOG2 = 347,
00203      LSG_SLT_MAX = 348,
00204      LSG_SLT_MIN = 349,
00205      LSG_SLT_MIX = 350,
00206      LSG_SLT_MOD = 351,
00207      LSG_SLT_MUL = 352,
00208      LSG_SLT_NORMALIZE = 353,
00209      LSG_SLT_POW = 354,
00210      LSG_SLT_RADIANS = 355,
00211      LSG_SLT_REFLECT = 356,
00212      LSG_SLT_REFRACT = 357,
00213      LSG_SLT_RSQRT = 358,
00214      LSG_SLT_SATURATE = 359,
00215      LSG_SLT_SIN = 360,
00216      LSG_SLT_SINCOS = 361,
00217      LSG_SLT_SMOOTHSTEP = 362,
00218      LSG_SLT_SQRT = 363,
00219      LSG_SLT_STEP = 364,
00220      LSG_SLT_TAN = 365,
00221      LSG_SLT_TEX1D = 366,
00222      LSG_SLT_TEX2D = 367,
00223      LSG_SLT_TEX3D = 368,
00224      LSG_SLT_TEXCUBE = 369,
00225      LSG_SLT_TRANSPOSE = 370,
00226      LSG_SLT_BINORMAL = 371,
00227      LSG_SLT_BLENDINDICES = 372,
00228      LSG_SLT_BLENDWEIGHT = 373,
00229      LSG_SLT_COLOR = 374,
00230      LSG_SLT_NORMAL = 375,
00231      LSG_SLT_POSITION = 376,
00232      LSG_SLT_POSITIONT = 377,
00233      LSG_SLT_PSIZE = 378,
00234      LSG_SLT_TANGENT = 379,
00235      LSG_SLT_TEXCOORD = 380,
00236      LSG_SLT_FOG = 381,
00237      LSG_SLT_TESSFACTOR = 382,
00238      LSG_SLT_VFACE = 383,
00239      LSG_SLT_VPOS = 384,
00240      LSG_SLT_DEPTH = 385,
00241      LSG_SLT_AMBIENTLIGHT = 386,
00242      LSG_SLT_LIGHTCOUNT = 387,
00243      LSG_SLT_DIRLIGHTCOUNT = 388,
00244      LSG_SLT_POINTLIGHTCOUNT = 389,
00245      LSG_SLT_SPOTLIGHTCOUNT = 390,
00246      LSG_SLT_LIGHTVECTOR = 391,
00247      LSG_SLT_LIGHTHALFVECTOR = 392,
00248      LSG_SLT_SPOTLIGHTDIR = 393,
00249      LSG_SLT_LIGHTAMBIENT = 394,
00250      LSG_SLT_LIGHTDIFFUSE = 395,
00251      LSG_SLT_LIGHTSPECULAR = 396,
00252      LSG_SLT_LIGHTATT = 397,
00253      LSG_SLT_SPOTLIGHTEXP = 398,
00254      LSG_SLT_SPOTLIGHTRANGE = 399,
00255      LSG_SLT_SKYCOLOR = 400,
00256      LSG_SLT_GROUNDCOLOR = 401,
00257      LSG_SLT_ANISOTROPY = 402,
00258      LSG_SLT_MATAMBIENT = 403,
00259      LSG_SLT_MATDIFFUSE = 404,
00260      LSG_SLT_MATEMISSIVE = 405,
00261      LSG_SLT_MATSPECULAR = 406,
00262      LSG_SLT_MATPOWER = 407,
00263      LSG_SLT_ROUGHNESS = 408,
00264      LSG_SLT_FOGSTART = 409,
00265      LSG_SLT_FOGEND = 410,
00266      LSG_SLT_FOGCOLOR = 411,
00267      LSG_SLT_SHADOWMAPPING = 412,
00268      LSG_SLT_NORMALMATRIX = 413,
00269      LSG_SLT_TEXMATRIX = 414,
00270      LSG_SLT_TEXUNIT = 415,
00271      LSG_SLT_TIMESINCELASTFRAME = 416,
00272      LSG_SLT_SHADOWMAPUNIT = 417,
00273      LSG_SLT_SHADOWMAPMATRIX = 418,
00274      LSG_SLT_SHADOWMAPUVDEPTHSCALES = 419,
00275      LSG_SLT_SHADOWMAPCASTERSIZE = 420,
00276      LSG_SLT_VIEW = 421,
00277      LSG_SLT_WORLD = 422,
00278      LSG_SLT_WORLDVIEW = 423,
00279      LSG_SLT_WORLDVIEWPROJ = 424
00280    };
00281 
00282     };
00284     typedef token::yytokentype token_type;
00285 
00287     CShaderParser (class CShaderLexer * _pslLexer, class CShaderLanguageParser * m_pslpContainer_yyarg);
00288     virtual ~CShaderParser ();
00289 
00292     virtual int parse ();
00293 
00294 #if YYDEBUG
00295 
00296     std::ostream& debug_stream () const;
00298     void set_debug_stream (std::ostream &);
00299 
00301     typedef int debug_level_type;
00303     debug_level_type debug_level () const;
00305     void set_debug_level (debug_level_type l);
00306 #endif
00307 
00308   private:
00312     virtual void error (const location_type& loc, const std::string& msg);
00313 
00317     virtual std::string yysyntax_error_ (int yystate);
00318 
00319 #if YYDEBUG
00320 
00321 
00322 
00323 
00324     virtual void yy_symbol_value_print_ (int yytype,
00325                                          const semantic_type* yyvaluep,
00326                                          const location_type* yylocationp);
00331     virtual void yy_symbol_print_ (int yytype,
00332                                    const semantic_type* yyvaluep,
00333                                    const location_type* yylocationp);
00334 #endif
00335 
00336 
00338     typedef int state_type;
00340     typedef stack<state_type>    state_stack_type;
00342     typedef stack<semantic_type> semantic_stack_type;
00344     typedef stack<location_type> location_stack_type;
00345 
00347     state_stack_type yystate_stack_;
00349     semantic_stack_type yysemantic_stack_;
00351     location_stack_type yylocation_stack_;
00352 
00354     typedef unsigned char token_number_type;
00355     /* Tables.  */
00357     static const short int yypact_[];
00358     static const short int yypact_ninf_;
00359 
00363     static const unsigned short int yydefact_[];
00364 
00365     static const short int yypgoto_[];
00366     static const short int yydefgoto_[];
00367 
00373     static const unsigned short int yytable_[];
00374     static const signed char yytable_ninf_;
00375 
00376     static const short int yycheck_[];
00377 
00379     static const unsigned short int yystos_[];
00380 
00382     static const unsigned short int yyr1_[];
00384     static const unsigned char yyr2_[];
00385 
00386 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
00387 
00388     static const char* const yytname_[];
00389 #endif
00390 
00391 #if YYERROR_VERBOSE
00392 
00393     virtual std::string yytnamerr_ (const char *n);
00394 #endif
00395 
00396 #if YYDEBUG
00397 
00398     typedef short int rhs_number_type;
00400     static const rhs_number_type yyrhs_[];
00402     static const unsigned short int yyprhs_[];
00404     static const unsigned short int yyrline_[];
00406     static const unsigned short int yytoken_number_[];
00408     virtual void yy_reduce_print_ (int r);
00410     virtual void yystack_print_ ();
00411 
00412     /* Debugging.  */
00413     int yydebug_;
00414     std::ostream* yycdebug_;
00415 #endif
00416 
00418     token_number_type yytranslate_ (int t);
00419 
00425     inline void yydestruct_ (const char* yymsg,
00426                              int yytype,
00427                              semantic_type* yyvaluep,
00428                              location_type* yylocationp);
00429 
00431     inline void yypop_ (unsigned int n = 1);
00432 
00433     /* Constants.  */
00434     static const int yyeof_;
00435     /* LAST_ -- Last index in TABLE_.  */
00436     static const int yylast_;
00437     static const int yynnts_;
00438     static const int yyempty_;
00439     static const int yyfinal_;
00440     static const int yyterror_;
00441     static const int yyerrcode_;
00442     static const int yyntokens_;
00443     static const unsigned int yyuser_token_number_max_;
00444     static const token_number_type yyundef_token_;
00445 
00446     /* User arguments.  */
00447     class CShaderLexer * m_pslLexer;
00448     class CShaderLanguageParser * m_pslpContainer;
00449   };
00450 
00451 } // yy
00452 
00453 
00454 
00455 
00456 #endif /* ! defined __LSG_SHADER_PARSER_H__ */
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator