Added support for line continuations.

TRAC #22713 Signed-off-by: Geoff Lang Signed-off-by: Shannon Woods Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/branches/es3proto@2086 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent a28864c8
...@@ -473,9 +473,9 @@ static const yytype_int8 yyrhs[] = ...@@ -473,9 +473,9 @@ static const yytype_int8 yyrhs[] =
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint8 yyrline[] = static const yytype_uint8 yyrline[] =
{ {
0, 90, 90, 97, 98, 101, 104, 107, 110, 113, 0, 91, 91, 98, 99, 102, 105, 108, 111, 114,
116, 119, 122, 125, 128, 131, 134, 137, 140, 143, 117, 120, 123, 126, 129, 132, 135, 138, 141, 144,
156, 169, 172, 175, 178, 181, 184 157, 170, 173, 176, 179, 182, 185
}; };
#endif #endif
......
#line 16 "./Tokenizer.l" #line 16 "./Tokenizer.l"
// //
// Copyright (c) 2011 The ANGLE Project Authors. All rights reserved. // Copyright (c) 2011-2013 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// //
...@@ -359,8 +359,8 @@ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); ...@@ -359,8 +359,8 @@ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
*yy_cp = '\0'; \ *yy_cp = '\0'; \
yyg->yy_c_buf_p = yy_cp; yyg->yy_c_buf_p = yy_cp;
#define YY_NUM_RULES 37 #define YY_NUM_RULES 38
#define YY_END_OF_BUFFER 38 #define YY_END_OF_BUFFER 39
/* This struct is not used in this scanner, /* This struct is not used in this scanner,
but its presence is necessary. */ but its presence is necessary. */
struct yy_trans_info struct yy_trans_info
...@@ -368,17 +368,17 @@ struct yy_trans_info ...@@ -368,17 +368,17 @@ struct yy_trans_info
flex_int32_t yy_verify; flex_int32_t yy_verify;
flex_int32_t yy_nxt; flex_int32_t yy_nxt;
}; };
static yyconst flex_int16_t yy_accept[84] = static yyconst flex_int16_t yy_accept[87] =
{ 0, { 0,
0, 0, 0, 0, 38, 36, 34, 35, 35, 33, 0, 0, 0, 0, 39, 37, 34, 35, 35, 33,
7, 33, 33, 33, 33, 33, 33, 33, 33, 9, 7, 33, 33, 33, 33, 33, 33, 33, 33, 9,
9, 33, 33, 33, 8, 33, 33, 3, 5, 5, 9, 33, 33, 33, 8, 37, 33, 33, 3, 5,
4, 34, 35, 19, 27, 20, 30, 25, 12, 23, 5, 4, 34, 35, 19, 27, 20, 30, 25, 12,
13, 24, 10, 2, 1, 26, 10, 9, 11, 11, 23, 13, 24, 10, 2, 1, 26, 10, 9, 11,
11, 11, 9, 14, 16, 18, 17, 15, 8, 31, 11, 11, 11, 9, 14, 16, 18, 17, 15, 8,
21, 32, 22, 3, 5, 6, 11, 10, 11, 1, 36, 36, 31, 21, 32, 22, 3, 5, 6, 11,
10, 11, 0, 10, 9, 28, 29, 0, 10, 10, 10, 11, 1, 10, 11, 0, 10, 9, 28, 29,
10, 10, 0 0, 10, 10, 10, 10, 0
} ; } ;
static yyconst flex_int32_t yy_ec[256] = static yyconst flex_int32_t yy_ec[256] =
...@@ -392,11 +392,11 @@ static yyconst flex_int32_t yy_ec[256] = ...@@ -392,11 +392,11 @@ static yyconst flex_int32_t yy_ec[256] =
19, 20, 9, 1, 21, 21, 21, 21, 22, 21, 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, 23, 23, 23,
23, 23, 23, 23, 23, 23, 23, 24, 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 23, 23,
9, 1, 9, 25, 23, 1, 21, 21, 21, 21, 9, 25, 9, 26, 23, 1, 21, 21, 21, 21,
22, 21, 23, 23, 23, 23, 23, 23, 23, 23, 22, 21, 23, 23, 23, 23, 23, 23, 23, 23,
23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 23, 23, 23, 23, 23, 23, 23, 23, 23, 24,
23, 23, 9, 26, 9, 9, 1, 1, 1, 1, 23, 23, 9, 27, 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, 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,
...@@ -413,85 +413,89 @@ static yyconst flex_int32_t yy_ec[256] = ...@@ -413,85 +413,89 @@ static yyconst flex_int32_t yy_ec[256] =
1, 1, 1, 1, 1 1, 1, 1, 1, 1
} ; } ;
static yyconst flex_int32_t yy_meta[27] = static yyconst flex_int32_t yy_meta[28] =
{ 0, { 0,
1, 1, 2, 2, 1, 1, 1, 1, 1, 3, 1, 1, 2, 2, 1, 1, 1, 1, 1, 3,
1, 1, 4, 1, 5, 5, 5, 1, 1, 1, 1, 1, 4, 1, 5, 5, 5, 1, 1, 1,
5, 5, 5, 5, 1, 1 5, 5, 5, 5, 1, 1, 1
} ; } ;
static yyconst flex_int16_t yy_base[89] = static yyconst flex_int16_t yy_base[92] =
{ 0, { 0,
0, 0, 24, 26, 158, 159, 150, 159, 145, 128, 0, 0, 25, 27, 162, 163, 159, 163, 152, 132,
159, 112, 23, 159, 111, 21, 25, 30, 29, 36, 163, 131, 24, 163, 116, 22, 26, 31, 30, 37,
46, 36, 100, 45, 0, 16, 47, 0, 159, 84, 40, 44, 115, 46, 0, 64, 50, 15, 0, 163,
65, 73, 159, 159, 159, 159, 159, 159, 159, 159, 124, 91, 88, 163, 163, 163, 163, 163, 163, 163,
159, 159, 61, 159, 0, 159, 73, 32, 56, 83, 163, 163, 163, 64, 163, 0, 163, 76, 54, 58,
95, 68, 0, 31, 159, 159, 159, 19, 0, 159, 79, 91, 91, 0, 56, 163, 163, 163, 32, 0,
159, 159, 159, 0, 159, 159, 98, 0, 110, 0, 163, 36, 163, 163, 163, 163, 0, 163, 163, 94,
0, 117, 52, 90, 80, 159, 159, 101, 97, 112, 0, 106, 0, 0, 113, 55, 72, 113, 163, 163,
120, 123, 159, 140, 28, 145, 150, 152 116, 101, 108, 123, 126, 163, 143, 31, 148, 153,
155
} ; } ;
static yyconst flex_int16_t yy_def[89] = static yyconst flex_int16_t yy_def[92] =
{ 0, { 0,
83, 1, 84, 84, 83, 83, 83, 83, 83, 83, 86, 1, 87, 87, 86, 86, 86, 86, 86, 86,
83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
20, 83, 83, 83, 85, 83, 83, 86, 83, 83, 20, 86, 86, 86, 88, 86, 86, 86, 89, 86,
83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
83, 83, 83, 83, 87, 83, 83, 20, 20, 47, 86, 86, 86, 86, 86, 90, 86, 86, 20, 20,
50, 88, 21, 83, 83, 83, 83, 83, 85, 83, 48, 51, 91, 21, 86, 86, 86, 86, 86, 88,
83, 83, 83, 86, 83, 83, 43, 43, 67, 87, 86, 86, 86, 86, 86, 86, 89, 86, 86, 44,
47, 50, 83, 51, 88, 83, 83, 83, 69, 72, 44, 70, 90, 48, 51, 86, 52, 91, 86, 86,
83, 83, 0, 83, 83, 83, 83, 83 86, 72, 75, 86, 86, 0, 86, 86, 86, 86,
86
} ; } ;
static yyconst flex_int16_t yy_nxt[186] = static yyconst flex_int16_t yy_nxt[191] =
{ 0, { 0,
6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 21, 22, 23, 24, 16, 17, 18, 19, 20, 21, 21, 22, 23, 24,
25, 25, 25, 25, 26, 27, 29, 30, 29, 30, 25, 25, 25, 25, 26, 27, 28, 30, 31, 30,
36, 39, 59, 31, 60, 31, 41, 77, 44, 40, 31, 37, 40, 65, 32, 60, 32, 42, 61, 45,
61, 37, 45, 42, 43, 43, 43, 46, 47, 76, 41, 66, 38, 46, 43, 44, 44, 44, 47, 48,
48, 48, 49, 54, 55, 50, 50, 51, 50, 52, 80, 49, 49, 50, 54, 54, 54, 51, 52, 51,
53, 53, 53, 57, 58, 62, 81, 81, 81, 50, 53, 55, 56, 51, 58, 59, 61, 62, 63, 84,
49, 49, 63, 67, 32, 68, 68, 68, 66, 50, 84, 84, 50, 50, 79, 64, 70, 51, 71, 71,
50, 67, 69, 67, 67, 50, 65, 71, 71, 71, 71, 51, 86, 86, 70, 72, 70, 70, 51, 33,
50, 50, 50, 50, 72, 50, 50, 50, 50, 50, 74, 74, 74, 51, 51, 51, 51, 75, 51, 51,
83, 83, 50, 50, 50, 73, 73, 83, 83, 74, 51, 76, 76, 51, 69, 77, 77, 77, 70, 70,
74, 74, 67, 67, 67, 82, 82, 82, 56, 67, 70, 86, 86, 51, 51, 70, 81, 81, 86, 86,
78, 78, 83, 83, 79, 79, 79, 78, 78, 38, 82, 82, 82, 81, 81, 51, 68, 83, 83, 83,
35, 80, 80, 80, 81, 81, 81, 82, 82, 82, 85, 85, 85, 57, 39, 51, 51, 84, 84, 84,
28, 28, 28, 28, 28, 64, 34, 33, 64, 64, 85, 85, 85, 29, 29, 29, 29, 29, 67, 36,
70, 32, 70, 70, 70, 75, 75, 83, 5, 83, 35, 67, 67, 73, 34, 73, 73, 73, 78, 78,
83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 33, 86, 5, 86, 86, 86, 86, 86, 86, 86,
83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
83, 83, 83, 83, 83 86, 86, 86, 86, 86, 86, 86, 86, 86, 86
} ; } ;
static yyconst flex_int16_t yy_chk[186] = static yyconst flex_int16_t yy_chk[191] =
{ 0, { 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 3, 3, 4, 4, 1, 1, 1, 1, 1, 1, 1, 3, 3, 4,
13, 16, 85, 3, 26, 4, 17, 58, 19, 16, 4, 13, 16, 28, 3, 88, 4, 17, 62, 19,
26, 13, 19, 17, 18, 18, 18, 19, 20, 54, 16, 28, 13, 19, 17, 18, 18, 18, 19, 20,
20, 20, 20, 22, 22, 48, 20, 20, 20, 20, 59, 20, 20, 20, 21, 21, 21, 20, 20, 20,
21, 21, 21, 24, 24, 27, 73, 73, 73, 21, 20, 22, 22, 21, 24, 24, 26, 26, 27, 76,
49, 49, 27, 43, 32, 43, 43, 43, 31, 49, 76, 76, 50, 50, 55, 27, 44, 49, 44, 44,
52, 43, 43, 43, 43, 47, 30, 47, 47, 47, 44, 50, 77, 77, 44, 44, 44, 44, 48, 33,
52, 52, 75, 47, 47, 47, 47, 50, 50, 50, 48, 48, 48, 51, 51, 51, 48, 48, 48, 48,
74, 74, 75, 75, 50, 51, 51, 79, 79, 51, 51, 52, 52, 53, 32, 52, 52, 52, 70, 70,
51, 51, 67, 67, 67, 78, 78, 78, 23, 67, 70, 82, 82, 53, 53, 70, 72, 72, 83, 83,
69, 69, 80, 80, 69, 69, 69, 72, 72, 15, 72, 72, 72, 75, 75, 78, 31, 75, 75, 75,
12, 72, 72, 72, 81, 81, 81, 82, 82, 82, 81, 81, 81, 23, 15, 78, 78, 84, 84, 84,
84, 84, 84, 84, 84, 86, 10, 9, 86, 86, 85, 85, 85, 87, 87, 87, 87, 87, 89, 12,
87, 7, 87, 87, 87, 88, 88, 5, 83, 83, 10, 89, 89, 90, 9, 90, 90, 90, 91, 91,
83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 7, 5, 86, 86, 86, 86, 86, 86, 86, 86,
83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
83, 83, 83, 83, 83 86, 86, 86, 86, 86, 86, 86, 86, 86, 86
} ; } ;
/* The intent behind this definition is that it'll catch /* The intent behind this definition is that it'll catch
...@@ -503,7 +507,7 @@ static yyconst flex_int16_t yy_chk[186] = ...@@ -503,7 +507,7 @@ static yyconst flex_int16_t yy_chk[186] =
#define YY_RESTORE_YY_MORE_OFFSET #define YY_RESTORE_YY_MORE_OFFSET
/* /*
// //
// Copyright (c) 2002-2011 The ANGLE Project Authors. All rights reserved. // Copyright (c) 2002-2013 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// //
...@@ -843,13 +847,13 @@ yy_match: ...@@ -843,13 +847,13 @@ yy_match:
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{ {
yy_current_state = (int) yy_def[yy_current_state]; yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 84 ) if ( yy_current_state >= 87 )
yy_c = yy_meta[(unsigned int) yy_c]; yy_c = yy_meta[(unsigned int) yy_c];
} }
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
++yy_cp; ++yy_cp;
} }
while ( yy_current_state != 83 ); while ( yy_current_state != 86 );
yy_cp = yyg->yy_last_accepting_cpos; yy_cp = yyg->yy_last_accepting_cpos;
yy_current_state = yyg->yy_last_accepting_state; yy_current_state = yyg->yy_last_accepting_state;
...@@ -1106,6 +1110,11 @@ YY_RULE_SETUP ...@@ -1106,6 +1110,11 @@ YY_RULE_SETUP
} }
YY_BREAK YY_BREAK
case 36: case 36:
/* rule 36 can match eol */
YY_RULE_SETUP
{ ++yylineno; }
YY_BREAK
case 37:
YY_RULE_SETUP YY_RULE_SETUP
{ {
yylval->assign(1, yytext[0]); yylval->assign(1, yytext[0]);
...@@ -1141,7 +1150,7 @@ case YY_STATE_EOF(COMMENT): ...@@ -1141,7 +1150,7 @@ case YY_STATE_EOF(COMMENT):
yyterminate(); yyterminate();
} }
YY_BREAK YY_BREAK
case 37: case 38:
YY_RULE_SETUP YY_RULE_SETUP
ECHO; ECHO;
YY_BREAK YY_BREAK
...@@ -1437,7 +1446,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) ...@@ -1437,7 +1446,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{ {
yy_current_state = (int) yy_def[yy_current_state]; yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 84 ) if ( yy_current_state >= 87 )
yy_c = yy_meta[(unsigned int) yy_c]; yy_c = yy_meta[(unsigned int) yy_c];
} }
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
...@@ -1466,11 +1475,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner) ...@@ -1466,11 +1475,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{ {
yy_current_state = (int) yy_def[yy_current_state]; yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 84 ) if ( yy_current_state >= 87 )
yy_c = yy_meta[(unsigned int) yy_c]; yy_c = yy_meta[(unsigned int) yy_c];
} }
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
yy_is_jam = (yy_current_state == 83); yy_is_jam = (yy_current_state == 86);
return yy_is_jam ? 0 : yy_current_state; return yy_is_jam ? 0 : yy_current_state;
} }
......
/* /*
// //
// Copyright (c) 2002-2011 The ANGLE Project Authors. All rights reserved. // Copyright (c) 2002-2013 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// //
...@@ -14,7 +14,7 @@ IF YOU MODIFY THIS FILE YOU ALSO NEED TO RUN generate_parser.sh. ...@@ -14,7 +14,7 @@ IF YOU MODIFY THIS FILE YOU ALSO NEED TO RUN generate_parser.sh.
%top{ %top{
// //
// Copyright (c) 2011 The ANGLE Project Authors. All rights reserved. // Copyright (c) 2011-2013 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// //
...@@ -229,6 +229,8 @@ FRACTIONAL_CONSTANT ({DIGIT}*"."{DIGIT}+)|({DIGIT}+".") ...@@ -229,6 +229,8 @@ FRACTIONAL_CONSTANT ({DIGIT}*"."{DIGIT}+)|({DIGIT}+".")
return '\n'; return '\n';
} }
\\{NEWLINE} { ++yylineno; }
. { . {
yylval->assign(1, yytext[0]); yylval->assign(1, yytext[0]);
return pp::Token::PP_OTHER; return pp::Token::PP_OTHER;
......
...@@ -163,6 +163,9 @@ ...@@ -163,6 +163,9 @@
<ClInclude Include="Token.h" /> <ClInclude Include="Token.h" />
<ClInclude Include="Tokenizer.h" /> <ClInclude Include="Tokenizer.h" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Include="Tokenizer.l" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"> <ImportGroup Label="ExtensionTargets">
</ImportGroup> </ImportGroup>
......
...@@ -11,12 +11,6 @@ ...@@ -11,12 +11,6 @@
</Filter> </Filter>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="Diagnostics.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="DirectiveHandler.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="DirectiveParser.cpp"> <ClCompile Include="DirectiveParser.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
...@@ -44,14 +38,14 @@ ...@@ -44,14 +38,14 @@
<ClCompile Include="Tokenizer.cpp"> <ClCompile Include="Tokenizer.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="DiagnosticsBase.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="DirectiveHandlerBase.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="Diagnostics.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="DirectiveHandler.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="DirectiveParser.h"> <ClInclude Include="DirectiveParser.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
...@@ -91,5 +85,16 @@ ...@@ -91,5 +85,16 @@
<ClInclude Include="length_limits.h"> <ClInclude Include="length_limits.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="DiagnosticsBase.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="DirectiveHandlerBase.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="Tokenizer.l">
<Filter>Source Files</Filter>
</None>
</ItemGroup> </ItemGroup>
</Project> </Project>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment