diff options
Diffstat (limited to 'engines/director/lingo/lingo-lex.cpp')
-rw-r--r-- | engines/director/lingo/lingo-lex.cpp | 189 |
1 files changed, 87 insertions, 102 deletions
diff --git a/engines/director/lingo/lingo-lex.cpp b/engines/director/lingo/lingo-lex.cpp index de7005275d..1f5d81d668 100644 --- a/engines/director/lingo/lingo-lex.cpp +++ b/engines/director/lingo/lingo-lex.cpp @@ -733,8 +733,9 @@ char *yytext; * */ #define YY_NO_INPUT 1 -#line 28 "engines/director/lingo/lingo-lex.l" +#line 29 "engines/director/lingo/lingo-lex.l" +#define YY_NO_UNISTD_H #define FORBIDDEN_SYMBOL_ALLOW_ALL #include "common/str.h" @@ -752,15 +753,6 @@ static void count() { g_lingo->_colnumber += strlen(yytext); } -#if defined(__PLAYSTATION2__) || defined(_MSC_VER) || defined(__DC__) -// Stub for missing function -int isatty(int fileno) { return 0; } -#endif - -#if defined(_MSC_VER) || defined(__DC__) -#define YY_NO_UNISTD_H -#endif - static void countnl() { char *p = yytext; @@ -781,7 +773,7 @@ static int checkImmediate(int token) { return token; } -#line 785 "engines/director/lingo/lingo-lex.cpp" +#line 777 "engines/director/lingo/lingo-lex.cpp" #define INITIAL 0 @@ -964,10 +956,10 @@ YY_DECL register char *yy_cp, *yy_bp; register int yy_act; -#line 85 "engines/director/lingo/lingo-lex.l" +#line 78 "engines/director/lingo/lingo-lex.l" -#line 971 "engines/director/lingo/lingo-lex.cpp" +#line 963 "engines/director/lingo/lingo-lex.cpp" if ( !(yy_init) ) { @@ -1027,16 +1019,12 @@ yy_match: yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 702 ); + while ( yy_current_state != 273 ); + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); yy_find_action: yy_act = yy_accept[yy_current_state]; - if ( yy_act == 0 ) - { /* have to back up */ - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - yy_act = yy_accept[yy_current_state]; - } YY_DO_BEFORE_ACTION; @@ -1054,89 +1042,89 @@ do_action: /* This label is used only to access EOF actions. */ case 1: /* rule 1 can match eol */ YY_RULE_SETUP -#line 87 "engines/director/lingo/lingo-lex.l" +#line 80 "engines/director/lingo/lingo-lex.l" { g_lingo->_linenumber++; g_lingo->_colnumber = 0; } YY_BREAK case 2: YY_RULE_SETUP -#line 88 "engines/director/lingo/lingo-lex.l" +#line 81 "engines/director/lingo/lingo-lex.l" YY_BREAK case 3: YY_RULE_SETUP -#line 89 "engines/director/lingo/lingo-lex.l" +#line 82 "engines/director/lingo/lingo-lex.l" { count(); } YY_BREAK case 4: YY_RULE_SETUP -#line 90 "engines/director/lingo/lingo-lex.l" +#line 83 "engines/director/lingo/lingo-lex.l" { count(); return ' '; } YY_BREAK case 5: YY_RULE_SETUP -#line 92 "engines/director/lingo/lingo-lex.l" +#line 85 "engines/director/lingo/lingo-lex.l" { count(); yylval.s = new Common::String(yytext); return SYMBOL; } // D3 YY_BREAK case 6: YY_RULE_SETUP -#line 94 "engines/director/lingo/lingo-lex.l" +#line 87 "engines/director/lingo/lingo-lex.l" { count(); return tAFTER; } // D3 YY_BREAK case 7: YY_RULE_SETUP -#line 95 "engines/director/lingo/lingo-lex.l" +#line 88 "engines/director/lingo/lingo-lex.l" { count(); return tAND; } YY_BREAK case 8: YY_RULE_SETUP -#line 96 "engines/director/lingo/lingo-lex.l" +#line 89 "engines/director/lingo/lingo-lex.l" { count(); return tBEFORE; } // D3 YY_BREAK case 9: YY_RULE_SETUP -#line 97 "engines/director/lingo/lingo-lex.l" +#line 90 "engines/director/lingo/lingo-lex.l" { count(); return tCHAR; } // D3 YY_BREAK case 10: YY_RULE_SETUP -#line 98 "engines/director/lingo/lingo-lex.l" +#line 91 "engines/director/lingo/lingo-lex.l" { count(); return tCONTAINS; } YY_BREAK case 11: YY_RULE_SETUP -#line 99 "engines/director/lingo/lingo-lex.l" +#line 92 "engines/director/lingo/lingo-lex.l" { count(); return tDONE; } YY_BREAK case 12: YY_RULE_SETUP -#line 100 "engines/director/lingo/lingo-lex.l" +#line 93 "engines/director/lingo/lingo-lex.l" { count(); return tDOWN; } YY_BREAK case 13: YY_RULE_SETUP -#line 101 "engines/director/lingo/lingo-lex.l" +#line 94 "engines/director/lingo/lingo-lex.l" { count(); return tIF; } YY_BREAK case 14: /* rule 14 can match eol */ YY_RULE_SETUP -#line 102 "engines/director/lingo/lingo-lex.l" +#line 95 "engines/director/lingo/lingo-lex.l" { countnl(); return tNLELSIF; } YY_BREAK case 15: /* rule 15 can match eol */ YY_RULE_SETUP -#line 103 "engines/director/lingo/lingo-lex.l" +#line 96 "engines/director/lingo/lingo-lex.l" { countnl(); return tNLELSE; } YY_BREAK case 16: YY_RULE_SETUP -#line 104 "engines/director/lingo/lingo-lex.l" +#line 97 "engines/director/lingo/lingo-lex.l" { count(); return tELSE; } YY_BREAK case 17: YY_RULE_SETUP -#line 105 "engines/director/lingo/lingo-lex.l" +#line 98 "engines/director/lingo/lingo-lex.l" { count(); @@ -1151,162 +1139,162 @@ YY_RULE_SETUP YY_BREAK case 18: YY_RULE_SETUP -#line 116 "engines/director/lingo/lingo-lex.l" +#line 109 "engines/director/lingo/lingo-lex.l" { count(); return tFACTORY; } YY_BREAK case 19: YY_RULE_SETUP -#line 117 "engines/director/lingo/lingo-lex.l" +#line 110 "engines/director/lingo/lingo-lex.l" { count(); return tEXIT; } YY_BREAK case 20: YY_RULE_SETUP -#line 118 "engines/director/lingo/lingo-lex.l" +#line 111 "engines/director/lingo/lingo-lex.l" { count(); return tFRAME; } YY_BREAK case 21: YY_RULE_SETUP -#line 119 "engines/director/lingo/lingo-lex.l" +#line 112 "engines/director/lingo/lingo-lex.l" { count(); return tGLOBAL; } YY_BREAK case 22: YY_RULE_SETUP -#line 120 "engines/director/lingo/lingo-lex.l" +#line 113 "engines/director/lingo/lingo-lex.l" { count(); return tGO; } YY_BREAK case 23: YY_RULE_SETUP -#line 121 "engines/director/lingo/lingo-lex.l" +#line 114 "engines/director/lingo/lingo-lex.l" { count(); return tGO; } YY_BREAK case 24: YY_RULE_SETUP -#line 122 "engines/director/lingo/lingo-lex.l" +#line 115 "engines/director/lingo/lingo-lex.l" { count(); return tINSTANCE; } YY_BREAK case 25: YY_RULE_SETUP -#line 123 "engines/director/lingo/lingo-lex.l" +#line 116 "engines/director/lingo/lingo-lex.l" { count(); return tINTERSECTS; } YY_BREAK case 26: YY_RULE_SETUP -#line 124 "engines/director/lingo/lingo-lex.l" +#line 117 "engines/director/lingo/lingo-lex.l" { count(); return tINTO; } YY_BREAK case 27: YY_RULE_SETUP -#line 125 "engines/director/lingo/lingo-lex.l" +#line 118 "engines/director/lingo/lingo-lex.l" { count(); return tITEM; } YY_BREAK case 28: YY_RULE_SETUP -#line 126 "engines/director/lingo/lingo-lex.l" +#line 119 "engines/director/lingo/lingo-lex.l" { count(); return tLINE; } YY_BREAK case 29: YY_RULE_SETUP -#line 127 "engines/director/lingo/lingo-lex.l" +#line 120 "engines/director/lingo/lingo-lex.l" { count(); return checkImmediate(tLOOP); } YY_BREAK case 30: YY_RULE_SETUP -#line 128 "engines/director/lingo/lingo-lex.l" +#line 121 "engines/director/lingo/lingo-lex.l" { count(); return tMACRO; } YY_BREAK case 31: YY_RULE_SETUP -#line 129 "engines/director/lingo/lingo-lex.l" +#line 122 "engines/director/lingo/lingo-lex.l" { count(); return tMETHOD; } YY_BREAK case 32: YY_RULE_SETUP -#line 130 "engines/director/lingo/lingo-lex.l" +#line 123 "engines/director/lingo/lingo-lex.l" { count(); return tMOD; } YY_BREAK case 33: YY_RULE_SETUP -#line 131 "engines/director/lingo/lingo-lex.l" +#line 124 "engines/director/lingo/lingo-lex.l" { count(); return tMOVIE; } YY_BREAK case 34: YY_RULE_SETUP -#line 132 "engines/director/lingo/lingo-lex.l" +#line 125 "engines/director/lingo/lingo-lex.l" { count(); return tNEXT; } YY_BREAK case 35: YY_RULE_SETUP -#line 133 "engines/director/lingo/lingo-lex.l" +#line 126 "engines/director/lingo/lingo-lex.l" { count(); return tNOT; } YY_BREAK case 36: YY_RULE_SETUP -#line 134 "engines/director/lingo/lingo-lex.l" +#line 127 "engines/director/lingo/lingo-lex.l" { count(); return tOF; } YY_BREAK case 37: YY_RULE_SETUP -#line 135 "engines/director/lingo/lingo-lex.l" +#line 128 "engines/director/lingo/lingo-lex.l" { count(); return tON; } // D3 YY_BREAK case 38: YY_RULE_SETUP -#line 136 "engines/director/lingo/lingo-lex.l" +#line 129 "engines/director/lingo/lingo-lex.l" { count(); return tOPEN; } YY_BREAK case 39: YY_RULE_SETUP -#line 137 "engines/director/lingo/lingo-lex.l" +#line 130 "engines/director/lingo/lingo-lex.l" { count(); return tOR; } YY_BREAK case 40: YY_RULE_SETUP -#line 138 "engines/director/lingo/lingo-lex.l" +#line 131 "engines/director/lingo/lingo-lex.l" { count(); return tPLAY; } YY_BREAK case 41: YY_RULE_SETUP -#line 139 "engines/director/lingo/lingo-lex.l" +#line 132 "engines/director/lingo/lingo-lex.l" { count(); yylval.s = new Common::String(yytext); return tPLAYACCEL; } YY_BREAK case 42: YY_RULE_SETUP -#line 140 "engines/director/lingo/lingo-lex.l" +#line 133 "engines/director/lingo/lingo-lex.l" { count(); return tPREVIOUS; } YY_BREAK case 43: YY_RULE_SETUP -#line 141 "engines/director/lingo/lingo-lex.l" +#line 134 "engines/director/lingo/lingo-lex.l" { count(); return tPROPERTY; } // D4 YY_BREAK case 44: YY_RULE_SETUP -#line 142 "engines/director/lingo/lingo-lex.l" +#line 135 "engines/director/lingo/lingo-lex.l" { count(); return tPUT; } YY_BREAK case 45: YY_RULE_SETUP -#line 143 "engines/director/lingo/lingo-lex.l" +#line 136 "engines/director/lingo/lingo-lex.l" { count(); return checkImmediate(tREPEAT); } YY_BREAK case 46: YY_RULE_SETUP -#line 144 "engines/director/lingo/lingo-lex.l" +#line 137 "engines/director/lingo/lingo-lex.l" { count(); return tSET; } YY_BREAK case 47: YY_RULE_SETUP -#line 145 "engines/director/lingo/lingo-lex.l" +#line 138 "engines/director/lingo/lingo-lex.l" { count(); return tSTARTS; } YY_BREAK case 48: YY_RULE_SETUP -#line 146 "engines/director/lingo/lingo-lex.l" +#line 139 "engines/director/lingo/lingo-lex.l" { count(); return tTELL; } YY_BREAK case 49: YY_RULE_SETUP -#line 147 "engines/director/lingo/lingo-lex.l" +#line 140 "engines/director/lingo/lingo-lex.l" { count(); @@ -1318,7 +1306,7 @@ YY_RULE_SETUP YY_BREAK case 50: YY_RULE_SETUP -#line 155 "engines/director/lingo/lingo-lex.l" +#line 148 "engines/director/lingo/lingo-lex.l" { count(); @@ -1330,7 +1318,7 @@ YY_RULE_SETUP YY_BREAK case 51: YY_RULE_SETUP -#line 163 "engines/director/lingo/lingo-lex.l" +#line 156 "engines/director/lingo/lingo-lex.l" { count(); @@ -1374,7 +1362,7 @@ YY_RULE_SETUP YY_BREAK case 52: YY_RULE_SETUP -#line 203 "engines/director/lingo/lingo-lex.l" +#line 196 "engines/director/lingo/lingo-lex.l" { count(); @@ -1409,7 +1397,7 @@ YY_RULE_SETUP YY_BREAK case 53: YY_RULE_SETUP -#line 234 "engines/director/lingo/lingo-lex.l" +#line 227 "engines/director/lingo/lingo-lex.l" { count(); @@ -1432,73 +1420,73 @@ YY_RULE_SETUP YY_BREAK case 54: YY_RULE_SETUP -#line 253 "engines/director/lingo/lingo-lex.l" +#line 246 "engines/director/lingo/lingo-lex.l" { count(); return tTHEN; } YY_BREAK case 55: /* rule 55 can match eol */ YY_RULE_SETUP -#line 254 "engines/director/lingo/lingo-lex.l" +#line 247 "engines/director/lingo/lingo-lex.l" { count(); return tTHENNL; } YY_BREAK case 56: YY_RULE_SETUP -#line 255 "engines/director/lingo/lingo-lex.l" +#line 248 "engines/director/lingo/lingo-lex.l" { count(); return tTO; } YY_BREAK case 57: YY_RULE_SETUP -#line 256 "engines/director/lingo/lingo-lex.l" +#line 249 "engines/director/lingo/lingo-lex.l" { count(); return tSPRITE; } YY_BREAK case 58: YY_RULE_SETUP -#line 257 "engines/director/lingo/lingo-lex.l" +#line 250 "engines/director/lingo/lingo-lex.l" { count(); return tWITH; } YY_BREAK case 59: YY_RULE_SETUP -#line 258 "engines/director/lingo/lingo-lex.l" +#line 251 "engines/director/lingo/lingo-lex.l" { count(); return tWITHIN; } YY_BREAK case 60: YY_RULE_SETUP -#line 259 "engines/director/lingo/lingo-lex.l" +#line 252 "engines/director/lingo/lingo-lex.l" { count(); return tWHEN; } YY_BREAK case 61: YY_RULE_SETUP -#line 260 "engines/director/lingo/lingo-lex.l" +#line 253 "engines/director/lingo/lingo-lex.l" { count(); return tWHILE; } YY_BREAK case 62: YY_RULE_SETUP -#line 261 "engines/director/lingo/lingo-lex.l" +#line 254 "engines/director/lingo/lingo-lex.l" { count(); return tWORD; } YY_BREAK case 63: YY_RULE_SETUP -#line 263 "engines/director/lingo/lingo-lex.l" +#line 256 "engines/director/lingo/lingo-lex.l" { count(); return tNEQ; } YY_BREAK case 64: YY_RULE_SETUP -#line 264 "engines/director/lingo/lingo-lex.l" +#line 257 "engines/director/lingo/lingo-lex.l" { count(); return tGE; } YY_BREAK case 65: YY_RULE_SETUP -#line 265 "engines/director/lingo/lingo-lex.l" +#line 258 "engines/director/lingo/lingo-lex.l" { count(); return tLE; } YY_BREAK case 66: YY_RULE_SETUP -#line 266 "engines/director/lingo/lingo-lex.l" +#line 259 "engines/director/lingo/lingo-lex.l" { count(); return tCONCAT; } YY_BREAK case 67: YY_RULE_SETUP -#line 268 "engines/director/lingo/lingo-lex.l" +#line 261 "engines/director/lingo/lingo-lex.l" { count(); yylval.s = new Common::String(yytext); @@ -1547,41 +1535,41 @@ YY_RULE_SETUP YY_BREAK case 68: YY_RULE_SETUP -#line 313 "engines/director/lingo/lingo-lex.l" +#line 306 "engines/director/lingo/lingo-lex.l" { count(); yylval.f = atof(yytext); return FLOAT; } YY_BREAK case 69: YY_RULE_SETUP -#line 314 "engines/director/lingo/lingo-lex.l" +#line 307 "engines/director/lingo/lingo-lex.l" { count(); yylval.i = strtol(yytext, NULL, 10); return INT; } YY_BREAK case 70: YY_RULE_SETUP -#line 315 "engines/director/lingo/lingo-lex.l" +#line 308 "engines/director/lingo/lingo-lex.l" { count(); return *yytext; } YY_BREAK case 71: /* rule 71 can match eol */ YY_RULE_SETUP -#line 316 "engines/director/lingo/lingo-lex.l" +#line 309 "engines/director/lingo/lingo-lex.l" { return '\n'; } YY_BREAK case 72: YY_RULE_SETUP -#line 317 "engines/director/lingo/lingo-lex.l" +#line 310 "engines/director/lingo/lingo-lex.l" { count(); yylval.s = new Common::String(&yytext[1]); yylval.s->deleteLastChar(); return STRING; } YY_BREAK case 73: YY_RULE_SETUP -#line 318 "engines/director/lingo/lingo-lex.l" +#line 311 "engines/director/lingo/lingo-lex.l" { count(); } YY_BREAK case 74: YY_RULE_SETUP -#line 320 "engines/director/lingo/lingo-lex.l" +#line 313 "engines/director/lingo/lingo-lex.l" ECHO; YY_BREAK -#line 1585 "engines/director/lingo/lingo-lex.cpp" +#line 1573 "engines/director/lingo/lingo-lex.cpp" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -1648,7 +1636,8 @@ case YY_STATE_EOF(INITIAL): else { - yy_cp = (yy_c_buf_p); + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); goto yy_find_action; } } @@ -2097,10 +2086,6 @@ static void yy_load_buffer_state (void) yyfree((void *) b ); } -#ifndef __cplusplus -extern int isatty (int ); -#endif /* __cplusplus */ - /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a yyrestart() or at EOF. @@ -2124,7 +2109,7 @@ extern int isatty (int ); b->yy_bs_column = 0; } - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; + b->yy_is_interactive = 0; errno = oerrno; } @@ -2544,7 +2529,7 @@ void yyfree (void * ptr ) #define YYTABLES_NAME "yytables" -#line 320 "engines/director/lingo/lingo-lex.l" +#line 313 "engines/director/lingo/lingo-lex.l" |