Add support for unsigned integer literals in the shading language.
TRAC #23080
Signed-off-by: Nicolas Capens
Signed-off-by: Shannon Woods
Author: Jamie Madill
git-svn-id: https://angleproject.googlecode.com/svn/branches/es3proto@2405 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/compiler/preprocessor/Tokenizer.cpp b/src/compiler/preprocessor/Tokenizer.cpp
index feea74e..2b72033 100644
--- a/src/compiler/preprocessor/Tokenizer.cpp
+++ b/src/compiler/preprocessor/Tokenizer.cpp
@@ -367,17 +367,17 @@
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
-static yyconst flex_int16_t yy_accept[87] =
+static yyconst flex_int16_t yy_accept[90] =
{ 0,
0, 0, 0, 0, 39, 37, 34, 35, 35, 33,
7, 33, 33, 33, 33, 33, 33, 33, 33, 9,
9, 33, 33, 33, 8, 37, 33, 33, 3, 5,
5, 4, 34, 35, 19, 27, 20, 30, 25, 12,
23, 13, 24, 10, 2, 1, 26, 10, 9, 11,
- 11, 11, 11, 9, 14, 16, 18, 17, 15, 8,
- 36, 36, 31, 21, 32, 22, 3, 5, 6, 11,
- 10, 11, 1, 10, 11, 0, 10, 9, 28, 29,
- 0, 10, 10, 10, 10, 0
+ 11, 11, 9, 11, 9, 9, 14, 16, 18, 17,
+ 15, 8, 36, 36, 31, 21, 32, 22, 3, 5,
+ 6, 11, 10, 11, 1, 10, 11, 0, 10, 9,
+ 28, 29, 0, 10, 10, 10, 9, 10, 0
} ;
static yyconst flex_int32_t yy_ec[256] =
@@ -390,12 +390,12 @@
16, 16, 16, 16, 16, 17, 17, 9, 9, 18,
19, 20, 9, 1, 21, 21, 21, 21, 22, 21,
23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
- 23, 23, 23, 23, 23, 23, 23, 24, 23, 23,
- 9, 25, 9, 26, 23, 1, 21, 21, 21, 21,
+ 23, 23, 23, 23, 24, 23, 23, 25, 23, 23,
+ 9, 26, 9, 27, 23, 1, 21, 21, 21, 21,
22, 21, 23, 23, 23, 23, 23, 23, 23, 23,
- 23, 23, 23, 23, 23, 23, 23, 23, 23, 24,
- 23, 23, 9, 27, 9, 9, 1, 1, 1, 1,
+ 23, 23, 23, 23, 23, 23, 24, 23, 23, 25,
+ 23, 23, 9, 28, 9, 9, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -412,89 +412,95 @@
1, 1, 1, 1, 1
} ;
-static yyconst flex_int32_t yy_meta[28] =
+static yyconst flex_int32_t yy_meta[29] =
{ 0,
1, 1, 2, 2, 1, 1, 1, 1, 1, 3,
- 1, 1, 4, 1, 5, 5, 5, 1, 1, 1,
- 5, 5, 5, 5, 1, 1, 1
+ 1, 1, 1, 1, 4, 4, 4, 1, 1, 1,
+ 4, 4, 4, 4, 4, 1, 1, 1
} ;
-static yyconst flex_int16_t yy_base[92] =
+static yyconst flex_int16_t yy_base[94] =
{ 0,
- 0, 0, 25, 27, 162, 163, 159, 163, 152, 132,
- 163, 131, 24, 163, 116, 22, 26, 31, 30, 37,
- 40, 44, 115, 46, 0, 64, 50, 15, 0, 163,
- 124, 91, 88, 163, 163, 163, 163, 163, 163, 163,
- 163, 163, 163, 64, 163, 0, 163, 76, 54, 58,
- 79, 91, 91, 0, 56, 163, 163, 163, 32, 0,
- 163, 36, 163, 163, 163, 163, 0, 163, 163, 94,
- 0, 106, 0, 0, 113, 55, 72, 113, 163, 163,
- 116, 101, 108, 123, 126, 163, 143, 31, 148, 153,
- 155
+ 0, 0, 26, 28, 167, 173, 164, 173, 129, 107,
+ 173, 102, 25, 173, 97, 23, 27, 32, 31, 38,
+ 51, 38, 88, 50, 0, 74, 16, 52, 0, 173,
+ 98, 81, 80, 173, 173, 173, 173, 173, 173, 173,
+ 173, 173, 173, 68, 173, 0, 173, 81, 54, 84,
+ 95, 107, 0, 112, 0, 0, 46, 173, 173, 173,
+ 39, 0, 173, 49, 173, 173, 173, 173, 0, 173,
+ 173, 98, 0, 127, 0, 0, 134, 71, 119, 16,
+ 173, 173, 137, 129, 136, 140, 0, 143, 173, 160,
+ 33, 164, 168
} ;
-static yyconst flex_int16_t yy_def[92] =
+static yyconst flex_int16_t yy_def[94] =
{ 0,
- 86, 1, 87, 87, 86, 86, 86, 86, 86, 86,
- 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
- 20, 86, 86, 86, 88, 86, 86, 86, 89, 86,
- 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
- 86, 86, 86, 86, 86, 90, 86, 86, 20, 20,
- 48, 51, 91, 21, 86, 86, 86, 86, 86, 88,
- 86, 86, 86, 86, 86, 86, 89, 86, 86, 44,
- 44, 70, 90, 48, 51, 86, 52, 91, 86, 86,
- 86, 72, 75, 86, 86, 0, 86, 86, 86, 86,
- 86
+ 89, 1, 90, 90, 89, 89, 89, 89, 89, 89,
+ 89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
+ 89, 89, 89, 89, 91, 89, 89, 89, 92, 89,
+ 89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
+ 89, 89, 89, 89, 89, 93, 89, 89, 20, 20,
+ 48, 51, 51, 89, 21, 51, 89, 89, 89, 89,
+ 89, 91, 89, 89, 89, 89, 89, 89, 92, 89,
+ 89, 44, 44, 72, 93, 48, 51, 89, 52, 54,
+ 89, 89, 89, 74, 77, 89, 51, 89, 0, 89,
+ 89, 89, 89
} ;
-static yyconst flex_int16_t yy_nxt[191] =
+static yyconst flex_int16_t yy_nxt[202] =
{ 0,
6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 21, 22, 23, 24,
- 25, 25, 25, 25, 26, 27, 28, 30, 31, 30,
- 31, 37, 40, 65, 32, 60, 32, 42, 61, 45,
- 41, 66, 38, 46, 43, 44, 44, 44, 47, 48,
- 80, 49, 49, 50, 54, 54, 54, 51, 52, 51,
- 53, 55, 56, 51, 58, 59, 61, 62, 63, 84,
- 84, 84, 50, 50, 79, 64, 70, 51, 71, 71,
- 71, 51, 86, 86, 70, 72, 70, 70, 51, 33,
- 74, 74, 74, 51, 51, 51, 51, 75, 51, 51,
+ 25, 25, 25, 25, 25, 26, 27, 28, 30, 31,
+ 30, 31, 37, 40, 65, 32, 62, 32, 42, 87,
+ 45, 41, 66, 38, 46, 43, 44, 44, 44, 47,
+ 48, 63, 49, 49, 50, 57, 58, 82, 51, 52,
+ 51, 53, 54, 48, 81, 55, 55, 55, 60, 61,
+ 67, 51, 52, 51, 56, 51, 63, 64, 51, 68,
+ 72, 33, 73, 73, 73, 86, 86, 86, 72, 74,
+ 72, 72, 72, 51, 71, 76, 76, 76, 50, 50,
- 51, 76, 76, 51, 69, 77, 77, 77, 70, 70,
- 70, 86, 86, 51, 51, 70, 81, 81, 86, 86,
- 82, 82, 82, 81, 81, 51, 68, 83, 83, 83,
- 85, 85, 85, 57, 39, 51, 51, 84, 84, 84,
- 85, 85, 85, 29, 29, 29, 29, 29, 67, 36,
- 35, 67, 67, 73, 34, 73, 73, 73, 78, 78,
- 33, 86, 5, 86, 86, 86, 86, 86, 86, 86,
- 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
- 86, 86, 86, 86, 86, 86, 86, 86, 86, 86
+ 70, 51, 77, 51, 51, 51, 59, 51, 51, 51,
+ 51, 51, 72, 72, 72, 39, 51, 78, 78, 72,
+ 36, 79, 79, 79, 51, 35, 80, 80, 80, 89,
+ 89, 34, 80, 80, 51, 51, 51, 83, 83, 89,
+ 89, 84, 84, 84, 83, 83, 89, 89, 85, 85,
+ 85, 88, 88, 88, 86, 86, 86, 88, 88, 88,
+ 29, 29, 29, 29, 69, 33, 89, 69, 75, 89,
+ 75, 75, 5, 89, 89, 89, 89, 89, 89, 89,
+ 89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
+ 89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
+
+ 89
} ;
-static yyconst flex_int16_t yy_chk[191] =
+static yyconst flex_int16_t yy_chk[202] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 3, 3, 4,
- 4, 13, 16, 28, 3, 88, 4, 17, 62, 19,
- 16, 28, 13, 19, 17, 18, 18, 18, 19, 20,
- 59, 20, 20, 20, 21, 21, 21, 20, 20, 20,
- 20, 22, 22, 21, 24, 24, 26, 26, 27, 76,
- 76, 76, 50, 50, 55, 27, 44, 49, 44, 44,
- 44, 50, 77, 77, 44, 44, 44, 44, 48, 33,
- 48, 48, 48, 51, 51, 51, 48, 48, 48, 48,
+ 1, 1, 1, 1, 1, 1, 1, 1, 3, 3,
+ 4, 4, 13, 16, 27, 3, 91, 4, 17, 80,
+ 19, 16, 27, 13, 19, 17, 18, 18, 18, 19,
+ 20, 64, 20, 20, 20, 22, 22, 61, 20, 20,
+ 20, 20, 20, 21, 57, 21, 21, 21, 24, 24,
+ 28, 21, 21, 21, 21, 21, 26, 26, 49, 28,
+ 44, 33, 44, 44, 44, 78, 78, 78, 44, 44,
+ 44, 44, 44, 48, 32, 48, 48, 48, 50, 50,
- 51, 52, 52, 53, 32, 52, 52, 52, 70, 70,
- 70, 82, 82, 53, 53, 70, 72, 72, 83, 83,
- 72, 72, 72, 75, 75, 78, 31, 75, 75, 75,
- 81, 81, 81, 23, 15, 78, 78, 84, 84, 84,
- 85, 85, 85, 87, 87, 87, 87, 87, 89, 12,
- 10, 89, 89, 90, 9, 90, 90, 90, 91, 91,
- 7, 5, 86, 86, 86, 86, 86, 86, 86, 86,
- 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
- 86, 86, 86, 86, 86, 86, 86, 86, 86, 86
+ 31, 48, 48, 48, 48, 48, 23, 50, 50, 51,
+ 51, 51, 72, 72, 72, 15, 51, 52, 52, 72,
+ 12, 52, 52, 52, 54, 10, 54, 54, 54, 79,
+ 79, 9, 54, 54, 54, 54, 54, 74, 74, 84,
+ 84, 74, 74, 74, 77, 77, 85, 85, 77, 77,
+ 77, 83, 83, 83, 86, 86, 86, 88, 88, 88,
+ 90, 90, 90, 90, 92, 7, 5, 92, 93, 0,
+ 93, 93, 89, 89, 89, 89, 89, 89, 89, 89,
+ 89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
+ 89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
+
+ 89
} ;
/* The intent behind this definition is that it'll catch
@@ -847,13 +853,13 @@
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 87 )
+ if ( yy_current_state >= 90 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
++yy_cp;
}
- while ( yy_current_state != 86 );
+ while ( yy_current_state != 89 );
yy_cp = yyg->yy_last_accepting_cpos;
yy_current_state = yyg->yy_last_accepting_state;
@@ -1446,7 +1452,7 @@
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 87 )
+ if ( yy_current_state >= 90 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
@@ -1475,11 +1481,11 @@
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 87 )
+ if ( yy_current_state >= 90 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- yy_is_jam = (yy_current_state == 86);
+ yy_is_jam = (yy_current_state == 89);
return yy_is_jam ? 0 : yy_current_state;
}
diff --git a/src/compiler/preprocessor/Tokenizer.l b/src/compiler/preprocessor/Tokenizer.l
index ea87523..89da400 100644
--- a/src/compiler/preprocessor/Tokenizer.l
+++ b/src/compiler/preprocessor/Tokenizer.l
@@ -79,9 +79,9 @@
IDENTIFIER [_a-zA-Z][_a-zA-Z0-9]*
PUNCTUATOR [][<>(){}.+-/*%^|&~=!:;,?]
-DECIMAL_CONSTANT [1-9][0-9]*
-OCTAL_CONSTANT 0[0-7]*
-HEXADECIMAL_CONSTANT 0[xX][0-9a-fA-F]+
+DECIMAL_CONSTANT [1-9][0-9]*[uU]?
+OCTAL_CONSTANT 0[0-7]*[uU]?
+HEXADECIMAL_CONSTANT 0[xX][0-9a-fA-F]+[uU]?
DIGIT [0-9]
EXPONENT_PART [eE][+-]?{DIGIT}+
diff --git a/src/compiler/preprocessor/preprocessor.vcxproj b/src/compiler/preprocessor/preprocessor.vcxproj
index ca8530b..b23cf64 100644
--- a/src/compiler/preprocessor/preprocessor.vcxproj
+++ b/src/compiler/preprocessor/preprocessor.vcxproj
@@ -164,6 +164,7 @@
<ClInclude Include="Tokenizer.h" />
</ItemGroup>
<ItemGroup>
+ <None Include="ExpressionParser.y" />
<None Include="Tokenizer.l" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
diff --git a/src/compiler/preprocessor/preprocessor.vcxproj.filters b/src/compiler/preprocessor/preprocessor.vcxproj.filters
index 4ac202f..030f5af 100644
--- a/src/compiler/preprocessor/preprocessor.vcxproj.filters
+++ b/src/compiler/preprocessor/preprocessor.vcxproj.filters
@@ -96,5 +96,8 @@
<None Include="Tokenizer.l">
<Filter>Source Files</Filter>
</None>
+ <None Include="ExpressionParser.y">
+ <Filter>Source Files</Filter>
+ </None>
</ItemGroup>
</Project>
\ No newline at end of file