Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(925)

Side by Side Diff: src/sksl/sksl.flex

Issue 1984363002: initial checkin of SkSL compiler (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: documentation and cleanups Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 /*
2
3 This file is IGNORED during the build process!
4
5 As this file is updated so infrequently and flex is not universally pres ent on build machines,
6 the lex.sksl.c file must be manually regenerated if you make any changes to this file. Just run:
7
8 flex sksl.flex
9
10 */
11
12 %option prefix="sksl"
13 %option yylineno
14 %option never-interactive
15 %option nounistd
16
17 %{
18 // generated from sksl.flex
19 // NOT AUTOGENERATED DURING THE BUILD, you must manually run flex on sksl.flex t o regenerate this
20 // file
21 %}
22
23 DIGIT [0-9]
24 LETTER [a-zA-Z_$]
25
26 %%
27
28 {DIGIT}*"."{DIGIT}+([eE][+-]?{DIGIT}+)? { return SkSL::Token::FLOAT_LITERAL; }
29
30 {DIGIT}+"."{DIGIT}*([eE][+-]?{DIGIT}+)? { return SkSL::Token::FLOAT_LITERAL; }
31
32 {DIGIT}+([eE][+-]?{DIGIT}+) { return SkSL::Token::FLOAT_LITERAL; }
33
34 {DIGIT}+ { return SkSL::Token::INT_LITERAL; }
35
36 true { return SkSL::Token::TRUE_LITERAL; }
37
38 false { return SkSL::Token::FALSE_LITERAL; }
39
40 if { return SkSL::Token::IF; }
41
42 else { return SkSL::Token::ELSE; }
43
44 for { return SkSL::Token::FOR; }
45
46 while { return SkSL::Token::WHILE; }
47
48 do { return SkSL::Token::DO; }
49
50 break { return SkSL::Token::BREAK; }
51
52 continue { return SkSL::Token::CONTINUE; }
53
54 discard { return SkSL::Token::DISCARD; }
55
56 return { return SkSL::Token::RETURN; }
57
58 in { return SkSL::Token::IN; }
59
60 out { return SkSL::Token::OUT; }
61
62 inout { return SkSL::Token::INOUT; }
63
64 uniform { return SkSL::Token::UNIFORM; }
65
66 const { return SkSL::Token::CONST; }
67
68 lowp { return SkSL::Token::LOWP; }
69
70 mediump { return SkSL::Token::MEDIUMP; }
71
72 highp { return SkSL::Token::HIGHP; }
73
74 struct { return SkSL::Token::STRUCT; }
75
76 layout { return SkSL::Token::LAYOUT; }
77
78 precision { return SkSL::Token::PRECISION; }
79
80 {LETTER}({DIGIT}|{LETTER})* { return SkSL::Token::IDENTIFIER; }
81
82 "#"{LETTER}({DIGIT}|{LETTER})* { return SkSL::Token::DIRECTIVE; }
83
84 "(" { return SkSL::Token::LPAREN; }
85
86 ")" { return SkSL::Token::RPAREN; }
87
88 "{" { return SkSL::Token::LBRACE; }
89
90 "}" { return SkSL::Token::RBRACE; }
91
92 "[" { return SkSL::Token::LBRACKET; }
93
94 "]" { return SkSL::Token::RBRACKET; }
95
96 "." { return SkSL::Token::DOT; }
97
98 "," { return SkSL::Token::COMMA; }
99
100 "++" { return SkSL::Token::PLUSPLUS; }
101
102 "--" { return SkSL::Token::MINUSMINUS; }
103
104 "+" { return SkSL::Token::PLUS; }
105
106 "-" { return SkSL::Token::MINUS; }
107
108 "*" { return SkSL::Token::STAR; }
109
110 "/" { return SkSL::Token::SLASH; }
111
112 "%" { return SkSL::Token::PERCENT; }
113
114 "<<" { return SkSL::Token::SHL; }
115
116 ">>" { return SkSL::Token::SHR; }
117
118 "|" { return SkSL::Token::BITWISEOR; }
119
120 "^" { return SkSL::Token::BITWISEXOR; }
121
122 "&" { return SkSL::Token::BITWISEAND; }
123
124 "||" { return SkSL::Token::LOGICALOR; }
125
126 "^^" { return SkSL::Token::LOGICALXOR; }
127
128 "&&" { return SkSL::Token::LOGICALAND; }
129
130 "!" { return SkSL::Token::NOT; }
131
132 "?" { return SkSL::Token::QUESTION; }
133
134 ":" { return SkSL::Token::COLON; }
135
136 "=" { return SkSL::Token::EQ; }
137
138 "==" { return SkSL::Token::EQEQ; }
139
140 "!=" { return SkSL::Token::NEQ; }
141
142 ">" { return SkSL::Token::GT; }
143
144 "<" { return SkSL::Token::LT; }
145
146 ">=" { return SkSL::Token::GTEQ; }
147
148 "<=" { return SkSL::Token::LTEQ; }
149
150 "+=" { return SkSL::Token::PLUSEQ; }
151
152 "-=" { return SkSL::Token::MINUSEQ; }
153
154 "*=" { return SkSL::Token::STAREQ; }
155
156 "/=" { return SkSL::Token::SLASHEQ; }
157
158 "%=" { return SkSL::Token::PERCENTEQ; }
159
160 "<<=" { return SkSL::Token::SHLEQ; }
161
162 ">>=" { return SkSL::Token::SHREQ; }
163
164 "|=" { return SkSL::Token::BITWISEOREQ; }
165
166 "^=" { return SkSL::Token::BITWISEXOREQ; }
167
168 "&=" { return SkSL::Token::BITWISEANDEQ; }
169
170 "||=" { return SkSL::Token::LOGICALOREQ; }
171
172 "^^=" { return SkSL::Token::LOGICALXOREQ; }
173
174 "&&=" { return SkSL::Token::LOGICALANDEQ; }
175
176 ";" { return SkSL::Token::SEMICOLON; }
177
178 "//".* /* line comment */
179
180 "/*"([^*]|"*"[^/])*"*/" /* block comment */
181
182 [ \t\r\n]+ /* whitespace */
183
184 . { return SkSL::Token::INVALID_TOKEN; }
185
186 %%
187
188 int skslwrap() {
189 return 1; // terminate
190 }
OLDNEW
« src/gpu/vk/GrVkGpu.h ('K') | « src/sksl/lex.sksl.c ('k') | src/sksl/sksl.include » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698