source: OGRE/trunk/ogrenew/RenderSystems/GL/src/nvparse/ts1.0_tokens.l @ 657

Revision 657, 4.8 KB checked in by mattausch, 19 years ago (diff)

added ogre dependencies and patched ogre sources

Line 
1/* definitions */
2digit    [0-9]
3char     [a-zA-Z_.]
4alphanum [0-9a-zA-Z_]
5%option prefix="ts10_"
6%{  /* code to be included */
7#include <stdlib.h>
8#include "ts1.0_inst.h"
9#include "ts1.0_inst_list.h"
10#include "_ts1.0_parser.h"
11#ifdef _WIN32
12# include <windows.h>
13#endif
14
15#if defined(__APPLE__) && defined(__GNUC__)
16#include <OpenGL/gl.h>
17#else
18#include <GL/gl.h>
19#endif
20
21#include "nvparse_errors.h"
22#include "nvparse_externs.h"
23
24
25#define YY_INPUT(buf,result,max_size) \
26{ \
27        int c = *myin++; \
28        result = (c == 0) ? YY_NULL : (buf[0] = c, 1); \
29}
30
31#define YY_ALWAYS_INTERACTIVE 1
32
33%}
34/* end of definitions */
35%%
36
37\/\*                    {
38                            A:
39                                switch (yyinput()) {
40                                  case '*': goto B;
41                                  case 0: errors.set("end-of-file in comment", line_number); break;
42                                  case '\n': line_number++;
43                                  default:  goto A;
44                                }
45                            B:
46                                switch (yyinput()) {
47                                  case '*': goto B;
48                                  case '/': break;
49                                  case 0: errors.set("end-of-file in comment", line_number); break;
50                                  case '\n': line_number++;
51                                  default:  goto A;
52                                }
53                        }
54
55\/\/            {
56                            char ch;
57                            while ((ch = yyinput()) != '\n');
58                            if (ch == '\n') line_number++;
59                        }
60
61\#                      {
62                            char ch;
63                            while ((ch = yyinput()) != '\n');
64                            if (ch == '\n') line_number++;
65                        }
66
67\(                      return(openParen);
68\)                      return(closeParen);
69;                       return(semicolon);
70,                       return(comma);
71
72!!TS1\.0    { /* eat header */ }
73
74tex0            {
75                            ts10_lval.fval = (float)0;
76                            return(texVariable);
77                        }
78
79tex1            {
80                            ts10_lval.fval = (float)1;
81                            return(texVariable);
82                        }
83
84tex2            {
85                            ts10_lval.fval = (float)2;
86                            return(texVariable);
87                        }
88
89expand          return(expandString);
90
91GEQUAL_TO_ZERO  {
92                                ts10_lval.fval = (float)GL_GEQUAL;
93                                return (gequal);
94                        }
95
96LESS_THAN_ZERO  {
97                                ts10_lval.fval = (float)GL_LESS;
98                                return(less);
99                        }
100
101nop                     return(nop);
102texture_1d              return(texture_1d);
103texture_2d              return(texture_2d);
104texture_rectangle       return(texture_rectangle);
105texture_3d              return(texture_3d);
106texture_cube_map return(texture_cube_map);
107cull_fragment   return(cull_fragment);
108pass_through    return(pass_through);
109offset_2d_scale return(offset_2d_scale);
110offset_2d       return(offset_2d);
111offset_rectangle_scale return(offset_rectangle_scale);
112offset_rectangle        return(offset_rectangle);
113dependent_ar    return(dependent_ar);
114dependent_gb    return(dependent_gb);
115
116dot_product_2d_1of2     return(dot_product_2d_1of2);
117dot_product_2d_2of2 return(dot_product_2d_2of2);
118
119dot_product_rectangle_1of2      return(dot_product_rectangle_1of2);
120dot_product_rectangle_2of2 return(dot_product_rectangle_2of2);
121
122dot_product_depth_replace_1of2  return(dot_product_depth_replace_1of2);
123dot_product_depth_replace_2of2 return(dot_product_depth_replace_2of2);
124
125dot_product_3d_1of3     return(dot_product_3d_1of3);
126dot_product_3d_2of3     return(dot_product_3d_2of3);
127dot_product_3d_3of3     return(dot_product_3d_3of3);
128
129dot_product_cube_map_1of3       return(dot_product_cube_map_1of3);
130dot_product_cube_map_2of3       return(dot_product_cube_map_2of3);
131dot_product_cube_map_3of3       return(dot_product_cube_map_3of3);
132
133dot_product_reflect_cube_map_eye_from_qs_1of3   return(dot_product_reflect_cube_map_eye_from_qs_1of3);
134dot_product_reflect_cube_map_eye_from_qs_2of3   return(dot_product_reflect_cube_map_eye_from_qs_2of3);
135dot_product_reflect_cube_map_eye_from_qs_3of3   return(dot_product_reflect_cube_map_eye_from_qs_3of3);
136
137dot_product_reflect_cube_map_const_eye_1of3     return(dot_product_reflect_cube_map_const_eye_1of3);
138dot_product_reflect_cube_map_const_eye_2of3     return(dot_product_reflect_cube_map_const_eye_2of3);
139dot_product_reflect_cube_map_const_eye_3of3     return(dot_product_reflect_cube_map_const_eye_3of3);
140
141dot_product_cube_map_and_reflect_cube_map_eye_from_qs_1of3      return(dot_product_cube_map_and_reflect_cube_map_eye_from_qs_1of3);
142dot_product_cube_map_and_reflect_cube_map_eye_from_qs_2of3      return(dot_product_cube_map_and_reflect_cube_map_eye_from_qs_2of3);
143dot_product_cube_map_and_reflect_cube_map_eye_from_qs_3of3      return(dot_product_cube_map_and_reflect_cube_map_eye_from_qs_3of3);
144
145dot_product_cube_map_and_reflect_cube_map_const_eye_1of3        return(dot_product_cube_map_and_reflect_cube_map_const_eye_1of3);
146dot_product_cube_map_and_reflect_cube_map_const_eye_2of3        return(dot_product_cube_map_and_reflect_cube_map_const_eye_2of3);
147dot_product_cube_map_and_reflect_cube_map_const_eye_3of3        return(dot_product_cube_map_and_reflect_cube_map_const_eye_3of3);
148
149[+-]?[0-9]+\.[0-9]*     {
150                                ts10_lval.fval = (float)atof(yytext);
151                                return(floatValue);
152                        }
153
154[+-]?[0-9]*\.[0-9]+     {
155                                ts10_lval.fval = (float)atof(yytext);
156                                return(floatValue);
157                        }
158
159[+-]?[0-9]+             {
160                                ts10_lval.fval = (float)atof(yytext);
161                                return(floatValue);
162                        }
163
164\r*\n           {
165                                line_number++;
166                        }
167
168[ \t]+          {}
169
170{alphanum}+ {
171                                errors.set("unrecognized token", line_number);
172                        }
173                               
174
175%%
176
177bool ts10_init_more();
178
179bool ts10_init(char* inputString)
180{
181    myin = inputString;
182        return ts10_init_more();
183}
184
185
186#ifndef ts10_wrap
187int ts10_wrap(void)
188{
189  return(1);
190}
191#endif
Note: See TracBrowser for help on using the repository browser.