Kaydet (Commit) ed27d98c authored tarafından Oliver Bolte's avatar Oliver Bolte

INTEGRATION: CWS sb59 (1.29.12); FILE MERGED

2006/08/11 15:04:30 sb 1.29.12.1: #i67487# Made code warning-free (wntmsci10).
üst 7e3ad182
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
* *
* $RCSfile: runtime.cxx,v $ * $RCSfile: runtime.cxx,v $
* *
* $Revision: 1.30 $ * $Revision: 1.31 $
* *
* last change: $Author: obo $ $Date: 2006-09-17 10:05:55 $ * last change: $Author: obo $ $Date: 2006-10-12 14:30:29 $
* *
* The Contents of this file are made available subject to * The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1. * the terms of GNU Lesser General Public License Version 2.1.
...@@ -65,9 +65,6 @@ ...@@ -65,9 +65,6 @@
#endif #endif
#include "sbunoobj.hxx" #include "sbunoobj.hxx"
// Makro MEMBER()
#include <macfix.hxx>
bool SbiRuntime::isVBAEnabled() bool SbiRuntime::isVBAEnabled()
{ {
bool result = false; bool result = false;
...@@ -93,124 +90,124 @@ struct SbiArgvStack { // Argv stack: ...@@ -93,124 +90,124 @@ struct SbiArgvStack { // Argv stack:
}; };
SbiRuntime::pStep0 SbiRuntime::aStep0[] = { // Alle Opcodes ohne Operanden SbiRuntime::pStep0 SbiRuntime::aStep0[] = { // Alle Opcodes ohne Operanden
MEMBER(SbiRuntime::StepNOP), &SbiRuntime::StepNOP,
MEMBER(SbiRuntime::StepEXP), &SbiRuntime::StepEXP,
MEMBER(SbiRuntime::StepMUL), &SbiRuntime::StepMUL,
MEMBER(SbiRuntime::StepDIV), &SbiRuntime::StepDIV,
MEMBER(SbiRuntime::StepMOD), &SbiRuntime::StepMOD,
MEMBER(SbiRuntime::StepPLUS), &SbiRuntime::StepPLUS,
MEMBER(SbiRuntime::StepMINUS), &SbiRuntime::StepMINUS,
MEMBER(SbiRuntime::StepNEG), &SbiRuntime::StepNEG,
MEMBER(SbiRuntime::StepEQ), &SbiRuntime::StepEQ,
MEMBER(SbiRuntime::StepNE), &SbiRuntime::StepNE,
MEMBER(SbiRuntime::StepLT), &SbiRuntime::StepLT,
MEMBER(SbiRuntime::StepGT), &SbiRuntime::StepGT,
MEMBER(SbiRuntime::StepLE), &SbiRuntime::StepLE,
MEMBER(SbiRuntime::StepGE), &SbiRuntime::StepGE,
MEMBER(SbiRuntime::StepIDIV), &SbiRuntime::StepIDIV,
MEMBER(SbiRuntime::StepAND), &SbiRuntime::StepAND,
MEMBER(SbiRuntime::StepOR), &SbiRuntime::StepOR,
MEMBER(SbiRuntime::StepXOR), &SbiRuntime::StepXOR,
MEMBER(SbiRuntime::StepEQV), &SbiRuntime::StepEQV,
MEMBER(SbiRuntime::StepIMP), &SbiRuntime::StepIMP,
MEMBER(SbiRuntime::StepNOT), &SbiRuntime::StepNOT,
MEMBER(SbiRuntime::StepCAT), &SbiRuntime::StepCAT,
MEMBER(SbiRuntime::StepLIKE), &SbiRuntime::StepLIKE,
MEMBER(SbiRuntime::StepIS), &SbiRuntime::StepIS,
// Laden/speichern // Laden/speichern
MEMBER(SbiRuntime::StepARGC), // neuen Argv einrichten &SbiRuntime::StepARGC, // neuen Argv einrichten
MEMBER(SbiRuntime::StepARGV), // TOS ==> aktueller Argv &SbiRuntime::StepARGV, // TOS ==> aktueller Argv
MEMBER(SbiRuntime::StepINPUT), // Input ==> TOS &SbiRuntime::StepINPUT, // Input ==> TOS
MEMBER(SbiRuntime::StepLINPUT), // Line Input ==> TOS &SbiRuntime::StepLINPUT, // Line Input ==> TOS
MEMBER(SbiRuntime::StepGET), // TOS anfassen &SbiRuntime::StepGET, // TOS anfassen
MEMBER(SbiRuntime::StepSET), // Speichern Objekt TOS ==> TOS-1 &SbiRuntime::StepSET, // Speichern Objekt TOS ==> TOS-1
MEMBER(SbiRuntime::StepPUT), // TOS ==> TOS-1 &SbiRuntime::StepPUT, // TOS ==> TOS-1
MEMBER(SbiRuntime::StepPUTC), // TOS ==> TOS-1, dann ReadOnly &SbiRuntime::StepPUTC, // TOS ==> TOS-1, dann ReadOnly
MEMBER(SbiRuntime::StepDIM), // DIM &SbiRuntime::StepDIM, // DIM
MEMBER(SbiRuntime::StepREDIM), // REDIM &SbiRuntime::StepREDIM, // REDIM
MEMBER(SbiRuntime::StepREDIMP), // REDIM PRESERVE &SbiRuntime::StepREDIMP, // REDIM PRESERVE
MEMBER(SbiRuntime::StepERASE), // TOS loeschen &SbiRuntime::StepERASE, // TOS loeschen
// Verzweigen // Verzweigen
MEMBER(SbiRuntime::StepSTOP), // Programmende &SbiRuntime::StepSTOP, // Programmende
MEMBER(SbiRuntime::StepINITFOR), // FOR-Variable initialisieren &SbiRuntime::StepINITFOR, // FOR-Variable initialisieren
MEMBER(SbiRuntime::StepNEXT), // FOR-Variable inkrementieren &SbiRuntime::StepNEXT, // FOR-Variable inkrementieren
MEMBER(SbiRuntime::StepCASE), // Anfang CASE &SbiRuntime::StepCASE, // Anfang CASE
MEMBER(SbiRuntime::StepENDCASE), // Ende CASE &SbiRuntime::StepENDCASE, // Ende CASE
MEMBER(SbiRuntime::StepSTDERROR), // Standard-Fehlerbehandlung &SbiRuntime::StepSTDERROR, // Standard-Fehlerbehandlung
MEMBER(SbiRuntime::StepNOERROR), // keine Fehlerbehandlung &SbiRuntime::StepNOERROR, // keine Fehlerbehandlung
MEMBER(SbiRuntime::StepLEAVE), // UP verlassen &SbiRuntime::StepLEAVE, // UP verlassen
// E/A // E/A
MEMBER(SbiRuntime::StepCHANNEL), // TOS = Kanalnummer &SbiRuntime::StepCHANNEL, // TOS = Kanalnummer
MEMBER(SbiRuntime::StepPRINT), // print TOS &SbiRuntime::StepPRINT, // print TOS
MEMBER(SbiRuntime::StepPRINTF), // print TOS in field &SbiRuntime::StepPRINTF, // print TOS in field
MEMBER(SbiRuntime::StepWRITE), // write TOS &SbiRuntime::StepWRITE, // write TOS
MEMBER(SbiRuntime::StepRENAME), // Rename Tos+1 to Tos &SbiRuntime::StepRENAME, // Rename Tos+1 to Tos
MEMBER(SbiRuntime::StepPROMPT), // Input Prompt aus TOS definieren &SbiRuntime::StepPROMPT, // Input Prompt aus TOS definieren
MEMBER(SbiRuntime::StepRESTART), // Set restart point &SbiRuntime::StepRESTART, // Set restart point
MEMBER(SbiRuntime::StepCHANNEL0), // E/A-Kanal 0 einstellen &SbiRuntime::StepCHANNEL0, // E/A-Kanal 0 einstellen
MEMBER(SbiRuntime::StepEMPTY), // Leeren Ausdruck auf Stack &SbiRuntime::StepEMPTY, // Leeren Ausdruck auf Stack
MEMBER(SbiRuntime::StepERROR), // TOS = Fehlercode &SbiRuntime::StepERROR, // TOS = Fehlercode
MEMBER(SbiRuntime::StepLSET), // Speichern Objekt TOS ==> TOS-1 &SbiRuntime::StepLSET, // Speichern Objekt TOS ==> TOS-1
MEMBER(SbiRuntime::StepRSET), // Speichern Objekt TOS ==> TOS-1 &SbiRuntime::StepRSET, // Speichern Objekt TOS ==> TOS-1
MEMBER(SbiRuntime::StepREDIMP_ERASE),// Copy array object for REDIMP &SbiRuntime::StepREDIMP_ERASE,// Copy array object for REDIMP
MEMBER(SbiRuntime::StepINITFOREACH),// Init for each loop &SbiRuntime::StepINITFOREACH,// Init for each loop
}; };
SbiRuntime::pStep1 SbiRuntime::aStep1[] = { // Alle Opcodes mit einem Operanden SbiRuntime::pStep1 SbiRuntime::aStep1[] = { // Alle Opcodes mit einem Operanden
MEMBER(SbiRuntime::StepLOADNC), // Laden einer numerischen Konstanten (+ID) &SbiRuntime::StepLOADNC, // Laden einer numerischen Konstanten (+ID)
MEMBER(SbiRuntime::StepLOADSC), // Laden einer Stringkonstanten (+ID) &SbiRuntime::StepLOADSC, // Laden einer Stringkonstanten (+ID)
MEMBER(SbiRuntime::StepLOADI), // Immediate Load (+Wert) &SbiRuntime::StepLOADI, // Immediate Load (+Wert)
MEMBER(SbiRuntime::StepARGN), // Speichern eines named Args in Argv (+StringID) &SbiRuntime::StepARGN, // Speichern eines named Args in Argv (+StringID)
MEMBER(SbiRuntime::StepPAD), // String auf feste Laenge bringen (+Laenge) &SbiRuntime::StepPAD, // String auf feste Laenge bringen (+Laenge)
// Verzweigungen // Verzweigungen
MEMBER(SbiRuntime::StepJUMP), // Sprung (+Target) &SbiRuntime::StepJUMP, // Sprung (+Target)
MEMBER(SbiRuntime::StepJUMPT), // TOS auswerten), bedingter Sprung (+Target) &SbiRuntime::StepJUMPT, // TOS auswerten), bedingter Sprung (+Target)
MEMBER(SbiRuntime::StepJUMPF), // TOS auswerten), bedingter Sprung (+Target) &SbiRuntime::StepJUMPF, // TOS auswerten), bedingter Sprung (+Target)
MEMBER(SbiRuntime::StepONJUMP), // TOS auswerten), Sprung in JUMP-Tabelle (+MaxVal) &SbiRuntime::StepONJUMP, // TOS auswerten), Sprung in JUMP-Tabelle (+MaxVal)
MEMBER(SbiRuntime::StepGOSUB), // UP-Aufruf (+Target) &SbiRuntime::StepGOSUB, // UP-Aufruf (+Target)
MEMBER(SbiRuntime::StepRETURN), // UP-Return (+0 oder Target) &SbiRuntime::StepRETURN, // UP-Return (+0 oder Target)
MEMBER(SbiRuntime::StepTESTFOR), // FOR-Variable testen), inkrementieren (+Endlabel) &SbiRuntime::StepTESTFOR, // FOR-Variable testen), inkrementieren (+Endlabel)
MEMBER(SbiRuntime::StepCASETO), // Tos+1 <= Case <= Tos), 2xremove (+Target) &SbiRuntime::StepCASETO, // Tos+1 <= Case <= Tos), 2xremove (+Target)
MEMBER(SbiRuntime::StepERRHDL), // Fehler-Handler (+Offset) &SbiRuntime::StepERRHDL, // Fehler-Handler (+Offset)
MEMBER(SbiRuntime::StepRESUME), // Resume nach Fehlern (+0 or 1 or Label) &SbiRuntime::StepRESUME, // Resume nach Fehlern (+0 or 1 or Label)
// E/A // E/A
MEMBER(SbiRuntime::StepCLOSE), // (+Kanal/0) &SbiRuntime::StepCLOSE, // (+Kanal/0)
MEMBER(SbiRuntime::StepPRCHAR), // (+char) &SbiRuntime::StepPRCHAR, // (+char)
// Verwaltung // Verwaltung
MEMBER(SbiRuntime::StepSETCLASS), // Set + Klassennamen testen (+StringId) &SbiRuntime::StepSETCLASS, // Set + Klassennamen testen (+StringId)
MEMBER(SbiRuntime::StepTESTCLASS), // Check TOS class (+StringId) &SbiRuntime::StepTESTCLASS, // Check TOS class (+StringId)
MEMBER(SbiRuntime::StepLIB), // Lib fuer Declare-Call (+StringId) &SbiRuntime::StepLIB, // Lib fuer Declare-Call (+StringId)
MEMBER(SbiRuntime::StepBASED), // TOS wird um BASE erhoeht, BASE davor gepusht &SbiRuntime::StepBASED, // TOS wird um BASE erhoeht, BASE davor gepusht
MEMBER(SbiRuntime::StepARGTYP), // Letzten Parameter in Argv konvertieren (+Typ) &SbiRuntime::StepARGTYP, // Letzten Parameter in Argv konvertieren (+Typ)
}; };
SbiRuntime::pStep2 SbiRuntime::aStep2[] = {// Alle Opcodes mit zwei Operanden SbiRuntime::pStep2 SbiRuntime::aStep2[] = {// Alle Opcodes mit zwei Operanden
MEMBER(SbiRuntime::StepRTL), // Laden aus RTL (+StringID+Typ) &SbiRuntime::StepRTL, // Laden aus RTL (+StringID+Typ)
MEMBER(SbiRuntime::StepFIND), // Laden (+StringID+Typ) &SbiRuntime::StepFIND, // Laden (+StringID+Typ)
MEMBER(SbiRuntime::StepELEM), // Laden Element (+StringID+Typ) &SbiRuntime::StepELEM, // Laden Element (+StringID+Typ)
MEMBER(SbiRuntime::StepPARAM), // Parameter (+Offset+Typ) &SbiRuntime::StepPARAM, // Parameter (+Offset+Typ)
// Verzweigen // Verzweigen
MEMBER(SbiRuntime::StepCALL), // Declare-Call (+StringID+Typ) &SbiRuntime::StepCALL, // Declare-Call (+StringID+Typ)
MEMBER(SbiRuntime::StepCALLC), // CDecl-Declare-Call (+StringID+Typ) &SbiRuntime::StepCALLC, // CDecl-Declare-Call (+StringID+Typ)
MEMBER(SbiRuntime::StepCASEIS), // Case-Test (+Test-Opcode+False-Target) &SbiRuntime::StepCASEIS, // Case-Test (+Test-Opcode+False-Target)
// Verwaltung // Verwaltung
MEMBER(SbiRuntime::StepSTMNT), // Beginn eines Statements (+Line+Col) &SbiRuntime::StepSTMNT, // Beginn eines Statements (+Line+Col)
// E/A // E/A
MEMBER(SbiRuntime::StepOPEN), // (+SvStreamFlags+Flags) &SbiRuntime::StepOPEN, // (+SvStreamFlags+Flags)
// Objekte // Objekte
MEMBER(SbiRuntime::StepLOCAL), // Lokale Variable definieren (+StringId+Typ) &SbiRuntime::StepLOCAL, // Lokale Variable definieren (+StringId+Typ)
MEMBER(SbiRuntime::StepPUBLIC), // Modulglobale Variable (+StringID+Typ) &SbiRuntime::StepPUBLIC, // Modulglobale Variable (+StringID+Typ)
MEMBER(SbiRuntime::StepGLOBAL), // Globale Variable definieren (+StringID+Typ) &SbiRuntime::StepGLOBAL, // Globale Variable definieren (+StringID+Typ)
MEMBER(SbiRuntime::StepCREATE), // Objekt kreieren (+StringId+StringId) &SbiRuntime::StepCREATE, // Objekt kreieren (+StringId+StringId)
MEMBER(SbiRuntime::StepSTATIC), // Statische Variable (+StringId+StringId) &SbiRuntime::StepSTATIC, // Statische Variable (+StringId+StringId)
MEMBER(SbiRuntime::StepTCREATE), // User Defined Objekte (+StringId+StringId) &SbiRuntime::StepTCREATE, // User Defined Objekte (+StringId+StringId)
MEMBER(SbiRuntime::StepDCREATE), // Objekt-Array kreieren (+StringID+StringID) &SbiRuntime::StepDCREATE, // Objekt-Array kreieren (+StringID+StringID)
MEMBER(SbiRuntime::StepGLOBAL_P), // Globale Variable definieren, die beim Neustart &SbiRuntime::StepGLOBAL_P, // Globale Variable definieren, die beim Neustart
// von Basic nicht ueberschrieben wird (+StringID+Typ) // von Basic nicht ueberschrieben wird (+StringID+Typ)
MEMBER(SbiRuntime::StepFIND_G), // Sucht globale Variable mit Spezialbehandlung wegen _GLOBAL_P &SbiRuntime::StepFIND_G, // Sucht globale Variable mit Spezialbehandlung wegen _GLOBAL_P
MEMBER(SbiRuntime::StepDCREATE_REDIMP), // Objekt-Array redimensionieren (+StringID+StringID) &SbiRuntime::StepDCREATE_REDIMP, // Objekt-Array redimensionieren (+StringID+StringID)
MEMBER(SbiRuntime::StepFIND_CM), // Search inside a class module (CM) to enable global search in time &SbiRuntime::StepFIND_CM, // Search inside a class module (CM) to enable global search in time
}; };
...@@ -523,14 +520,14 @@ SbiRuntime::SbiRuntime( SbModule* pm, SbMethod* pe, USHORT nStart ) ...@@ -523,14 +520,14 @@ SbiRuntime::SbiRuntime( SbModule* pm, SbMethod* pe, USHORT nStart )
bError = TRUE; bError = TRUE;
bInError = FALSE; bInError = FALSE;
bBlocked = FALSE; bBlocked = FALSE;
nLine = nLine = 0;
nCol1 = nCol1 = 0;
nCol2 = nCol2 = 0;
nExprLvl = nExprLvl = 0;
nArgc = nArgc = 0;
nError = nError = 0;
nGosubLvl = nGosubLvl = 0;
nForLvl = nForLvl = 0;
nOps = 0; nOps = 0;
refExprStk = new SbxArray; refExprStk = new SbxArray;
#if defined GCC #if defined GCC
...@@ -770,8 +767,9 @@ BOOL SbiRuntime::Step() ...@@ -770,8 +767,9 @@ BOOL SbiRuntime::Step()
// Nach RT mit Error-Handler aufhoeren // Nach RT mit Error-Handler aufhoeren
if( pRt == pRtErrHdl ) if( pRt == pRtErrHdl )
break; break;
pRt = pRt->pNext;
} }
while( (pRt = pRt->pNext) ); while( pRt );
} }
// Kein Error-Hdl gefunden -> altes Vorgehen // Kein Error-Hdl gefunden -> altes Vorgehen
else else
......
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