diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/director/lingo/lingo-lex.cpp | 114 | ||||
-rw-r--r-- | engines/director/lingo/lingo-lex.l | 10 |
2 files changed, 64 insertions, 60 deletions
diff --git a/engines/director/lingo/lingo-lex.cpp b/engines/director/lingo/lingo-lex.cpp index 668e7835b9..58d052ee0c 100644 --- a/engines/director/lingo/lingo-lex.cpp +++ b/engines/director/lingo/lingo-lex.cpp @@ -625,9 +625,11 @@ char *yytext; #include "director/lingo/lingo.h" #include "director/lingo/lingo-gr.h" +using namespace Director; + int yyparse(); static void count() { - Director::g_lingo->_colnumber += strlen(yytext); + g_lingo->_colnumber += strlen(yytext); } static void countnl() { @@ -636,11 +638,11 @@ static void countnl() { while(*p == '\n' || *p == '\r') p++; - Director::g_lingo->_linenumber++; - Director::g_lingo->_colnumber = strlen(p); + g_lingo->_linenumber++; + g_lingo->_colnumber = strlen(p); } -#line 644 "engines/director/lingo/lingo-lex.cpp" +#line 646 "engines/director/lingo/lingo-lex.cpp" #define INITIAL 0 @@ -825,10 +827,10 @@ YY_DECL register char *yy_cp, *yy_bp; register int yy_act; -#line 58 "engines/director/lingo/lingo-lex.l" +#line 60 "engines/director/lingo/lingo-lex.l" -#line 832 "engines/director/lingo/lingo-lex.cpp" +#line 834 "engines/director/lingo/lingo-lex.cpp" if ( !(yy_init) ) { @@ -914,159 +916,159 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 60 "engines/director/lingo/lingo-lex.l" +#line 62 "engines/director/lingo/lingo-lex.l" YY_BREAK case 2: YY_RULE_SETUP -#line 61 "engines/director/lingo/lingo-lex.l" +#line 63 "engines/director/lingo/lingo-lex.l" { count(); } YY_BREAK case 3: YY_RULE_SETUP -#line 62 "engines/director/lingo/lingo-lex.l" +#line 64 "engines/director/lingo/lingo-lex.l" { count(); return ' '; } YY_BREAK case 4: YY_RULE_SETUP -#line 64 "engines/director/lingo/lingo-lex.l" +#line 66 "engines/director/lingo/lingo-lex.l" { count(); return tAND; } YY_BREAK case 5: YY_RULE_SETUP -#line 65 "engines/director/lingo/lingo-lex.l" +#line 67 "engines/director/lingo/lingo-lex.l" { count(); return tCONTAINS; } YY_BREAK case 6: YY_RULE_SETUP -#line 66 "engines/director/lingo/lingo-lex.l" +#line 68 "engines/director/lingo/lingo-lex.l" { count(); return tDOWN; } YY_BREAK case 7: YY_RULE_SETUP -#line 67 "engines/director/lingo/lingo-lex.l" +#line 69 "engines/director/lingo/lingo-lex.l" { count(); return tIF; } YY_BREAK case 8: /* rule 8 can match eol */ YY_RULE_SETUP -#line 68 "engines/director/lingo/lingo-lex.l" +#line 70 "engines/director/lingo/lingo-lex.l" { countnl(); return tNLELSIF; } YY_BREAK case 9: /* rule 9 can match eol */ YY_RULE_SETUP -#line 69 "engines/director/lingo/lingo-lex.l" +#line 71 "engines/director/lingo/lingo-lex.l" { countnl(); return tNLELSE; } YY_BREAK case 10: YY_RULE_SETUP -#line 70 "engines/director/lingo/lingo-lex.l" +#line 72 "engines/director/lingo/lingo-lex.l" { count(); return tELSE; } YY_BREAK case 11: YY_RULE_SETUP -#line 71 "engines/director/lingo/lingo-lex.l" +#line 73 "engines/director/lingo/lingo-lex.l" { count(); return tEND; } YY_BREAK case 12: YY_RULE_SETUP -#line 72 "engines/director/lingo/lingo-lex.l" +#line 74 "engines/director/lingo/lingo-lex.l" { count(); return tEXIT; } YY_BREAK case 13: YY_RULE_SETUP -#line 73 "engines/director/lingo/lingo-lex.l" +#line 75 "engines/director/lingo/lingo-lex.l" { count(); return tFRAME; } YY_BREAK case 14: YY_RULE_SETUP -#line 74 "engines/director/lingo/lingo-lex.l" +#line 76 "engines/director/lingo/lingo-lex.l" { count(); return tGLOBAL; } YY_BREAK case 15: YY_RULE_SETUP -#line 75 "engines/director/lingo/lingo-lex.l" +#line 77 "engines/director/lingo/lingo-lex.l" { count(); return tGO; } YY_BREAK case 16: YY_RULE_SETUP -#line 76 "engines/director/lingo/lingo-lex.l" +#line 78 "engines/director/lingo/lingo-lex.l" { count(); return tINTO; } YY_BREAK case 17: YY_RULE_SETUP -#line 77 "engines/director/lingo/lingo-lex.l" +#line 79 "engines/director/lingo/lingo-lex.l" { count(); return tLOOP; } YY_BREAK case 18: YY_RULE_SETUP -#line 78 "engines/director/lingo/lingo-lex.l" +#line 80 "engines/director/lingo/lingo-lex.l" { count(); return tMACRO; } YY_BREAK case 19: YY_RULE_SETUP -#line 79 "engines/director/lingo/lingo-lex.l" +#line 81 "engines/director/lingo/lingo-lex.l" { count(); return tMCI; } YY_BREAK case 20: YY_RULE_SETUP -#line 80 "engines/director/lingo/lingo-lex.l" +#line 82 "engines/director/lingo/lingo-lex.l" { count(); return tMCIWAIT; } YY_BREAK case 21: YY_RULE_SETUP -#line 81 "engines/director/lingo/lingo-lex.l" +#line 83 "engines/director/lingo/lingo-lex.l" { count(); return tMOVIE; } YY_BREAK case 22: YY_RULE_SETUP -#line 82 "engines/director/lingo/lingo-lex.l" +#line 84 "engines/director/lingo/lingo-lex.l" { count(); return tNEXT; } YY_BREAK case 23: YY_RULE_SETUP -#line 83 "engines/director/lingo/lingo-lex.l" +#line 85 "engines/director/lingo/lingo-lex.l" { count(); return tNOT; } YY_BREAK case 24: YY_RULE_SETUP -#line 84 "engines/director/lingo/lingo-lex.l" +#line 86 "engines/director/lingo/lingo-lex.l" { count(); return tOF; } YY_BREAK case 25: YY_RULE_SETUP -#line 85 "engines/director/lingo/lingo-lex.l" +#line 87 "engines/director/lingo/lingo-lex.l" { count(); return tOR; } YY_BREAK case 26: YY_RULE_SETUP -#line 86 "engines/director/lingo/lingo-lex.l" +#line 88 "engines/director/lingo/lingo-lex.l" { count(); return tPREVIOUS; } YY_BREAK case 27: YY_RULE_SETUP -#line 87 "engines/director/lingo/lingo-lex.l" +#line 89 "engines/director/lingo/lingo-lex.l" { count(); return tPUT; } YY_BREAK case 28: YY_RULE_SETUP -#line 88 "engines/director/lingo/lingo-lex.l" +#line 90 "engines/director/lingo/lingo-lex.l" { count(); return tREPEAT; } YY_BREAK case 29: YY_RULE_SETUP -#line 89 "engines/director/lingo/lingo-lex.l" +#line 91 "engines/director/lingo/lingo-lex.l" { count(); return tSET; } YY_BREAK case 30: YY_RULE_SETUP -#line 90 "engines/director/lingo/lingo-lex.l" +#line 92 "engines/director/lingo/lingo-lex.l" { count(); return tSTARTS; } YY_BREAK case 31: YY_RULE_SETUP -#line 91 "engines/director/lingo/lingo-lex.l" +#line 93 "engines/director/lingo/lingo-lex.l" { count(); @@ -1079,52 +1081,52 @@ YY_RULE_SETUP YY_BREAK case 32: YY_RULE_SETUP -#line 100 "engines/director/lingo/lingo-lex.l" +#line 102 "engines/director/lingo/lingo-lex.l" { count(); return tTHEN; } YY_BREAK case 33: YY_RULE_SETUP -#line 101 "engines/director/lingo/lingo-lex.l" +#line 103 "engines/director/lingo/lingo-lex.l" { count(); return tTO; } YY_BREAK case 34: YY_RULE_SETUP -#line 102 "engines/director/lingo/lingo-lex.l" +#line 104 "engines/director/lingo/lingo-lex.l" { count(); return tWITH; } YY_BREAK case 35: YY_RULE_SETUP -#line 103 "engines/director/lingo/lingo-lex.l" +#line 105 "engines/director/lingo/lingo-lex.l" { count(); return tWHILE; } YY_BREAK case 36: YY_RULE_SETUP -#line 105 "engines/director/lingo/lingo-lex.l" +#line 107 "engines/director/lingo/lingo-lex.l" { count(); return tNEQ; } YY_BREAK case 37: YY_RULE_SETUP -#line 106 "engines/director/lingo/lingo-lex.l" +#line 108 "engines/director/lingo/lingo-lex.l" { count(); return tGE; } YY_BREAK case 38: YY_RULE_SETUP -#line 107 "engines/director/lingo/lingo-lex.l" +#line 109 "engines/director/lingo/lingo-lex.l" { count(); return tLE; } YY_BREAK case 39: YY_RULE_SETUP -#line 108 "engines/director/lingo/lingo-lex.l" +#line 110 "engines/director/lingo/lingo-lex.l" { count(); return tCONCAT; } YY_BREAK case 40: YY_RULE_SETUP -#line 110 "engines/director/lingo/lingo-lex.l" +#line 112 "engines/director/lingo/lingo-lex.l" { count(); yylval.s = new Common::String(yytext); - if (Director::g_lingo->_builtins.contains(yytext)) + if (g_lingo->_builtins.contains(yytext)) return BLTIN; return ID; @@ -1132,41 +1134,41 @@ YY_RULE_SETUP YY_BREAK case 41: YY_RULE_SETUP -#line 119 "engines/director/lingo/lingo-lex.l" +#line 121 "engines/director/lingo/lingo-lex.l" { count(); yylval.f = atof(yytext); return FLOAT; } YY_BREAK case 42: YY_RULE_SETUP -#line 120 "engines/director/lingo/lingo-lex.l" +#line 122 "engines/director/lingo/lingo-lex.l" { count(); yylval.i = strtol(yytext, NULL, 10); return INT; } YY_BREAK case 43: YY_RULE_SETUP -#line 121 "engines/director/lingo/lingo-lex.l" +#line 123 "engines/director/lingo/lingo-lex.l" { count(); return *yytext; } YY_BREAK case 44: /* rule 44 can match eol */ YY_RULE_SETUP -#line 122 "engines/director/lingo/lingo-lex.l" +#line 124 "engines/director/lingo/lingo-lex.l" { return '\n'; } YY_BREAK case 45: YY_RULE_SETUP -#line 123 "engines/director/lingo/lingo-lex.l" +#line 125 "engines/director/lingo/lingo-lex.l" { count(); yylval.s = new Common::String(&yytext[1]); yylval.s->deleteLastChar(); return STRING; } YY_BREAK case 46: YY_RULE_SETUP -#line 124 "engines/director/lingo/lingo-lex.l" +#line 126 "engines/director/lingo/lingo-lex.l" YY_BREAK case 47: YY_RULE_SETUP -#line 126 "engines/director/lingo/lingo-lex.l" +#line 128 "engines/director/lingo/lingo-lex.l" ECHO; YY_BREAK -#line 1170 "engines/director/lingo/lingo-lex.cpp" +#line 1172 "engines/director/lingo/lingo-lex.cpp" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -2166,7 +2168,7 @@ void yyfree (void * ptr ) #define YYTABLES_NAME "yytables" -#line 126 "engines/director/lingo/lingo-lex.l" +#line 128 "engines/director/lingo/lingo-lex.l" diff --git a/engines/director/lingo/lingo-lex.l b/engines/director/lingo/lingo-lex.l index 6b14bfccd9..40f66a6e34 100644 --- a/engines/director/lingo/lingo-lex.l +++ b/engines/director/lingo/lingo-lex.l @@ -30,9 +30,11 @@ #include "director/lingo/lingo.h" #include "director/lingo/lingo-gr.h" +using namespace Director; + int yyparse(); static void count() { - Director::g_lingo->_colnumber += strlen(yytext); + g_lingo->_colnumber += strlen(yytext); } static void countnl() { @@ -41,8 +43,8 @@ static void countnl() { while(*p == '\n' || *p == '\r') p++; - Director::g_lingo->_linenumber++; - Director::g_lingo->_colnumber = strlen(p); + g_lingo->_linenumber++; + g_lingo->_colnumber = strlen(p); } %} @@ -111,7 +113,7 @@ whitespace [\t ] count(); yylval.s = new Common::String(yytext); - if (Director::g_lingo->_builtins.contains(yytext)) + if (g_lingo->_builtins.contains(yytext)) return BLTIN; return ID; |