diff options
Diffstat (limited to 'engines/director/lingo/lingo-lex.cpp')
-rw-r--r-- | engines/director/lingo/lingo-lex.cpp | 292 |
1 files changed, 149 insertions, 143 deletions
diff --git a/engines/director/lingo/lingo-lex.cpp b/engines/director/lingo/lingo-lex.cpp index f630dfd769..0284905e1d 100644 --- a/engines/director/lingo/lingo-lex.cpp +++ b/engines/director/lingo/lingo-lex.cpp @@ -364,8 +364,8 @@ static void yy_fatal_error (yyconst char msg[] ); *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; -#define YY_NUM_RULES 50 -#define YY_END_OF_BUFFER 51 +#define YY_NUM_RULES 51 +#define YY_END_OF_BUFFER 52 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -373,26 +373,27 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[170] = +static yyconst flex_int16_t yy_accept[172] = { 0, - 0, 0, 51, 49, 3, 47, 47, 49, 49, 46, - 46, 46, 45, 46, 46, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 2, 2, 3, 47, 0, 0, 47, 0, - 0, 48, 42, 1, 44, 45, 41, 39, 40, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 16, - 7, 43, 43, 43, 43, 43, 43, 43, 43, 26, - 27, 43, 43, 43, 43, 43, 43, 36, 43, 43, - 2, 2, 0, 1, 44, 4, 43, 43, 43, 11, - 43, 43, 43, 43, 43, 43, 43, 20, 43, 43, - - 43, 25, 43, 29, 43, 31, 43, 43, 43, 43, - 0, 43, 6, 10, 13, 43, 43, 43, 17, 18, - 43, 43, 43, 43, 24, 43, 43, 43, 0, 35, - 43, 37, 9, 43, 43, 14, 43, 19, 43, 43, - 23, 43, 43, 43, 34, 38, 0, 43, 43, 15, - 43, 22, 43, 30, 32, 0, 0, 43, 12, 21, - 43, 0, 8, 5, 28, 0, 0, 33, 0 + 0, 0, 52, 50, 3, 48, 48, 50, 50, 47, + 47, 47, 46, 47, 47, 44, 44, 44, 44, 44, + 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, + 44, 44, 2, 2, 3, 48, 0, 0, 48, 0, + 0, 49, 43, 1, 45, 46, 42, 40, 41, 44, + 44, 44, 44, 44, 44, 44, 44, 44, 44, 16, + 7, 44, 44, 44, 44, 44, 44, 44, 44, 26, + 27, 44, 44, 44, 44, 44, 44, 36, 44, 44, + 2, 2, 0, 1, 45, 4, 44, 44, 44, 11, + 44, 44, 44, 44, 44, 44, 44, 20, 44, 44, + + 44, 25, 44, 29, 44, 31, 44, 44, 44, 44, + 44, 0, 44, 6, 10, 13, 44, 44, 44, 17, + 18, 44, 44, 44, 44, 24, 44, 44, 44, 0, + 35, 38, 44, 37, 9, 44, 44, 14, 44, 19, + 44, 44, 23, 44, 44, 44, 34, 39, 0, 44, + 44, 15, 44, 22, 44, 30, 32, 0, 0, 44, + 12, 21, 44, 0, 8, 5, 28, 0, 0, 33, + 0 } ; static yyconst flex_int32_t yy_ec[256] = @@ -437,53 +438,53 @@ static yyconst flex_int32_t yy_meta[61] = 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 } ; -static yyconst flex_int16_t yy_base[175] = +static yyconst flex_int16_t yy_base[177] = { 0, - 0, 59, 356, 417, 63, 67, 71, 75, 346, 417, - 343, 181, 52, 68, 132, 56, 0, 56, 57, 67, + 0, 59, 359, 419, 63, 67, 71, 75, 351, 419, + 224, 181, 52, 68, 132, 56, 0, 56, 57, 67, 72, 68, 68, 69, 112, 70, 79, 103, 81, 103, 106, 115, 139, 145, 162, 101, 166, 170, 174, 135, - 133, 417, 417, 0, 90, 163, 417, 417, 417, 0, + 133, 419, 419, 0, 90, 163, 419, 419, 419, 0, 112, 153, 146, 151, 166, 162, 169, 172, 163, 0, 0, 160, 167, 171, 173, 166, 165, 164, 169, 0, - 0, 183, 174, 178, 184, 204, 206, 0, 204, 199, - 230, 242, 205, 0, 80, 0, 205, 211, 209, 0, - 208, 209, 216, 232, 222, 224, 225, 221, 235, 235, - - 230, 0, 232, 0, 248, 0, 239, 266, 249, 248, - 256, 262, 0, 0, 0, 252, 264, 269, 0, 0, - 258, 272, 262, 269, 0, 272, 281, 266, 192, 0, - 281, 0, 300, 281, 276, 0, 285, 0, 291, 297, - 0, 289, 286, 291, 321, 0, 325, 304, 295, 0, - 302, 0, 302, 0, 0, 341, 305, 305, 0, 0, - 306, 322, 417, 0, 0, 342, 348, 359, 417, 392, - 394, 400, 405, 410 + 0, 183, 174, 178, 184, 204, 206, 0, 208, 201, + 232, 242, 207, 0, 80, 0, 208, 214, 209, 0, + 210, 216, 224, 237, 229, 229, 229, 225, 232, 239, + + 234, 0, 233, 0, 249, 0, 240, 267, 247, 250, + 254, 260, 269, 0, 0, 0, 259, 266, 273, 0, + 0, 263, 280, 271, 277, 0, 278, 287, 272, 192, + 0, 0, 286, 0, 311, 283, 281, 0, 290, 0, + 284, 300, 0, 293, 291, 293, 330, 0, 331, 301, + 300, 0, 307, 0, 307, 0, 0, 343, 321, 312, + 0, 0, 318, 330, 419, 0, 0, 350, 351, 356, + 419, 394, 396, 402, 407, 412 } ; -static yyconst flex_int16_t yy_def[175] = +static yyconst flex_int16_t yy_def[177] = { 0, - 169, 1, 169, 169, 169, 169, 169, 169, 170, 169, - 169, 169, 169, 169, 169, 171, 171, 171, 171, 171, - 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, - 171, 171, 169, 169, 169, 169, 169, 169, 169, 169, - 170, 169, 169, 172, 169, 169, 169, 169, 169, 171, - 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, - 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, - 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, - 169, 169, 169, 172, 169, 171, 171, 171, 171, 171, - 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, - - 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, - 169, 171, 171, 171, 171, 171, 171, 171, 171, 171, - 171, 171, 171, 171, 171, 171, 171, 171, 173, 171, - 171, 171, 169, 171, 171, 171, 171, 171, 171, 171, - 171, 171, 171, 171, 173, 171, 169, 171, 171, 171, - 171, 171, 171, 171, 171, 169, 169, 171, 171, 171, - 171, 169, 169, 171, 171, 169, 174, 174, 0, 169, - 169, 169, 169, 169 + 171, 1, 171, 171, 171, 171, 171, 171, 172, 171, + 171, 171, 171, 171, 171, 173, 173, 173, 173, 173, + 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, + 173, 173, 171, 171, 171, 171, 171, 171, 171, 171, + 172, 171, 171, 174, 171, 171, 171, 171, 171, 173, + 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, + 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, + 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, + 171, 171, 171, 174, 171, 173, 173, 173, 173, 173, + 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, + + 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, + 173, 171, 173, 173, 173, 173, 173, 173, 173, 173, + 173, 173, 173, 173, 173, 173, 173, 173, 173, 175, + 173, 173, 173, 173, 171, 173, 173, 173, 173, 173, + 173, 173, 173, 173, 173, 173, 175, 173, 171, 173, + 173, 173, 173, 173, 173, 173, 173, 171, 171, 173, + 173, 173, 173, 171, 171, 173, 173, 171, 176, 176, + 0, 171, 171, 171, 171, 171 } ; -static yyconst flex_int16_t yy_nxt[478] = +static yyconst flex_int16_t yy_nxt[480] = { 0, 4, 5, 6, 7, 8, 9, 10, 11, 12, 4, 13, 14, 10, 15, 16, 17, 18, 19, 20, 21, @@ -505,41 +506,41 @@ static yyconst flex_int16_t yy_nxt[478] = 79, 80, 67, 35, 36, 36, 37, 37, 36, 36, 37, 38, 45, 46, 38, 38, 39, 39, 38, 87, 88, 89, 83, 90, 91, 92, 93, 97, 40, 44, - 94, 95, 40, 129, 96, 98, 129, 99, 100, 101, + 94, 95, 40, 130, 96, 98, 130, 99, 100, 101, 102, 103, 87, 88, 89, 104, 105, 90, 91, 92, 93, 97, 40, 94, 95, 106, 40, 96, 107, 98, - 99, 100, 101, 102, 108, 103, 109, 114, 104, 105, - 110, 81, 36, 36, 82, 111, 112, 113, 106, 115, - 116, 117, 107, 82, 36, 36, 82, 118, 108, 119, - 109, 114, 120, 110, 121, 122, 123, 124, 111, 112, - 113, 125, 115, 116, 117, 126, 127, 129, 128, 132, - 129, 118, 119, 131, 133, 120, 134, 121, 122, 135, - 123, 124, 136, 137, 125, 138, 139, 141, 126, 140, - 127, 128, 130, 132, 142, 143, 131, 144, 133, 146, - - 134, 147, 135, 148, 147, 149, 136, 137, 138, 150, - 139, 141, 140, 151, 152, 130, 153, 154, 142, 143, - 144, 155, 156, 146, 163, 156, 147, 148, 149, 147, - 158, 159, 150, 160, 161, 164, 165, 151, 152, 153, - 154, 166, 156, 167, 155, 156, 167, 157, 163, 167, - 43, 42, 167, 158, 159, 169, 160, 161, 164, 165, - 169, 169, 169, 169, 169, 166, 169, 169, 162, 169, - 169, 157, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 162, 41, 41, 169, 41, 41, 41, 50, 50, - - 84, 84, 169, 169, 84, 84, 145, 169, 169, 169, - 145, 168, 169, 169, 169, 168, 3, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169 + 99, 100, 101, 102, 108, 103, 109, 115, 104, 105, + 110, 43, 111, 81, 36, 36, 82, 112, 106, 113, + 114, 116, 107, 82, 36, 36, 82, 117, 108, 118, + 109, 115, 119, 124, 110, 111, 120, 121, 122, 123, + 112, 125, 113, 114, 116, 126, 127, 128, 130, 129, + 117, 130, 118, 132, 133, 134, 119, 124, 135, 120, + 121, 122, 123, 136, 138, 125, 137, 139, 126, 127, + 140, 128, 129, 131, 141, 143, 132, 133, 142, 134, + + 144, 145, 135, 146, 148, 150, 153, 136, 138, 137, + 151, 139, 149, 140, 152, 149, 131, 154, 141, 143, + 155, 142, 156, 157, 144, 145, 146, 160, 148, 150, + 153, 158, 149, 151, 158, 149, 161, 152, 162, 163, + 165, 154, 166, 155, 158, 156, 157, 158, 167, 168, + 160, 169, 169, 159, 169, 169, 42, 171, 171, 161, + 171, 162, 163, 171, 165, 166, 171, 171, 171, 171, + 164, 167, 171, 168, 171, 171, 171, 159, 171, 171, + 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, + 171, 171, 171, 164, 41, 41, 171, 41, 41, 41, + + 50, 50, 84, 84, 171, 171, 84, 84, 147, 171, + 171, 171, 147, 170, 171, 171, 171, 170, 3, 171, + 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, + 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, + 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, + 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, + 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, + 171, 171, 171, 171, 171, 171, 171, 171, 171 } ; -static yyconst flex_int16_t yy_chk[478] = +static yyconst flex_int16_t yy_chk[480] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -561,38 +562,38 @@ static yyconst flex_int16_t yy_chk[478] = 32, 32, 25, 35, 35, 35, 35, 37, 37, 37, 37, 38, 46, 46, 38, 39, 39, 39, 39, 52, 53, 54, 40, 55, 56, 57, 58, 64, 38, 12, - 59, 62, 39, 129, 63, 65, 129, 66, 67, 68, + 59, 62, 39, 130, 63, 65, 130, 66, 67, 68, 69, 72, 52, 53, 54, 73, 74, 55, 56, 57, 58, 64, 38, 59, 62, 75, 39, 63, 76, 65, 66, 67, 68, 69, 77, 72, 79, 89, 73, 74, - 80, 81, 81, 81, 81, 83, 87, 88, 75, 91, - 92, 93, 76, 82, 82, 82, 82, 94, 77, 95, - 79, 89, 96, 80, 97, 98, 99, 100, 83, 87, - 88, 101, 91, 92, 93, 103, 105, 108, 107, 110, - 108, 94, 95, 109, 111, 96, 112, 97, 98, 116, - 99, 100, 117, 118, 101, 121, 122, 124, 103, 123, - 105, 107, 108, 110, 126, 127, 109, 128, 111, 131, - - 112, 133, 116, 134, 133, 135, 117, 118, 121, 137, - 122, 124, 123, 139, 140, 108, 142, 143, 126, 127, - 128, 144, 145, 131, 157, 145, 147, 134, 135, 147, - 148, 149, 137, 151, 153, 158, 161, 139, 140, 142, - 143, 162, 156, 166, 144, 156, 166, 147, 157, 167, - 11, 9, 167, 148, 149, 3, 151, 153, 158, 161, - 168, 0, 0, 168, 0, 162, 0, 0, 156, 0, - 0, 147, 0, 0, 0, 0, 0, 0, 0, 0, + 79, 11, 80, 81, 81, 81, 81, 83, 75, 87, + 88, 91, 76, 82, 82, 82, 82, 92, 77, 93, + 79, 89, 94, 99, 79, 80, 95, 96, 97, 98, + 83, 100, 87, 88, 91, 101, 103, 105, 108, 107, + 92, 108, 93, 109, 110, 111, 94, 99, 112, 95, + 96, 97, 98, 113, 118, 100, 117, 119, 101, 103, + 122, 105, 107, 108, 123, 125, 109, 110, 124, 111, + + 127, 128, 112, 129, 133, 136, 141, 113, 118, 117, + 137, 119, 135, 122, 139, 135, 108, 142, 123, 125, + 144, 124, 145, 146, 127, 128, 129, 150, 133, 136, + 141, 147, 149, 137, 147, 149, 151, 139, 153, 155, + 159, 142, 160, 144, 158, 145, 146, 158, 163, 164, + 150, 168, 169, 149, 168, 169, 9, 170, 3, 151, + 170, 153, 155, 0, 159, 160, 0, 0, 0, 0, + 158, 163, 0, 164, 0, 0, 0, 149, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 156, 170, 170, 0, 170, 170, 170, 171, 171, - - 172, 172, 0, 0, 172, 172, 173, 0, 0, 0, - 173, 174, 0, 0, 0, 174, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169 + 0, 0, 0, 158, 172, 172, 0, 172, 172, 172, + + 173, 173, 174, 174, 0, 0, 174, 174, 175, 0, + 0, 0, 175, 176, 0, 0, 0, 176, 171, 171, + 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, + 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, + 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, + 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, + 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, + 171, 171, 171, 171, 171, 171, 171, 171, 171 } ; static yy_state_type yy_last_accepting_state; @@ -657,7 +658,7 @@ static void countnl() { g_lingo->_colnumber = strlen(p); } -#line 661 "engines/director/lingo/lingo-lex.cpp" +#line 662 "engines/director/lingo/lingo-lex.cpp" #define INITIAL 0 @@ -845,7 +846,7 @@ YY_DECL #line 60 "engines/director/lingo/lingo-lex.l" -#line 849 "engines/director/lingo/lingo-lex.cpp" +#line 850 "engines/director/lingo/lingo-lex.cpp" if ( !(yy_init) ) { @@ -899,13 +900,13 @@ yy_match: 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 >= 170 ) + if ( yy_current_state >= 172 ) 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_base[yy_current_state] != 417 ); + while ( yy_base[yy_current_state] != 419 ); yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -1176,31 +1177,36 @@ YY_RULE_SETUP case 38: YY_RULE_SETUP #line 157 "engines/director/lingo/lingo-lex.l" -{ count(); return tWHILE; } +{ count(); return tWHEN; } YY_BREAK case 39: YY_RULE_SETUP -#line 159 "engines/director/lingo/lingo-lex.l" -{ count(); return tNEQ; } +#line 158 "engines/director/lingo/lingo-lex.l" +{ count(); return tWHILE; } YY_BREAK case 40: YY_RULE_SETUP #line 160 "engines/director/lingo/lingo-lex.l" -{ count(); return tGE; } +{ count(); return tNEQ; } YY_BREAK case 41: YY_RULE_SETUP #line 161 "engines/director/lingo/lingo-lex.l" -{ count(); return tLE; } +{ count(); return tGE; } YY_BREAK case 42: YY_RULE_SETUP #line 162 "engines/director/lingo/lingo-lex.l" -{ count(); return tCONCAT; } +{ count(); return tLE; } YY_BREAK case 43: YY_RULE_SETUP -#line 164 "engines/director/lingo/lingo-lex.l" +#line 163 "engines/director/lingo/lingo-lex.l" +{ count(); return tCONCAT; } + YY_BREAK +case 44: +YY_RULE_SETUP +#line 165 "engines/director/lingo/lingo-lex.l" { count(); yylval.s = new Common::String(yytext); @@ -1215,43 +1221,43 @@ YY_RULE_SETUP return ID; } YY_BREAK -case 44: -YY_RULE_SETUP -#line 177 "engines/director/lingo/lingo-lex.l" -{ count(); yylval.f = atof(yytext); return FLOAT; } - YY_BREAK case 45: YY_RULE_SETUP #line 178 "engines/director/lingo/lingo-lex.l" -{ count(); yylval.i = strtol(yytext, NULL, 10); return INT; } +{ count(); yylval.f = atof(yytext); return FLOAT; } YY_BREAK case 46: YY_RULE_SETUP #line 179 "engines/director/lingo/lingo-lex.l" -{ count(); return *yytext; } +{ count(); yylval.i = strtol(yytext, NULL, 10); return INT; } YY_BREAK case 47: -/* rule 47 can match eol */ YY_RULE_SETUP #line 180 "engines/director/lingo/lingo-lex.l" -{ return '\n'; } +{ count(); return *yytext; } YY_BREAK case 48: +/* rule 48 can match eol */ YY_RULE_SETUP #line 181 "engines/director/lingo/lingo-lex.l" -{ count(); yylval.s = new Common::String(&yytext[1]); yylval.s->deleteLastChar(); return STRING; } +{ return '\n'; } YY_BREAK case 49: YY_RULE_SETUP #line 182 "engines/director/lingo/lingo-lex.l" - +{ count(); yylval.s = new Common::String(&yytext[1]); yylval.s->deleteLastChar(); return STRING; } YY_BREAK case 50: YY_RULE_SETUP -#line 184 "engines/director/lingo/lingo-lex.l" +#line 183 "engines/director/lingo/lingo-lex.l" + + YY_BREAK +case 51: +YY_RULE_SETUP +#line 185 "engines/director/lingo/lingo-lex.l" ECHO; YY_BREAK -#line 1255 "engines/director/lingo/lingo-lex.cpp" +#line 1261 "engines/director/lingo/lingo-lex.cpp" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -1544,7 +1550,7 @@ static int yy_get_next_buffer (void) 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 >= 170 ) + if ( yy_current_state >= 172 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -1572,11 +1578,11 @@ static int yy_get_next_buffer (void) 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 >= 170 ) + if ( yy_current_state >= 172 ) 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 == 169); + yy_is_jam = (yy_current_state == 171); return yy_is_jam ? 0 : yy_current_state; } @@ -2251,7 +2257,7 @@ void yyfree (void * ptr ) #define YYTABLES_NAME "yytables" -#line 184 "engines/director/lingo/lingo-lex.l" +#line 185 "engines/director/lingo/lingo-lex.l" |