mesa: Move src/mesa/glapi/dispatch.h to mesa.
[mesa.git] / src / mesa / shader / program_lexer.l
index 9e68c34ac0aec463cc078c3c8fa4c58cdf174bbd..83bc5089d9e157e5ffcd77a6570cdb3d4f4df605 100644 (file)
  * DEALINGS IN THE SOFTWARE.
  */
 #include "main/glheader.h"
-#include "prog_instruction.h"
+#include "main/imports.h"
+#include "shader/prog_instruction.h"
+#include "shader/prog_statevars.h"
 
-#include "program_parser.h"
-#include "program_parse.tab.h"
+#include "shader/symbol_table.h"
+#include "shader/program_parser.h"
+#include "shader/program_parse.tab.h"
 
 #define require_ARB_vp (yyextra->mode == ARB_vertex)
 #define require_ARB_fp (yyextra->mode == ARB_fragment)
 #define require_rect   (yyextra->option.TexRect)
 #define require_texarray        (yyextra->option.TexArray)
 
+#ifndef HAVE_UNISTD_H
+#define YY_NO_UNISTD_H
+#endif
+
 #define return_token_or_IDENTIFIER(condition, token)   \
    do {                                                        \
       if (condition) {                                 \
@@ -226,6 +233,8 @@ TXP{cc}{sat}       { return_opcode(require_ARB_fp, SAMPLE_OP, TXP, 3); }
 
 UP2H{cc}{sat}      { return_opcode(require_NV_fp,  SCALAR_OP, UP2H, 4); }
 UP2US{cc}{sat}     { return_opcode(require_NV_fp,  SCALAR_OP, UP2US, 5); }
+UP4B{cc}{sat}      { return_opcode(require_NV_fp,  SCALAR_OP, UP4B, 4); }
+UP4UB{cc}{sat}     { return_opcode(require_NV_fp,  SCALAR_OP, UP4UB, 5); }
 
 X2D{szf}{cc}{sat}  { return_opcode(require_NV_fp,  TRI_OP, X2D, 3); }
 XPD{sat}           { return_opcode(             1, BIN_OP, XPD, 3); }
@@ -268,7 +277,7 @@ result                    { return RESULT; }
 {dot}palette              { return PALETTE; }
 {dot}params               { return PARAMS; }
 {dot}plane                { return PLANE; }
-{dot}point                { return_token_or_DOT(require_ARB_vp, POINT); }
+{dot}point                { return_token_or_DOT(require_ARB_vp, POINT_TOK); }
 {dot}pointsize            { return_token_or_DOT(require_ARB_vp, POINTSIZE); }
 {dot}position             { return POSITION; }
 {dot}primary              { return PRIMARY; }
@@ -278,7 +287,7 @@ result                    { return RESULT; }
 {dot}scenecolor           { return SCENECOLOR; }
 {dot}secondary            { return SECONDARY; }
 {dot}shininess            { return SHININESS; }
-{dot}size                 { return_token_or_DOT(require_ARB_vp, SIZE); }
+{dot}size                 { return_token_or_DOT(require_ARB_vp, SIZE_TOK); }
 {dot}specular             { return SPECULAR; }
 {dot}spot                 { return SPOT; }
 {dot}texcoord             { return TEXCOORD; }
@@ -315,19 +324,19 @@ ARRAYSHADOW2D             { return_token_or_IDENTIFIER(require_ARB_fp && require
    return INTEGER;
 }
 {num}?{frac}{exp}?        {
-   yylval->real = strtod(yytext, NULL);
+   yylval->real = _mesa_strtod(yytext, NULL);
    return REAL;
 }
 {num}"."/[^.]             {
-   yylval->real = strtod(yytext, NULL);
+   yylval->real = _mesa_strtod(yytext, NULL);
    return REAL;
 }
 {num}{exp}                {
-   yylval->real = strtod(yytext, NULL);
+   yylval->real = _mesa_strtod(yytext, NULL);
    return REAL;
 }
 {num}"."{exp}             {
-   yylval->real = strtod(yytext, NULL);
+   yylval->real = _mesa_strtod(yytext, NULL);
    return REAL;
 }