#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "main/mtypes.h"
#include "main/imports.h"
#include "program.h"
#include "prog_parameter.h"
#include "prog_parameter_layout.h"
#include "prog_statevars.h"
#include "prog_instruction.h"
#include "symbol_table.h"
#include "program_parser.h"
Data Structures | |
union | YYSTYPE |
union | yyalloc |
Defines | |
#define | YYBISON 1 |
#define | YYBISON_VERSION "2.4.1" |
#define | YYSKELETON_NAME "yacc.c" |
#define | YYPURE 1 |
#define | YYPUSH 0 |
#define | YYPULL 1 |
#define | YYLSP_NEEDED 1 |
#define | FALSE 0 |
#define | TRUE (!FALSE) |
#define | YYLLOC_DEFAULT(Current, Rhs, N) |
#define | YYLEX_PARAM state->scanner |
#define | YYDEBUG 0 |
#define | YYERROR_VERBOSE 1 |
#define | YYTOKEN_TABLE 0 |
#define | YYSTYPE_IS_TRIVIAL 1 |
#define | yystype YYSTYPE |
#define | YYSTYPE_IS_DECLARED 1 |
#define | YYSIZE_T unsigned int |
#define | YYSIZE_MAXIMUM ((YYSIZE_T) -1) |
#define | YY_(msgid) msgid |
#define | YYUSE(e) ((void) (e)) |
#define | YYID(n) (n) |
#define | YYSTACK_ALLOC YYMALLOC |
#define | YYSTACK_FREE YYFREE |
#define | YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM |
#define | YYMALLOC malloc |
#define | YYFREE free |
#define | YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) |
#define | YYSTACK_BYTES(N) |
#define | YYCOPY(To, From, Count) |
#define | YYSTACK_RELOCATE(Stack_alloc, Stack) |
#define | YYFINAL 5 |
#define | YYLAST 396 |
#define | YYNTOKENS 120 |
#define | YYNNTS 143 |
#define | YYNRULES 282 |
#define | YYNSTATES 475 |
#define | YYUNDEFTOK 2 |
#define | YYMAXUTOK 362 |
#define | YYTRANSLATE(YYX) ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) |
#define | YYPACT_NINF -401 |
#define | YYTABLE_NINF -230 |
#define | yyerrok (yyerrstatus = 0) |
#define | yyclearin (yychar = YYEMPTY) |
#define | YYEMPTY (-2) |
#define | YYEOF 0 |
#define | YYACCEPT goto yyacceptlab |
#define | YYABORT goto yyabortlab |
#define | YYERROR goto yyerrorlab |
#define | YYFAIL goto yyerrlab |
#define | YYRECOVERING() (!!yyerrstatus) |
#define | YYBACKUP(Token, Value) |
#define | YYTERROR 1 |
#define | YYERRCODE 256 |
#define | YYRHSLOC(Rhs, K) ((Rhs)[K]) |
#define | YY_LOCATION_PRINT(File, Loc) |
#define | YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) |
#define | YYDPRINTF(Args) |
#define | YY_SYMBOL_PRINT(Title, Type, Value, Location) |
#define | YY_STACK_PRINT(Bottom, Top) |
#define | YY_REDUCE_PRINT(Rule) |
#define | YYINITDEPTH 200 |
#define | YYMAXDEPTH 10000 |
#define | YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) |
Typedefs | |
typedef unsigned char | yytype_uint8 |
typedef short int | yytype_int8 |
typedef unsigned short int | yytype_uint16 |
typedef short int | yytype_int16 |
Enumerations | |
enum | yytokentype { ARBvp_10 = 258, ARBfp_10 = 259, ADDRESS = 260, ALIAS = 261, ATTRIB = 262, OPTION = 263, OUTPUT = 264, PARAM = 265, TEMP = 266, END = 267, BIN_OP = 268, BINSC_OP = 269, SAMPLE_OP = 270, SCALAR_OP = 271, TRI_OP = 272, VECTOR_OP = 273, ARL = 274, KIL = 275, SWZ = 276, TXD_OP = 277, INTEGER = 278, REAL = 279, AMBIENT = 280, ATTENUATION = 281, BACK = 282, CLIP = 283, COLOR = 284, DEPTH = 285, DIFFUSE = 286, DIRECTION = 287, EMISSION = 288, ENV = 289, EYE = 290, FOG = 291, FOGCOORD = 292, FRAGMENT = 293, FRONT = 294, HALF = 295, INVERSE = 296, INVTRANS = 297, LIGHT = 298, LIGHTMODEL = 299, LIGHTPROD = 300, LOCAL = 301, MATERIAL = 302, MAT_PROGRAM = 303, MATRIX = 304, MATRIXINDEX = 305, MODELVIEW = 306, MVP = 307, NORMAL = 308, OBJECT = 309, PALETTE = 310, PARAMS = 311, PLANE = 312, POINT_TOK = 313, POINTSIZE = 314, POSITION = 315, PRIMARY = 316, PROGRAM = 317, PROJECTION = 318, RANGE = 319, RESULT = 320, ROW = 321, SCENECOLOR = 322, SECONDARY = 323, SHININESS = 324, SIZE_TOK = 325, SPECULAR = 326, SPOT = 327, STATE = 328, TEXCOORD = 329, TEXENV = 330, TEXGEN = 331, TEXGEN_Q = 332, TEXGEN_R = 333, TEXGEN_S = 334, TEXGEN_T = 335, TEXTURE = 336, TRANSPOSE = 337, TEXTURE_UNIT = 338, TEX_1D = 339, TEX_2D = 340, TEX_3D = 341, TEX_CUBE = 342, TEX_RECT = 343, TEX_SHADOW1D = 344, TEX_SHADOW2D = 345, TEX_SHADOWRECT = 346, TEX_ARRAY1D = 347, TEX_ARRAY2D = 348, TEX_ARRAYSHADOW1D = 349, TEX_ARRAYSHADOW2D = 350, VERTEX = 351, VTXATTRIB = 352, WEIGHT = 353, IDENTIFIER = 354, USED_IDENTIFIER = 355, MASK4 = 356, MASK3 = 357, MASK2 = 358, MASK1 = 359, SWIZZLE = 360, DOT_DOT = 361, DOT = 362, ARBvp_10 = 258, ARBfp_10 = 259, ADDRESS = 260, ALIAS = 261, ATTRIB = 262, OPTION = 263, OUTPUT = 264, PARAM = 265, TEMP = 266, END = 267, BIN_OP = 268, BINSC_OP = 269, SAMPLE_OP = 270, SCALAR_OP = 271, TRI_OP = 272, VECTOR_OP = 273, ARL = 274, KIL = 275, SWZ = 276, TXD_OP = 277, INTEGER = 278, REAL = 279, AMBIENT = 280, ATTENUATION = 281, BACK = 282, CLIP = 283, COLOR = 284, DEPTH = 285, DIFFUSE = 286, DIRECTION = 287, EMISSION = 288, ENV = 289, EYE = 290, FOG = 291, FOGCOORD = 292, FRAGMENT = 293, FRONT = 294, HALF = 295, INVERSE = 296, INVTRANS = 297, LIGHT = 298, LIGHTMODEL = 299, LIGHTPROD = 300, LOCAL = 301, MATERIAL = 302, MAT_PROGRAM = 303, MATRIX = 304, MATRIXINDEX = 305, MODELVIEW = 306, MVP = 307, NORMAL = 308, OBJECT = 309, PALETTE = 310, PARAMS = 311, PLANE = 312, POINT_TOK = 313, POINTSIZE = 314, POSITION = 315, PRIMARY = 316, PROGRAM = 317, PROJECTION = 318, RANGE = 319, RESULT = 320, ROW = 321, SCENECOLOR = 322, SECONDARY = 323, SHININESS = 324, SIZE_TOK = 325, SPECULAR = 326, SPOT = 327, STATE = 328, TEXCOORD = 329, TEXENV = 330, TEXGEN = 331, TEXGEN_Q = 332, TEXGEN_R = 333, TEXGEN_S = 334, TEXGEN_T = 335, TEXTURE = 336, TRANSPOSE = 337, TEXTURE_UNIT = 338, TEX_1D = 339, TEX_2D = 340, TEX_3D = 341, TEX_CUBE = 342, TEX_RECT = 343, TEX_SHADOW1D = 344, TEX_SHADOW2D = 345, TEX_SHADOWRECT = 346, TEX_ARRAY1D = 347, TEX_ARRAY2D = 348, TEX_ARRAYSHADOW1D = 349, TEX_ARRAYSHADOW2D = 350, VERTEX = 351, VTXATTRIB = 352, WEIGHT = 353, IDENTIFIER = 354, USED_IDENTIFIER = 355, MASK4 = 356, MASK3 = 357, MASK2 = 358, MASK1 = 359, SWIZZLE = 360, DOT_DOT = 361, DOT = 362 } |
Functions | |
void * | yy_scan_string (char *) |
void | yy_delete_buffer (void *) |
static struct asm_symbol * | declare_variable (struct asm_parser_state *state, char *name, enum asm_type t, struct YYLTYPE *locp) |
static int | add_state_reference (struct gl_program_parameter_list *param_list, const gl_state_index tokens[STATE_LENGTH]) |
static int | initialize_symbol_from_state (struct gl_program *prog, struct asm_symbol *param_var, const gl_state_index tokens[STATE_LENGTH]) |
static int | initialize_symbol_from_param (struct gl_program *prog, struct asm_symbol *param_var, const gl_state_index tokens[STATE_LENGTH]) |
static int | initialize_symbol_from_const (struct gl_program *prog, struct asm_symbol *param_var, const struct asm_vector *vec) |
static int | yyparse (struct asm_parser_state *state) |
static char * | make_error_string (const char *fmt,...) |
static void | yyerror (struct YYLTYPE *locp, struct asm_parser_state *state, const char *s) |
static int | validate_inputs (struct YYLTYPE *locp, struct asm_parser_state *state) |
Validate the set of inputs used by a program. | |
static void | init_dst_reg (struct prog_dst_register *r) |
static void | init_src_reg (struct asm_src_register *r) |
static void | asm_instruction_set_operands (struct asm_instruction *inst, const struct prog_dst_register *dst, const struct asm_src_register *src0, const struct asm_src_register *src1, const struct asm_src_register *src2) |
static struct asm_instruction * | asm_instruction_ctor (gl_inst_opcode op, const struct prog_dst_register *dst, const struct asm_src_register *src0, const struct asm_src_register *src1, const struct asm_src_register *src2) |
static struct asm_instruction * | asm_instruction_copy_ctor (const struct prog_instruction *base, const struct prog_dst_register *dst, const struct asm_src_register *src0, const struct asm_src_register *src1, const struct asm_src_register *src2) |
int | yylex (YYSTYPE *yylval_param, YYLTYPE *yylloc_param, void *yyscanner) |
static YYSIZE_T | yystrlen (char *yystr) const |
static char * | yystpcpy (char *yydest, const char *yysrc) |
static YYSIZE_T | yytnamerr (char *yyres, const char *yystr) |
static YYSIZE_T | yysyntax_error (char *yyresult, int yystate, int yychar) |
static void | yydestruct (char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, struct asm_parser_state *state) const |
int | yyparse () |
GLboolean | _mesa_parse_arb_program (GLcontext *ctx, GLenum target, const GLubyte *str, GLsizei len, struct asm_parser_state *state) |
Variables | |
static const yytype_uint8 | yytranslate [] |
static const char *const | yytname [] |
static const yytype_uint16 | yyr1 [] |
static const yytype_uint8 | yyr2 [] |
static const yytype_uint16 | yydefact [] |
static const yytype_int16 | yydefgoto [] |
static const yytype_int16 | yypact [] |
static const yytype_int16 | yypgoto [] |
static const yytype_int16 | yytable [] |
static const yytype_int16 | yycheck [] |
static const yytype_uint16 | yystos [] |
#define FALSE 0 |
#define TRUE (!FALSE) |
#define YY_ | ( | msgid | ) | msgid |
#define YY_LOCATION_PRINT | ( | File, | |||
Loc | ) |
Value:
fprintf (File, "%d.%d-%d.%d", \
(Loc).first_line, (Loc).first_column, \
(Loc).last_line, (Loc).last_column)
#define YY_REDUCE_PRINT | ( | Rule | ) |
#define YY_STACK_PRINT | ( | Bottom, | |||
Top | ) |
#define YY_SYMBOL_PRINT | ( | Title, | |||
Type, | |||||
Value, | |||||
Location | ) |
#define YYABORT goto yyabortlab |
#define YYACCEPT goto yyacceptlab |
#define YYBACKUP | ( | Token, | |||
Value | ) |
Value:
do \ if (yychar == YYEMPTY && yylen == 1) \ { \ yychar = (Token); \ yylval = (Value); \ yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK (1); \ goto yybackup; \ } \ else \ { \ yyerror (&yylloc, state, YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (YYID (0))
#define YYBISON 1 |
#define YYBISON_VERSION "2.4.1" |
#define yyclearin (yychar = YYEMPTY) |
#define YYCOPY | ( | To, | |||
From, | |||||
Count | ) |
#define YYDEBUG 0 |
#define YYDPRINTF | ( | Args | ) |
#define YYEMPTY (-2) |
#define YYEOF 0 |
#define YYERRCODE 256 |
#define yyerrok (yyerrstatus = 0) |
#define YYERROR goto yyerrorlab |
#define YYERROR_VERBOSE 1 |
#define YYFAIL goto yyerrlab |
#define YYFINAL 5 |
#define YYFREE free |
#define YYID | ( | n | ) | (n) |
#define YYINITDEPTH 200 |
#define YYLAST 396 |
#define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) |
#define YYLEX_PARAM state->scanner |
#define YYLLOC_DEFAULT | ( | Current, | |||
Rhs, | |||||
N | ) |
Value:
do { \ if (YYID(N)) { \ (Current).first_line = YYRHSLOC(Rhs, 1).first_line; \ (Current).first_column = YYRHSLOC(Rhs, 1).first_column; \ (Current).position = YYRHSLOC(Rhs, 1).position; \ (Current).last_line = YYRHSLOC(Rhs, N).last_line; \ (Current).last_column = YYRHSLOC(Rhs, N).last_column; \ } else { \ (Current).first_line = YYRHSLOC(Rhs, 0).last_line; \ (Current).last_line = (Current).first_line; \ (Current).first_column = YYRHSLOC(Rhs, 0).last_column; \ (Current).last_column = (Current).first_column; \ (Current).position = YYRHSLOC(Rhs, 0).position \ + (Current).first_column; \ } \ } while(YYID(0))
#define YYLSP_NEEDED 1 |
#define YYMALLOC malloc |
#define YYMAXDEPTH 10000 |
#define YYMAXUTOK 362 |
#define YYNNTS 143 |
#define YYNRULES 282 |
#define YYNSTATES 475 |
#define YYNTOKENS 120 |
#define YYPACT_NINF -401 |
#define YYPOPSTACK | ( | N | ) | (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) |
#define YYPULL 1 |
#define YYPURE 1 |
#define YYPUSH 0 |
#define YYRECOVERING | ( | ) | (!!yyerrstatus) |
#define YYRHSLOC | ( | Rhs, | |||
K | ) | ((Rhs)[K]) |
#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) |
#define YYSIZE_T unsigned int |
#define YYSKELETON_NAME "yacc.c" |
#define YYSTACK_ALLOC YYMALLOC |
#define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM |
#define YYSTACK_BYTES | ( | N | ) |
Value:
((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ + 2 * YYSTACK_GAP_MAXIMUM)
#define YYSTACK_FREE YYFREE |
#define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) |
#define YYSTACK_RELOCATE | ( | Stack_alloc, | |||
Stack | ) |
Value:
do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ Stack = &yyptr->Stack_alloc; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (YYID (0))
#define yystype YYSTYPE |
#define YYSTYPE_IS_DECLARED 1 |
#define YYSTYPE_IS_TRIVIAL 1 |
#define YYTABLE_NINF -230 |
#define YYTERROR 1 |
#define YYTOKEN_TABLE 0 |
#define YYTRANSLATE | ( | YYX | ) | ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) |
#define YYUNDEFTOK 2 |
#define YYUSE | ( | e | ) | ((void) (e)) |
typedef short int yytype_int16 |
typedef short int yytype_int8 |
typedef unsigned short int yytype_uint16 |
typedef unsigned char yytype_uint8 |
enum yytokentype |
GLboolean _mesa_parse_arb_program | ( | GLcontext * | ctx, | |
GLenum | target, | |||
const GLubyte * | str, | |||
GLsizei | len, | |||
struct asm_parser_state * | state | |||
) |
int add_state_reference | ( | struct gl_program_parameter_list * | param_list, | |
const gl_state_index | tokens[STATE_LENGTH] | |||
) | [static] |
struct asm_instruction * asm_instruction_copy_ctor | ( | const struct prog_instruction * | base, | |
const struct prog_dst_register * | dst, | |||
const struct asm_src_register * | src0, | |||
const struct asm_src_register * | src1, | |||
const struct asm_src_register * | src2 | |||
) | [static, read] |
struct asm_instruction * asm_instruction_ctor | ( | gl_inst_opcode | op, | |
const struct prog_dst_register * | dst, | |||
const struct asm_src_register * | src0, | |||
const struct asm_src_register * | src1, | |||
const struct asm_src_register * | src2 | |||
) | [static, read] |
void asm_instruction_set_operands | ( | struct asm_instruction * | inst, | |
const struct prog_dst_register * | dst, | |||
const struct asm_src_register * | src0, | |||
const struct asm_src_register * | src1, | |||
const struct asm_src_register * | src2 | |||
) | [static] |
struct asm_symbol * declare_variable | ( | struct asm_parser_state * | state, | |
char * | name, | |||
enum asm_type | t, | |||
struct YYLTYPE * | locp | |||
) | [static, read] |
void init_dst_reg | ( | struct prog_dst_register * | r | ) | [static] |
void init_src_reg | ( | struct asm_src_register * | r | ) | [static] |
int initialize_symbol_from_const | ( | struct gl_program * | prog, | |
struct asm_symbol * | param_var, | |||
const struct asm_vector * | vec | |||
) | [static] |
int initialize_symbol_from_param | ( | struct gl_program * | prog, | |
struct asm_symbol * | param_var, | |||
const gl_state_index | tokens[STATE_LENGTH] | |||
) | [static] |
int initialize_symbol_from_state | ( | struct gl_program * | prog, | |
struct asm_symbol * | param_var, | |||
const gl_state_index | tokens[STATE_LENGTH] | |||
) | [static] |
char * make_error_string | ( | const char * | fmt, | |
... | ||||
) | [static] |
int validate_inputs | ( | struct YYLTYPE * | locp, | |
struct asm_parser_state * | state | |||
) | [static] |
Validate the set of inputs used by a program.
Validates that legal sets of inputs are used by the program. In this case "used" included both reading the input or binding the input to a name using the ATTRIB
command.
TRUE
if the combination of inputs used is valid, FALSE
otherwise. void yy_delete_buffer | ( | void * | ) |
void* yy_scan_string | ( | char * | ) |
static void yydestruct | ( | char * | yymsg, | |
int | yytype, | |||
YYSTYPE * | yyvaluep, | |||
YYLTYPE * | yylocationp, | |||
struct asm_parser_state * | state | |||
) | const [static] |
void yyerror | ( | struct YYLTYPE * | locp, | |
struct asm_parser_state * | state, | |||
const char * | s | |||
) | [static] |
int yyparse | ( | ) |
int yyparse | ( | struct asm_parser_state * | state | ) | [static] |
static char* yystpcpy | ( | char * | yydest, | |
const char * | yysrc | |||
) | [static] |
static YYSIZE_T yystrlen | ( | char * | yystr | ) | const [static] |
static YYSIZE_T yysyntax_error | ( | char * | yyresult, | |
int | yystate, | |||
int | yychar | |||
) | [static] |
static YYSIZE_T yytnamerr | ( | char * | yyres, | |
const char * | yystr | |||
) | [static] |
const yytype_int16 yycheck[] [static] |
const yytype_uint16 yydefact[] [static] |
const yytype_int16 yydefgoto[] [static] |
Initial value:
{ -1, 3, 4, 6, 8, 9, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 298, 411, 41, 161, 231, 74, 60, 69, 345, 346, 384, 232, 61, 126, 279, 280, 281, 381, 427, 429, 70, 344, 111, 296, 115, 103, 160, 75, 227, 76, 228, 42, 43, 127, 206, 338, 274, 336, 172, 44, 45, 46, 144, 90, 287, 389, 145, 128, 390, 391, 129, 186, 315, 187, 418, 440, 188, 251, 189, 441, 190, 330, 316, 307, 191, 333, 371, 192, 246, 193, 305, 194, 264, 195, 434, 450, 196, 325, 326, 373, 261, 319, 363, 365, 361, 197, 130, 393, 394, 455, 131, 395, 457, 132, 301, 303, 396, 133, 149, 134, 135, 151, 77, 47, 139, 48, 49, 54, 85, 50, 62, 97, 155, 221, 252, 238, 157, 352, 266, 223, 398, 328, 51, 12 }
const yytype_int16 yypact[] [static] |
const yytype_int16 yypgoto[] [static] |
Initial value:
{ -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, -69, -82, -401, -100, 151, -86, 210, -401, -401, -366, -401, -54, -401, -401, -401, -401, -401, -401, -401, -401, 174, -401, -401, -401, -118, -401, -401, 229, -401, -401, -401, -401, -401, 295, -401, -401, -401, 110, -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, -51, -401, -88, -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, -311, 139, -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, -2, -401, -401, -400, -401, -401, -401, -401, -401, -401, 298, -401, -401, -401, -401, -401, -401, -401, -390, -295, 302, -401, -401, -136, -87, -120, -89, -401, -401, -401, -401, -401, 251, -401, 176, -401, -401, -401, -176, 198, -153, -401, -401, -401, -401, -401, -401, -6 }
const yytype_uint16 yyr1[] [static] |
const yytype_uint8 yyr2[] [static] |
const yytype_uint16 yystos[] [static] |
const yytype_int16 yytable[] [static] |
const char* const yytname[] [static] |
const yytype_uint8 yytranslate[] [static] |