From de848a4131beb288335b6aaa29c2a6a439c50e0e Mon Sep 17 00:00:00 2001 From: fusion32 Date: Thu, 22 May 2025 01:02:13 -0300 Subject: implement script lexer --- reference/game.c | 1050 ------------------------------------------------------ 1 file changed, 1050 deletions(-) (limited to 'reference/game.c') diff --git a/reference/game.c b/reference/game.c index dc91196..1affc5c 100644 --- a/reference/game.c +++ b/reference/game.c @@ -1955,198 +1955,6 @@ void _GLOBAL__I_BeADaemon(void) return; } -bool isSpace(int c) - -{ - bool bVar1; - - bVar1 = false; - if ((((c == 0x20) || (c == 0xc)) || (c == 10)) || (((c == 0xd || (c == 9)) || (c == 0xb)))) { - bVar1 = true; - } - return bVar1; -} - - - -bool isAlpha(int c) - -{ - bool bVar1; - - bVar1 = false; - if ((((((c - 0x61U < 0x1a) || (c - 0x41U < 0x1a)) || (c == -0x1c)) || ((c == -10 || (c == -4)))) - || ((c == -0x3c || ((c == -0x2a || (c == -0x24)))))) || (c == -0x21)) { - bVar1 = true; - } - return bVar1; -} - - - -bool isEngAlpha(int c) - -{ - bool bVar1; - - bVar1 = false; - if ((c - 0x61U < 0x1a) || (c - 0x41U < 0x1a)) { - bVar1 = true; - } - return bVar1; -} - - - -bool isDigit(int c) - -{ - return c - 0x30U < 10; -} - - - -int toLower(int c) - -{ - if ((c - 0x41U < 0x1a) || ((byte)((char)(c - 0x41U) + 0x81U) < 0x1f)) { - c = c + 0x20; - } - return c; -} - - - -int toUpper(int c) - -{ - if ((c - 0x61U < 0x1a) || ((byte)((char)(c - 0x61U) + 0x81U) < 0x1f)) { - c = c + -0x20; - } - return c; -} - - - -char * strLower(char *s) - -{ - char cVar1; - int i; - int iVar2; - - iVar2 = 0; - cVar1 = *s; - while (cVar1 != '\0') { - if (((int)cVar1 - 0x41U < 0x1a) || ((byte)((char)((int)cVar1 - 0x41U) + 0x81U) < 0x1f)) { - cVar1 = cVar1 + ' '; - } - s[iVar2] = cVar1; - iVar2 = iVar2 + 1; - cVar1 = s[iVar2]; - } - return s; -} - - - -char * strUpper(char *s) - -{ - char cVar1; - int i; - int iVar2; - - iVar2 = 0; - cVar1 = *s; - while (cVar1 != '\0') { - if (((int)cVar1 - 0x61U < 0x1a) || ((byte)((char)((int)cVar1 - 0x61U) + 0x81U) < 0x1f)) { - cVar1 = cVar1 + -0x20; - } - s[iVar2] = cVar1; - iVar2 = iVar2 + 1; - cVar1 = s[iVar2]; - } - return s; -} - - - -int stricmp(char *s1,char *s2,int Pos) - -{ - char cVar1; - int iVar2; - int iVar3; - int i; - int iVar4; - - iVar4 = 0; - while( true ) { - if (iVar4 == Pos) { - return 0; - } - cVar1 = s1[iVar4]; - iVar2 = (int)cVar1; - if ((iVar2 - 0x41U < 0x1a) || ((byte)((char)(iVar2 - 0x41U) + 0x81U) < 0x1f)) { - iVar2 = iVar2 + 0x20; - } - iVar3 = (int)s2[iVar4]; - if ((iVar3 - 0x41U < 0x1a) || ((byte)((char)(iVar3 - 0x41U) + 0x81U) < 0x1f)) { - iVar3 = iVar3 + 0x20; - } - if (iVar3 < iVar2) break; - iVar2 = (int)cVar1; - if ((iVar2 - 0x41U < 0x1a) || ((byte)((char)(iVar2 - 0x41U) + 0x81U) < 0x1f)) { - iVar2 = iVar2 + 0x20; - } - iVar3 = (int)s2[iVar4]; - if ((iVar3 - 0x41U < 0x1a) || ((byte)((char)(iVar3 - 0x41U) + 0x81U) < 0x1f)) { - iVar3 = iVar3 + 0x20; - } - if (iVar2 < iVar3) { - return -1; - } - if (cVar1 == '\0') { - return 0; - } - iVar4 = iVar4 + 1; - } - return 1; -} - - - -char * findFirst(char *s,char c) - -{ - char *pcVar1; - - pcVar1 = strchr(s,(int)c); - return pcVar1; -} - - - -char * findLast(char *s,char c) - -{ - char *pcVar1; - char *p; - char *pcVar2; - - pcVar2 = (char *)0x0; - while( true ) { - pcVar1 = strchr(s,(int)c); - if (pcVar1 == (char *)0x0) break; - s = pcVar1 + 1; - pcVar2 = pcVar1; - } - return pcVar2; -} - - - void SetPrintFunction(TPrintFunction *Function) { @@ -3786,864 +3594,6 @@ LAB_0804eb1e: return; } - - -// DWARF original prototype: void TReadScriptFile(TReadScriptFile * this) - -void __thiscall TReadScriptFile::TReadScriptFile(TReadScriptFile *this) - -{ - this->RecursionDepth = -1; - this->Bytes = (uchar *)this->String; - return; -} - - - -// DWARF original prototype: void TReadScriptFile(TReadScriptFile * this) - -void __thiscall TReadScriptFile::TReadScriptFile(TReadScriptFile *this) - -{ - this->RecursionDepth = -1; - this->Bytes = (uchar *)this->String; - return; -} - - - -// DWARF original prototype: void ~TReadScriptFile(TReadScriptFile * this, int __in_chrg) - -void __thiscall TReadScriptFile::~TReadScriptFile(TReadScriptFile *this,int __in_chrg) - -{ - int iVar1; - int *piVar2; - - if (this->RecursionDepth != -1) { - ::error("TReadScriptFile::~TReadScriptFile: Datei ist noch offen.\n"); - iVar1 = this->RecursionDepth; - while (iVar1 != -1) { - iVar1 = fclose((FILE *)this->File[iVar1]); - if (iVar1 != 0) { - piVar2 = __errno_location(); - ::error(&DAT_080ef4e0,*piVar2); - } - this->RecursionDepth = this->RecursionDepth + -1; - iVar1 = this->RecursionDepth; - } - } - return; -} - - - -// DWARF original prototype: void ~TReadScriptFile(TReadScriptFile * this, int __in_chrg) - -void __thiscall TReadScriptFile::~TReadScriptFile(TReadScriptFile *this,int __in_chrg) - -{ - int iVar1; - int *piVar2; - - if (this->RecursionDepth != -1) { - ::error("TReadScriptFile::~TReadScriptFile: Datei ist noch offen.\n"); - iVar1 = this->RecursionDepth; - while (iVar1 != -1) { - iVar1 = fclose((FILE *)this->File[iVar1]); - if (iVar1 != 0) { - piVar2 = __errno_location(); - ::error(&DAT_080ef4e0,*piVar2); - } - this->RecursionDepth = this->RecursionDepth + -1; - iVar1 = this->RecursionDepth; - } - } - return; -} - - - -// DWARF original prototype: void open(TReadScriptFile * this, char * FileName) - -int __thiscall TReadScriptFile::open(TReadScriptFile *this,char *__file,int __oflag,...) - -{ - int iVar1; - char *p; - int iVar2; - char *pcVar3; - char (*__dest) [4096]; - FILE *pFVar4; - int *piVar5; - undefined4 *puVar6; - int ErrorCode; - - iVar1 = this->RecursionDepth; - iVar2 = iVar1 + 1; - this->RecursionDepth = iVar2; - if (iVar2 == 3) { - ::error(&DAT_080ef560); - puVar6 = (undefined4 *)__cxa_allocate_exception(4); - *puVar6 = "Recursion depth too high"; - goto LAB_0804ee56; - } - if ((iVar2 < 1) || (*__file == '/')) { -LAB_0804ee70: - __dest = this->Filename + this->RecursionDepth; - } - else { - strcpy(this->Filename[this->RecursionDepth],this->Filename[iVar1]); - // try { // try from 0804eda1 to 0804ee91 has its CatchHandler @ 0804eea6 - pcVar3 = findLast(this->Filename[this->RecursionDepth],'/'); - if (pcVar3 == (char *)0x0) goto LAB_0804ee70; - __dest = (char (*) [4096])(pcVar3 + 1); - } - strcpy(*__dest,__file); - iVar1 = this->RecursionDepth; - pFVar4 = fopen(this->Filename[this->RecursionDepth],"rb"); - iVar2 = this->RecursionDepth; - this->File[iVar1] = (FILE *)pFVar4; - if (this->File[iVar2] != (FILE *)0x0) { - this->Line[iVar2] = 1; - return 1; - } - piVar5 = __errno_location(); - iVar1 = *piVar5; - ::error(&DAT_080ef520,this->Filename + iVar2); - pcVar3 = strerror(iVar1); - ::error("Fehler %d: %s.\n",iVar1,pcVar3); - this->RecursionDepth = this->RecursionDepth + -1; - puVar6 = (undefined4 *)__cxa_allocate_exception(4); - *puVar6 = "Cannot open script-file"; -LAB_0804ee56: - // WARNING: Subroutine does not return - __cxa_throw(puVar6,char_const*::typeinfo,0); -} - - - -// DWARF original prototype: void close(TReadScriptFile * this) - -int __thiscall TReadScriptFile::close(TReadScriptFile *this,int __fd) - -{ - int iVar1; - int *piVar2; - - iVar1 = this->RecursionDepth; - if (iVar1 != -1) { - iVar1 = fclose((FILE *)this->File[iVar1]); - if (iVar1 != 0) { - piVar2 = __errno_location(); - iVar1 = *piVar2; - ::error(&DAT_080ef4e0,iVar1); - } - this->RecursionDepth = this->RecursionDepth + -1; - return iVar1; - } - ::error("TReadScriptFile::close: Keine Datei offen.\n"); - return iVar1; -} - - - -// DWARF original prototype: void error(TReadScriptFile * this, char * Text) - -void __thiscall TReadScriptFile::error(TReadScriptFile *this,char *Text) - -{ - char *pcVar1; - int iVar2; - int *piVar3; - undefined4 *puVar4; - char *p; - char (*pacVar5) [4096]; - - // try { // try from 0804ef52 to 0804f008 has its CatchHandler @ 0804f020 - pcVar1 = findLast(this->Filename[this->RecursionDepth],'/'); - if (pcVar1 == (char *)0x0) { - iVar2 = this->RecursionDepth; - pacVar5 = this->Filename + iVar2; - } - else { - iVar2 = this->RecursionDepth; - pacVar5 = (char (*) [4096])(pcVar1 + 1); - } - snprintf(ErrorString,100,"error in script-file \"%s\", line %d: %s",pacVar5,this->Line[iVar2], - Text); - iVar2 = this->RecursionDepth; - while (iVar2 != -1) { - iVar2 = fclose((FILE *)this->File[iVar2]); - if (iVar2 != 0) { - piVar3 = __errno_location(); - ::error(&DAT_080ef4e0,*piVar3); - } - this->RecursionDepth = this->RecursionDepth + -1; - iVar2 = this->RecursionDepth; - } - puVar4 = (undefined4 *)__cxa_allocate_exception(4); - *puVar4 = ErrorString; - // WARNING: Subroutine does not return - __cxa_throw(puVar4,char*::typeinfo,0); -} - - - -// WARNING: Variable defined which should be unmapped: pos -// DWARF original prototype: void nextToken(TReadScriptFile * this) - -void __thiscall TReadScriptFile::nextToken(TReadScriptFile *this) - -{ - char *__file; - FILE *__stream; - bool bVar1; - uint uVar2; - int iVar3; - int *piVar4; - int State; - undefined4 uVar5; - int c; - char *pcVar6; - int in_stack_ffffffcc; - int local_1c; - int Sign; - FILE *f; - int pos; - - if (this->RecursionDepth == -1) { - ::error(&DAT_080ef660); -LAB_0804f216: - this->Token = ENDOFFILE; - return; - } - __file = this->String; -LAB_0804f062: - f = (FILE *)0x0; - uVar5 = 0; - uVar2 = 4000; - pcVar6 = __file; - if (((uint)__file & 4) != 0) { - pcVar6 = this->String + 4; - uVar2 = 0xf9c; - this->String[0] = '\0'; - this->String[1] = '\0'; - this->String[2] = '\0'; - this->String[3] = '\0'; - } - for (uVar2 = uVar2 >> 2; uVar2 != 0; uVar2 = uVar2 - 1) { - pcVar6[0] = '\0'; - pcVar6[1] = '\0'; - pcVar6[2] = '\0'; - pcVar6[3] = '\0'; - pcVar6 = pcVar6 + 4; - } - this->Number = 0; - __stream = (FILE *)this->File[this->RecursionDepth]; - local_1c = 1; -LAB_0804f0b6: - if (f == (FILE *)0xf9f) { - error(this,"string too long"); - } - switch(uVar5) { - case 0: - iVar3 = getc(__stream); - if (iVar3 != -1) { - if (iVar3 == 10) { - this->Line[this->RecursionDepth] = this->Line[this->RecursionDepth] + 1; - } - else { - // try { // try from 0804f0f5 to 0804f92b has its CatchHandler @ 0804f931 - bVar1 = isSpace(iVar3); - if (((!bVar1) && (uVar5 = 1, iVar3 != 0x23)) && (uVar5 = 0x1e, iVar3 != 0x40)) { - bVar1 = isAlpha(iVar3); - if (bVar1) { - uVar5 = 2; - this->String[(int)f] = (char)iVar3; - f = (FILE *)((int)&f->_flags + 1); - } - else { - bVar1 = isDigit(iVar3); - if (bVar1) { - this->Number = iVar3 + -0x30; - uVar5 = 3; - } - else { - uVar5 = 6; - if (((iVar3 != 0x22) && (uVar5 = 0xb, iVar3 != 0x5b)) && - ((uVar5 = 0x16, iVar3 != 0x3c && - ((uVar5 = 0x19, iVar3 != 0x3e && (uVar5 = 0x1b, iVar3 != 0x2d)))))) - { - uVar5 = 10; - this->Special = (char)iVar3; - } - } - } - } - } - goto LAB_0804f0b6; - } -LAB_0804f1c2: - iVar3 = this->RecursionDepth; - if (iVar3 < 1) goto LAB_0804f216; - if (iVar3 == -1) { - ::error("TReadScriptFile::close: Keine Datei offen.\n"); - } - else { - iVar3 = fclose((FILE *)this->File[iVar3]); - if (iVar3 != 0) { - piVar4 = __errno_location(); - ::error(&DAT_080ef4e0,*piVar4); - } - this->RecursionDepth = this->RecursionDepth + -1; - } - goto LAB_0804f062; - case 1: - iVar3 = getc(__stream); - if (iVar3 == -1) goto LAB_0804f1c2; - if (iVar3 == 10) { - this->Line[this->RecursionDepth] = this->Line[this->RecursionDepth] + 1; - goto LAB_0804f24a; - } - goto LAB_0804f0b6; - case 2: - iVar3 = getc(__stream); - if (f == (FILE *)0x1e) { - error(this,"identifier too long"); - } - if (iVar3 == -1) { -LAB_0804f2aa: - this->Token = IDENTIFIER; - return; - } - bVar1 = isAlpha(iVar3); - if (((!bVar1) && (bVar1 = isDigit(iVar3), !bVar1)) && (iVar3 != 0x5f)) { - ungetc(iVar3,__stream); - goto LAB_0804f2aa; - } - goto LAB_0804f275; - case 3: - iVar3 = getc(__stream); - if (iVar3 == -1) { -LAB_0804f31a: - this->Token = NUMBER; - return; - } - bVar1 = isDigit(iVar3); - if (bVar1) goto LAB_0804f325; - if (iVar3 != 0x2d) { - ungetc(iVar3,__stream); - goto LAB_0804f31a; - } - goto LAB_0804f2ea; - case 4: - iVar3 = getc(__stream); - if (iVar3 == -1) { - error(this,"unexpected end of file"); - } - bVar1 = isDigit(iVar3); - if (!bVar1) { - error(this,"syntax error"); - goto switchD_0804f0cc_caseD_5; - } - uVar5 = 5; - this->Number = iVar3 + -0x30; - goto LAB_0804f0b6; - case 5: -switchD_0804f0cc_caseD_5: - iVar3 = getc(__stream); - if (iVar3 == -1) { -LAB_0804f3a8: - this->Bytes[(int)(f->_shortbuf + -0x47)] = (uchar)this->Number; - this->Token = BYTES; - return; - } - bVar1 = isDigit(iVar3); - if (bVar1) goto LAB_0804f325; - if (iVar3 != 0x2d) { - ungetc(iVar3,__stream); - goto LAB_0804f3a8; - } -LAB_0804f2ea: - this->Bytes[(int)(f->_shortbuf + -0x47)] = (uchar)this->Number; - f = (FILE *)((int)&f->_flags + 1); - uVar5 = 4; - goto LAB_0804f0b6; - case 6: - iVar3 = getc(__stream); - if (iVar3 == -1) { - error(this,"unexpected end of file"); - } - if (iVar3 == 0x22) { - uVar5 = 8; - } - else if (iVar3 == 0x5c) { - uVar5 = 7; - } - else { - if (iVar3 == 10) { - this->Line[this->RecursionDepth] = this->Line[this->RecursionDepth] + 1; - } -LAB_0804f275: - this->String[(int)f] = (char)iVar3; - f = (FILE *)((int)&f->_flags + 1); - } - goto LAB_0804f0b6; - case 7: - iVar3 = getc(__stream); - if (iVar3 == -1) { - error(this,"unexpected end of file"); - } - if (iVar3 == 0x6e) { - this->String[(int)f] = '\n'; - } - else { - this->String[(int)f] = (char)iVar3; - } - f = (FILE *)((int)&f->_flags + 1); - uVar5 = 6; - goto LAB_0804f0b6; - case 8: - this->Token = STRING; - return; - default: - ::error(&DAT_080ef620); -LAB_0804f24a: - uVar5 = 0; - goto LAB_0804f0b6; - case 10: - break; - case 0xb: - iVar3 = getc(__stream); - this->Special = '['; - if (iVar3 == -1) break; - bVar1 = isDigit(iVar3); - if (bVar1) { - local_1c = 1; - this->Number = iVar3 + -0x30; - } - else { - if (iVar3 != 0x2d) goto LAB_0804f507; - local_1c = -1; - this->Number = 0; - } - uVar5 = 0xc; - goto LAB_0804f0b6; - case 0xc: - iVar3 = getc(__stream); - if (iVar3 == -1) { - error(this,"unexpected end of file"); - } - bVar1 = isDigit(iVar3); - if (bVar1) goto LAB_0804f325; - if (iVar3 != 0x2c) { - error(this,"syntax error"); - goto switchD_0804f0cc_caseD_d; - } - uVar5 = 0xd; - this->CoordX = local_1c * this->Number; - goto LAB_0804f0b6; - case 0xd: -switchD_0804f0cc_caseD_d: - iVar3 = getc(__stream); - if (iVar3 == -1) { - error(this,"unexpected end of file"); - } - bVar1 = isDigit(iVar3); - if (bVar1) { - local_1c = 1; - this->Number = iVar3 + -0x30; - } - else { - if (iVar3 != 0x2d) { - error(this,"syntax error"); - goto switchD_0804f0cc_caseD_e; - } - local_1c = -1; - this->Number = 0; - } - uVar5 = 0xe; - goto LAB_0804f0b6; - case 0xe: -switchD_0804f0cc_caseD_e: - iVar3 = getc(__stream); - if (iVar3 == -1) { - error(this,"unexpected end of file"); - } - bVar1 = isDigit(iVar3); - if (bVar1) goto LAB_0804f325; - if (iVar3 != 0x2c) { - error(this,"syntax error"); - goto switchD_0804f0cc_caseD_f; - } - uVar5 = 0xf; - this->CoordY = local_1c * this->Number; - goto LAB_0804f0b6; - case 0xf: -switchD_0804f0cc_caseD_f: - iVar3 = getc(__stream); - if (iVar3 == -1) { - error(this,"unexpected end of file"); - } - bVar1 = isDigit(iVar3); - if (bVar1) { - local_1c = 1; - this->Number = iVar3 + -0x30; - } - else { - if (iVar3 != 0x2d) { - error(this,"syntax error"); - goto switchD_0804f0cc_caseD_10; - } - local_1c = -1; - this->Number = 0; - } - uVar5 = 0x10; - goto LAB_0804f0b6; - case 0x10: -switchD_0804f0cc_caseD_10: - iVar3 = getc(__stream); - if (iVar3 == -1) { - error(this,"unexpected end of file"); - } - bVar1 = isDigit(iVar3); - if (bVar1) { -LAB_0804f325: - this->Number = iVar3 + -0x30 + this->Number * 10; - } - else { - if (iVar3 != 0x5d) { - error(this,"syntax error"); -switchD_0804f0cc_caseD_11: - this->Token = COORDINATE; - return; - } - uVar5 = 0x11; - this->CoordZ = local_1c * this->Number; - } - goto LAB_0804f0b6; - case 0x11: - goto switchD_0804f0cc_caseD_11; - case 0x16: - iVar3 = getc(__stream); - this->Special = '<'; - if (iVar3 == -1) break; - uVar5 = 0x17; - if ((iVar3 != 0x3d) && (uVar5 = 0x18, iVar3 != 0x3e)) goto LAB_0804f507; - goto LAB_0804f0b6; - case 0x17: - this->Special = 'L'; - break; - case 0x18: - this->Special = 'N'; - break; - case 0x19: - iVar3 = getc(__stream); - this->Special = '>'; - if (iVar3 == -1) break; - uVar5 = 0x1a; - if (iVar3 != 0x3d) goto LAB_0804f507; - goto LAB_0804f0b6; - case 0x1a: - this->Special = 'G'; - break; - case 0x1b: - iVar3 = getc(__stream); - this->Special = '-'; - if (iVar3 == -1) break; - uVar5 = 0x1c; - if (iVar3 == 0x3e) goto LAB_0804f0b6; -LAB_0804f507: - ungetc(iVar3,__stream); - break; - case 0x1c: - this->Special = 'I'; - break; - case 0x1e: - iVar3 = getc(__stream); - if (iVar3 == -1) { - error(this,"unexpected end of file"); - } - if (iVar3 != 0x22) { - error(this,"syntax error"); - goto switchD_0804f0cc_caseD_1f; - } - uVar5 = 0x1f; - goto LAB_0804f0b6; - case 0x1f: -switchD_0804f0cc_caseD_1f: - iVar3 = getc(__stream); - if (iVar3 == -1) { - error(this,"unexpected end of file"); - } - if (iVar3 != 0x22) goto LAB_0804f275; - uVar5 = 0x20; - goto LAB_0804f0b6; - case 0x20: - goto switchD_0804f0cc_caseD_20; - } - this->Token = SPECIAL; - return; -switchD_0804f0cc_caseD_20: - open(this,__file,in_stack_ffffffcc); - goto LAB_0804f062; -} - - - -// DWARF original prototype: char * readIdentifier(TReadScriptFile * this) - -char * __thiscall TReadScriptFile::readIdentifier(TReadScriptFile *this) - -{ - // try { // try from 0804f95f to 0804f978 has its CatchHandler @ 0804f9b8 - nextToken(this); - if (this->Token != IDENTIFIER) { - error(this,"identifier expected"); - } - if (this->Token != IDENTIFIER) { - // try { // try from 0804f989 to 0804f99b has its CatchHandler @ 0804f9a5 - error(this,"identifier expected"); - } - strLower(this->String); - return this->String; -} - - - -// DWARF original prototype: int readNumber(TReadScriptFile * this) - -int __thiscall TReadScriptFile::readNumber(TReadScriptFile *this) - -{ - TOKEN TVar1; - int sgn; - int iVar2; - - // try { // try from 0804f9e2 to 0804fa07 has its CatchHandler @ 0804fa70 - nextToken(this); - TVar1 = this->Token; - iVar2 = 1; - if ((TVar1 == SPECIAL) && (this->Special == '-')) { - iVar2 = -1; - // try { // try from 0804fa46 to 0804fa4a has its CatchHandler @ 0804fa70 - nextToken(this); - TVar1 = this->Token; - } - if (TVar1 != NUMBER) { - error(this,"number expected"); - } - if (this->Token != NUMBER) { - // try { // try from 0804fa18 to 0804fa1c has its CatchHandler @ 0804fa4f - error(this,"number expected"); - } - return iVar2 * this->Number; -} - - - -// DWARF original prototype: char * readString(TReadScriptFile * this) - -char * __thiscall TReadScriptFile::readString(TReadScriptFile *this) - -{ - // try { // try from 0804fa8f to 0804faa8 has its CatchHandler @ 0804fae0 - nextToken(this); - if (this->Token != STRING) { - error(this,"string expected"); - } - if (this->Token != STRING) { - // try { // try from 0804fab9 to 0804fabd has its CatchHandler @ 0804facb - error(this,"string expected"); - } - return this->String; -} - - - -// DWARF original prototype: uchar * readBytesequence(TReadScriptFile * this) - -uchar * __thiscall TReadScriptFile::readBytesequence(TReadScriptFile *this) - -{ - // try { // try from 0804faff to 0804fb18 has its CatchHandler @ 0804fb50 - nextToken(this); - if (this->Token != BYTES) { - error(this,"byte-sequence expected"); - } - if (this->Token != BYTES) { - // try { // try from 0804fb29 to 0804fb2d has its CatchHandler @ 0804fb3b - error(this,"byte-sequence expected"); - } - return this->Bytes; -} - - - -// DWARF original prototype: void readCoordinate(TReadScriptFile * this, int * x, int * y, int * z) - -void __thiscall TReadScriptFile::readCoordinate(TReadScriptFile *this) - -{ - int *in_stack_00000008; - int *in_stack_0000000c; - int *in_stack_00000010; - - // try { // try from 0804fb6f to 0804fb88 has its CatchHandler @ 0804fbe0 - nextToken(this); - if (this->Token != COORDINATE) { - error(this,"coordinates expected"); - } - if (this->Token != COORDINATE) { - // try { // try from 0804fb99 to 0804fb9d has its CatchHandler @ 0804fbc6 - error(this,"coordinates expected"); - } - *in_stack_00000008 = this->CoordX; - *in_stack_0000000c = this->CoordY; - *in_stack_00000010 = this->CoordZ; - return; -} - - - -// DWARF original prototype: char readSpecial(TReadScriptFile * this) - -char __thiscall TReadScriptFile::readSpecial(TReadScriptFile *this) - -{ - // try { // try from 0804fbff to 0804fc18 has its CatchHandler @ 0804fc50 - nextToken(this); - if (this->Token != SPECIAL) { - error(this,"special-char expected"); - } - if (this->Token != SPECIAL) { - // try { // try from 0804fc29 to 0804fc2d has its CatchHandler @ 0804fc3c - error(this,"special-char expected"); - } - return this->Special; -} - - - -// WARNING: Variable defined which should be unmapped: Symbol_local -// DWARF original prototype: void readSymbol(TReadScriptFile * this, char Symbol) - -void __thiscall TReadScriptFile::readSymbol(TReadScriptFile *this,char Symbol) - -{ - char Symbol_local; - - // try { // try from 0804fc76 to 0804fc8f has its CatchHandler @ 0804fcf0 - nextToken(this); - if (this->Token != SPECIAL) { - error(this,"special-char expected"); - if (this->Token != SPECIAL) { - // try { // try from 0804fca0 to 0804fca4 has its CatchHandler @ 0804fcd3 - error(this,"special-char expected"); - } - } - if (Symbol != this->Special) { - // try { // try from 0804fcc7 to 0804fccb has its CatchHandler @ 0804fcf0 - error(this,"special-char expected"); - } - return; -} - - - -// DWARF original prototype: char * getIdentifier(TReadScriptFile * this) - -char * __thiscall TReadScriptFile::getIdentifier(TReadScriptFile *this) - -{ - if (this->Token != IDENTIFIER) { - // try { // try from 0804fd1c to 0804fd2e has its CatchHandler @ 0804fd38 - error(this,"identifier expected"); - } - strLower(this->String); - return this->String; -} - - - -// DWARF original prototype: int getNumber(TReadScriptFile * this) - -int __thiscall TReadScriptFile::getNumber(TReadScriptFile *this) - -{ - if (this->Token != NUMBER) { - // try { // try from 0804fd6c to 0804fd70 has its CatchHandler @ 0804fd80 - error(this,"number expected"); - } - return this->Number; -} - - - -// DWARF original prototype: char * getString(TReadScriptFile * this) - -char * __thiscall TReadScriptFile::getString(TReadScriptFile *this) - -{ - if (this->Token != STRING) { - // try { // try from 0804fdbc to 0804fdc0 has its CatchHandler @ 0804fdd0 - error(this,"string expected"); - } - return this->String; -} - - - -// DWARF original prototype: uchar * getBytesequence(TReadScriptFile * this) - -uchar * __thiscall TReadScriptFile::getBytesequence(TReadScriptFile *this) - -{ - if (this->Token != BYTES) { - // try { // try from 0804fe0c to 0804fe10 has its CatchHandler @ 0804fe20 - error(this,"byte-sequence expected"); - } - return this->Bytes; -} - - - -// DWARF original prototype: void getCoordinate(TReadScriptFile * this, int * x, int * y, int * z) - -void __thiscall TReadScriptFile::getCoordinate(TReadScriptFile *this) - -{ - int *in_stack_00000008; - int *in_stack_0000000c; - int *in_stack_00000010; - - if (this->Token != COORDINATE) { - // try { // try from 0804fe5c to 0804fe60 has its CatchHandler @ 0804fe90 - error(this,"coordinates expected"); - } - *in_stack_00000008 = this->CoordX; - *in_stack_0000000c = this->CoordY; - *in_stack_00000010 = this->CoordZ; - return; -} - - - -// DWARF original prototype: char getSpecial(TReadScriptFile * this) - -char __thiscall TReadScriptFile::getSpecial(TReadScriptFile *this) - -{ - if (this->Token != SPECIAL) { - // try { // try from 0804fecc to 0804fed0 has its CatchHandler @ 0804fee0 - error(this,"special-char expected"); - } - return this->Special; -} - - - // DWARF original prototype: void TWriteScriptFile(TWriteScriptFile * this) void __thiscall TWriteScriptFile::TWriteScriptFile(TWriteScriptFile *this) -- cgit v1.2.3