summaryrefslogtreecommitdiff
path: root/basic/source/inc
diff options
context:
space:
mode:
authorAllmann-Rahn <allmann-rahn@ubuntu.ubuntu-domain>2011-08-27 21:37:14 +0200
committerTor Lillqvist <tlillqvist@novell.com>2011-08-31 16:29:43 +0300
commit8b11173f34bcbd5c27c1842e65ef3ab91bb24019 (patch)
tree2caad5d1b7c1f2a6a7eca933b420c0e352be088a /basic/source/inc
parent930e38e16329e4a81dc2dcf185d44a752fbfbf7f (diff)
Translated German comments, removed redundant ones till cairo (incl.)
Diffstat (limited to 'basic/source/inc')
-rw-r--r--basic/source/inc/buffer.hxx42
-rw-r--r--basic/source/inc/codegen.hxx18
-rw-r--r--basic/source/inc/collelem.hxx8
-rw-r--r--basic/source/inc/disas.hxx18
-rw-r--r--basic/source/inc/expr.hxx134
-rw-r--r--basic/source/inc/filefmt.hxx192
-rw-r--r--basic/source/inc/image.hxx62
-rw-r--r--basic/source/inc/iosys.hxx41
-rw-r--r--basic/source/inc/object.hxx50
-rw-r--r--basic/source/inc/opcodes.hxx150
-rw-r--r--basic/source/inc/parser.hxx82
-rw-r--r--basic/source/inc/runtime.hxx179
-rw-r--r--basic/source/inc/sbcomp.hxx10
-rw-r--r--basic/source/inc/sbintern.hxx36
-rw-r--r--basic/source/inc/sbjsmeth.hxx6
-rw-r--r--basic/source/inc/sbjsmod.hxx8
-rw-r--r--basic/source/inc/sbunoobj.hxx31
-rw-r--r--basic/source/inc/scanner.hxx63
-rw-r--r--basic/source/inc/symtbl.hxx123
-rw-r--r--basic/source/inc/token.hxx56
20 files changed, 651 insertions, 658 deletions
diff --git a/basic/source/inc/buffer.hxx b/basic/source/inc/buffer.hxx
index 24c4bc002f60..db4d5c813194 100644
--- a/basic/source/inc/buffer.hxx
+++ b/basic/source/inc/buffer.hxx
@@ -34,29 +34,29 @@
class SbiParser;
-class SbiBuffer { // Code/Konstanten-Puffer:
- SbiParser* pParser; // fuer Fehlermeldungen
- char* pBuf; // Puffer-Pointer
- char* pCur; // aktueller Puffer-Pointer
- sal_uInt32 nOff; // aktuelles Offset
- sal_uInt32 nSize; // aktuelle Groesse
- short nInc; // Inkrement
- sal_Bool Check( sal_uInt16 ); // Buffergroesse testen
+class SbiBuffer {
+ SbiParser* pParser; // for error messages
+ char* pBuf;
+ char* pCur;
+ sal_uInt32 nOff;
+ sal_uInt32 nSize;
+ short nInc;
+ sal_Bool Check( sal_uInt16 );
public:
- SbiBuffer( SbiParser*, short ); // Inkrement
+ SbiBuffer( SbiParser*, short ); // increment
~SbiBuffer();
- void Patch( sal_uInt32, sal_uInt32 ); // Patchen
- void Chain( sal_uInt32 ); // Back-Chain
- void Align( sal_Int32 ); // Alignment
- sal_Bool Add( const void*, sal_uInt16 );// Element anfuegen
- sal_Bool operator += (const String&);// Basic-String speichern
- sal_Bool operator += (sal_Int8); // Zeichen speichern
- sal_Bool operator += (sal_Int16); // Integer speichern
- sal_Bool operator += (sal_uInt8); // Zeichen speichern
- sal_Bool operator += (sal_uInt16); // Integer speichern
- sal_Bool operator += (sal_uInt32); // Integer speichern
- sal_Bool operator += (sal_Int32); // Integer speichern
- char* GetBuffer(); // Puffer rausgeben (selbst loeschen!)
+ void Patch( sal_uInt32, sal_uInt32 );
+ void Chain( sal_uInt32 );
+ void Align( sal_Int32 );
+ sal_Bool Add( const void*, sal_uInt16 );
+ sal_Bool operator += (const String&); // save basic-string
+ sal_Bool operator += (sal_Int8); // save character
+ sal_Bool operator += (sal_Int16); // save integer
+ sal_Bool operator += (sal_uInt8); // save character
+ sal_Bool operator += (sal_uInt16); // save integer
+ sal_Bool operator += (sal_uInt32); // save integer
+ sal_Bool operator += (sal_Int32); // save integer
+ char* GetBuffer(); // give out buffer (delete yourself!)
char* GetBufferPtr(){ return pBuf; }
sal_uInt32 GetSize() { return nOff; }
};
diff --git a/basic/source/inc/codegen.hxx b/basic/source/inc/codegen.hxx
index 0f5699803945..ced319c4ce22 100644
--- a/basic/source/inc/codegen.hxx
+++ b/basic/source/inc/codegen.hxx
@@ -35,13 +35,13 @@ class SbModule;
#include "opcodes.hxx"
#include "buffer.hxx"
-class SbiCodeGen { // Code-Erzeugung:
- SbiParser* pParser; // fuer Fehlermeldungen, Line, Column etc.
- SbModule& rMod; // aktuelles Modul
- SbiBuffer aCode; // Code-Puffer
- short nLine, nCol; // Zeile, Spalte fuer Stmnt-Befehl
- short nForLevel; // #29955 for-Schleifen-Ebene
- sal_Bool bStmnt; // sal_True: Statement-Opcode liegt an
+class SbiCodeGen {
+ SbiParser* pParser; // for error messages, line, column etc.
+ SbModule& rMod;
+ SbiBuffer aCode;
+ short nLine, nCol; // for stmnt command
+ short nForLevel; // #29955
+ sal_Bool bStmnt; // sal_True: statement-opcode is pending
public:
SbiCodeGen( SbModule&, SbiParser*, short );
SbiParser* GetParser() { return pParser; }
@@ -52,12 +52,12 @@ public:
void Patch( sal_uInt32 o, sal_uInt32 v ){ aCode.Patch( o, v ); }
void BackChain( sal_uInt32 off ) { aCode.Chain( off ); }
void Statement();
- void GenStmnt(); // evtl. Statement-Opcode erzeugen
+ void GenStmnt(); // create statement-opcode maybe
sal_uInt32 GetPC();
sal_uInt32 GetOffset() { return GetPC() + 1; }
void Save();
- // #29955 for-Schleifen-Ebene pflegen
+ // #29955 service for-loop-level
void IncForLevel( void ) { nForLevel++; }
void DecForLevel( void ) { nForLevel--; }
diff --git a/basic/source/inc/collelem.hxx b/basic/source/inc/collelem.hxx
index 2c39e711f993..8465fd4e462d 100644
--- a/basic/source/inc/collelem.hxx
+++ b/basic/source/inc/collelem.hxx
@@ -31,10 +31,10 @@
#include <basic/sbxobj.hxx>
-// Das Sample-Element ist ein kleines Objekt, das die Properties
-// Name und Value enthlt sowie die Methode Say, die den bergebenen
-// Text mit dem eigenen Namen verkoppelt. Der Name ist von aussen setzbar.
-// Die Implementation arbeitet ausschliesslich mit dynamischen Elementen.
+// The sample-element is a small object that contains the
+// properties name and value and the method Say which couples
+// the passed text with its own name. The name can be set from
+// outside. Implementation works with dynamic elements only.
class SampleElement : public SbxObject
{
diff --git a/basic/source/inc/disas.hxx b/basic/source/inc/disas.hxx
index dbb951a9785a..c1f42e90c567 100644
--- a/basic/source/inc/disas.hxx
+++ b/basic/source/inc/disas.hxx
@@ -37,19 +37,19 @@ class SvStream;
class SbiDisas {
const SbiImage& rImg;
SbModule* pMod;
- char cLabels[ MAX_LABELS ]; // Bitvektor fuer Labels
- sal_uInt32 nOff; // aktuelle Position
- sal_uInt32 nPC; // Position des Opcodes
- SbiOpcode eOp; // Opcode
- sal_uInt32 nOp1, nOp2; // Operanden
- sal_uInt32 nParts; // 1, 2 oder 3
- sal_uInt32 nLine; // aktuelle Zeile
+ char cLabels[ MAX_LABELS ]; // bit vector for labels
+ sal_uInt32 nOff; // current position
+ sal_uInt32 nPC; // position of the opcode
+ SbiOpcode eOp; // opcode
+ sal_uInt32 nOp1, nOp2; // operands
+ sal_uInt32 nParts; // 1, 2 or 3
+ sal_uInt32 nLine; // current line
sal_Bool DisasLine( String& );
- sal_Bool Fetch(); // naechster Opcode
+ sal_Bool Fetch(); // next opcode
public:
SbiDisas( SbModule*, const SbiImage* );
void Disas( String& );
- // NICHT AUFRUFEN
+ // DO NOT CALL
void StrOp( String& );
void Str2Op( String& );
void ImmOp( String& );
diff --git a/basic/source/inc/expr.hxx b/basic/source/inc/expr.hxx
index 0ae218d14c18..3cc12b0adfc6 100644
--- a/basic/source/inc/expr.hxx
+++ b/basic/source/inc/expr.hxx
@@ -46,10 +46,10 @@ class SbiProcDef;
#include <vector>
typedef ::std::vector<SbiExprList*> SbiExprListVector;
-struct SbVar { // Variablen-Element:
- SbiExprNode* pNext; // Weiteres Element (bei Strukturen)
- SbiSymDef* pDef; // Symboldefinition
- SbiExprList* pPar; // optionale Parameter (wird geloescht)
+struct SbVar {
+ SbiExprNode* pNext; // next element (for structures)
+ SbiSymDef* pDef; // symbol definition
+ SbiExprList* pPar; // optional parameters (is deleted)
SbiExprListVector* pvMorePar; // Array of arrays foo(pPar)(avMorePar[0])(avMorePar[1])...
};
@@ -60,11 +60,11 @@ struct KeywordSymbolInfo
SbiToken m_eTok;
};
-enum SbiExprType { // Expression-Typen:
- SbSTDEXPR, // normaler Ausdruck
- SbLVALUE, // beliebiger lValue
- SbSYMBOL, // beliebiges zusammengesetztes Symbol
- SbOPERAND // Variable/Funktion
+enum SbiExprType { // expression types:
+ SbSTDEXPR, // normal expression
+ SbLVALUE, // any lValue
+ SbSYMBOL, // any composite symbol
+ SbOPERAND // variable/function
};
enum SbiExprMode { // Expression context:
@@ -79,9 +79,9 @@ enum SbiExprMode { // Expression context:
};
enum SbiNodeType {
- SbxNUMVAL, // nVal = Wert
- SbxSTRVAL, // aStrVal = Wert, before #i59791/#i45570: nStringId = Wert
- SbxVARVAL, // aVar = Wert
+ SbxNUMVAL, // nVal = value
+ SbxSTRVAL, // aStrVal = value, before #i59791/#i45570: nStringId = value
+ SbxVARVAL, // aVar = value
SbxTYPEOF, // TypeOf ObjExpr Is Type
SbxNODE, // Node
SbxNEW, // new <type> expression
@@ -95,37 +95,37 @@ enum RecursiveMode
PREVENT_CALL
};
-class SbiExprNode { // Operatoren (und Operanden)
+class SbiExprNode { // operators (and operands)
friend class SbiExpression;
friend class SbiConstExpression;
union {
- sal_uInt16 nTypeStrId; // gepoolter String-ID, #i59791/#i45570 Now only for TypeOf
- double nVal; // numerischer Wert
- SbVar aVar; // oder Variable
+ sal_uInt16 nTypeStrId; // pooled String-ID, #i59791/#i45570 Now only for TypeOf
+ double nVal; // numeric value
+ SbVar aVar; // or variable
};
String aStrVal; // #i59791/#i45570 Store string directly
- SbiExprNode* pLeft; // linker Zweig
- SbiExprNode* pRight; // rechter Zweig (NULL bei unaeren Ops)
- SbiExprNode* pWithParent; // Knoten, dessen Member this per with ist
- SbiCodeGen* pGen; // Code-Generator
- SbiNodeType eNodeType; // Art des Nodes
- SbxDataType eType; // aktueller Datentyp
- SbiToken eTok; // Token des Operators
- sal_Bool bComposite; // sal_True: Zusammengesetzter Ausdruck
- sal_Bool bError; // sal_True: Fehlerhaft
- void FoldConstants(); // Constant Folding durchfuehren
- void CollectBits(); // Umwandeln von Zahlen in Strings
- sal_Bool IsOperand() // sal_True, wenn Operand
+ SbiExprNode* pLeft; // right branch
+ SbiExprNode* pRight; // right branch (NULL for unary ops)
+ SbiExprNode* pWithParent; // node, whose member is "this per with"
+ SbiCodeGen* pGen; // code-generator
+ SbiNodeType eNodeType;
+ SbxDataType eType;
+ SbiToken eTok;
+ sal_Bool bComposite; // sal_True: composite expression
+ sal_Bool bError; // sal_True: error
+ void FoldConstants();
+ void CollectBits(); // converting numbers to strings
+ sal_Bool IsOperand()
{ return sal_Bool( eNodeType != SbxNODE && eNodeType != SbxTYPEOF && eNodeType != SbxNEW ); }
sal_Bool IsTypeOf()
{ return sal_Bool( eNodeType == SbxTYPEOF ); }
sal_Bool IsNew()
{ return sal_Bool( eNodeType == SbxNEW ); }
- sal_Bool IsNumber(); // sal_True bei Zahlen
- sal_Bool IsString(); // sal_True bei Strings
- sal_Bool IsLvalue(); // sal_True, falls als Lvalue verwendbar
- void GenElement( SbiOpcode ); // Element
- void BaseInit( SbiParser* p ); // Hilfsfunktion fuer Ctor, AB 17.12.95
+ sal_Bool IsNumber();
+ sal_Bool IsString();
+ sal_Bool IsLvalue(); // sal_True, if usable as Lvalue
+ void GenElement( SbiOpcode );
+ void BaseInit( SbiParser* p ); // help function for Ctor, from 17.12.95
public:
SbiExprNode( void );
SbiExprNode( SbiParser*, double, SbxDataType );
@@ -137,10 +137,10 @@ public:
virtual ~SbiExprNode();
sal_Bool IsValid() { return sal_Bool( !bError ); }
- sal_Bool IsConstant() // sal_True bei konstantem Operanden
+ sal_Bool IsConstant() // sal_True constant operand
{ return sal_Bool( eNodeType == SbxSTRVAL || eNodeType == SbxNUMVAL ); }
- sal_Bool IsIntConst(); // sal_True bei Integer-Konstanten
- sal_Bool IsVariable(); // sal_True, wenn Variable
+ sal_Bool IsIntConst();
+ sal_Bool IsVariable();
SbiExprNode* GetWithParent() { return pWithParent; }
void SetWithParent( SbiExprNode* p ) { pWithParent = p; }
@@ -148,33 +148,33 @@ public:
SbxDataType GetType() { return eType; }
void SetType( SbxDataType eTp ) { eType = eTp; }
SbiNodeType GetNodeType() { return eNodeType; }
- SbiSymDef* GetVar(); // Variable (falls vorhanden)
- SbiSymDef* GetRealVar(); // letzte Variable in x.y.z
- SbiExprNode* GetRealNode(); // letzter Knoten in x.y.z
- short GetDepth(); // Tiefe eines Baumes berechnen
+ SbiSymDef* GetVar();
+ SbiSymDef* GetRealVar(); // last variable in x.y.z
+ SbiExprNode* GetRealNode(); // last node in x.y.z
+ short GetDepth(); // compute a tree's depth
const String& GetString() { return aStrVal; }
short GetNumber() { return (short)nVal; }
SbiExprList* GetParameters() { return aVar.pPar; }
SbiExprListVector* GetMoreParameters() { return aVar.pvMorePar; }
- void Optimize(); // Baumabgleich
+ void Optimize(); // tree matching
- void Gen( RecursiveMode eRecMode = UNDEFINED ); // Ausgabe eines Nodes
+ void Gen( RecursiveMode eRecMode = UNDEFINED ); // giving out a node
};
-class SbiExpression { // der Ausdruck:
+class SbiExpression {
friend class SbiExprList;
friend class SbiParameters;
friend class SbiDimList;
protected:
- String aArgName; // Name fuer bananntes Argument
- SbiParser* pParser; // fuer Fehlermeldungen, Parsing
- SbiExpression* pNext; // Link bei Parameterlisten
- SbiExprNode* pExpr; // Der Expression-Baum
- SbiExprType eCurExpr; // Art des Ausdrucks
- SbiExprMode m_eMode; // Expression context
- sal_Bool bBased; // sal_True: einfacher DIM-Teil (+BASE)
- sal_Bool bError; // sal_True: Fehler
+ String aArgName;
+ SbiParser* pParser;
+ SbiExpression* pNext; // link at parameter lists
+ SbiExprNode* pExpr; // expression tree
+ SbiExprType eCurExpr; // type of expression
+ SbiExprMode m_eMode; // expression context
+ sal_Bool bBased; // sal_True: easy DIM-part (+BASE)
+ sal_Bool bError;
sal_Bool bByVal; // sal_True: ByVal-Parameter
sal_Bool bBracket; // sal_True: Parameter list with brackets
sal_uInt16 nParenLevel;
@@ -199,11 +199,11 @@ protected:
SbiExprNode* Boolean();
public:
SbiExpression( SbiParser*, SbiExprType = SbSTDEXPR,
- SbiExprMode eMode = EXPRMODE_STANDARD, const KeywordSymbolInfo* pKeywordSymbolInfo = NULL ); // Parsender Ctor
+ SbiExprMode eMode = EXPRMODE_STANDARD, const KeywordSymbolInfo* pKeywordSymbolInfo = NULL ); // parsing Ctor
SbiExpression( SbiParser*, const String& );
SbiExpression( SbiParser*, double, SbxDataType = SbxDOUBLE );
SbiExpression( SbiParser*, const SbiSymDef&, SbiExprList* = NULL );
- SbiExpression( SbiParser*, SbiToken ); // Spezial-Expr mit Spezial-Tokens
+ SbiExpression( SbiParser*, SbiToken ); // special expr with special tokens
~SbiExpression();
String& GetName() { return aArgName; }
void SetBased() { bBased = sal_True; }
@@ -222,14 +222,14 @@ public:
SbiExprNode* GetExprNode() { return pExpr; }
SbxDataType GetType() { return pExpr->GetType(); }
void SetType( SbxDataType eType){ pExpr->eType = eType; }
- void Gen( RecursiveMode eRecMode = UNDEFINED ); // Ausgabe eines Nodes
+ void Gen( RecursiveMode eRecMode = UNDEFINED );
};
class SbiConstExpression : public SbiExpression {
double nVal;
String aVal;
SbxDataType eType;
-public: // numerische Konstante
+public: // numeric constant
SbiConstExpression( SbiParser* );
SbxDataType GetType() { return eType; }
const String& GetString() { return aVal; }
@@ -237,14 +237,14 @@ public: // numerische Konstante
short GetShortValue();
};
-class SbiExprList { // Basisklasse fuer Parameter und Dims
+class SbiExprList { // base class for parameters and dims
protected:
- SbiParser* pParser; // Parser
- SbiExpression* pFirst; // Expressions
- short nExpr; // Anzahl Expressions
- short nDim; // Anzahl Dimensionen
- sal_Bool bError; // sal_True: Fehler
- sal_Bool bBracket; // sal_True: Klammern
+ SbiParser* pParser;
+ SbiExpression* pFirst;
+ short nExpr;
+ short nDim;
+ sal_Bool bError;
+ sal_Bool bBracket;
public:
SbiExprList( SbiParser* );
virtual ~SbiExprList();
@@ -253,20 +253,20 @@ public:
short GetSize() { return nExpr; }
short GetDims() { return nDim; }
SbiExpression* Get( short );
- sal_Bool Test( const SbiProcDef& ); // Parameter-Checks
- void Gen(); // Code-Erzeugung
+ sal_Bool Test( const SbiProcDef& ); // parameter checks
+ void Gen(); // code generation
void addExpression( SbiExpression* pExpr );
};
class SbiParameters : public SbiExprList {
public:
- SbiParameters( SbiParser*, sal_Bool bConst = sal_False, sal_Bool bPar = sal_True);// parsender Ctor
+ SbiParameters( SbiParser*, sal_Bool bConst = sal_False, sal_Bool bPar = sal_True);// parsing Ctor
};
class SbiDimList : public SbiExprList {
- sal_Bool bConst; // sal_True: Alles sind Integer-Konstanten
+ sal_Bool bConst; // sal_True: everything integer constants
public:
- SbiDimList( SbiParser* ); // Parsender Ctor
+ SbiDimList( SbiParser* ); // parsing Ctor
sal_Bool IsConstant() { return bConst; }
};
diff --git a/basic/source/inc/filefmt.hxx b/basic/source/inc/filefmt.hxx
index caf6131aa9dd..2206106d6907 100644
--- a/basic/source/inc/filefmt.hxx
+++ b/basic/source/inc/filefmt.hxx
@@ -33,36 +33,36 @@
class SvStream;
-// Version 2: Datentyp des Returnwerts fuer Publics
-// Version 3: neue Opcodes
-// Version 4: neue Opcodes
-// Version 5: Bug (Ansprung von STATIC-Variablen im Init-Code)
-// Version 6: Neue Opcodes und Bug (Globals anlegen, ohne BASIC zu beenden)
-// Version 7: Korrektur im WITH-Parsing
-// Version 8: Korrektur im IF-Parsing
-// Version 9: Init-Code auch mit LEAVE beenden, wenn keine SUB/FUNCTION folgt
-// Version A: #36374 Bei DIM AS NEW... auch Variablen anlegen
-// Version B: #40689 Static umgestellt
-// Version C: #41606 Bug bei Static
-// Version D: #42678 Bug bei RTL-Function spc
-// Version E: #56204 DCREATE, um auch bei DIM AS NEW Arrays anzulegen
-// Version F: #57844 Einfuehrung von SvNumberformat::StringToDouble
-// Version 10: #29955 For-Schleifen-Level in Statement-PCodes generieren
-// Version 11: #29955 Wegen Build-Inkonsistenzen Neu-Compilieren erzwingen
+// Version 2: data type of the return value for publics
+// Version 3: new opcodes
+// Version 4: new opcodes
+// Version 5: bug (entry of STATIC-variables in the init code)
+// Version 6: new opcodes and bug (construct globals, without ending the BASIC)
+// Version 7: correction concerning the WITH-Parsing
+// Version 8: correction concerning the IF-Parsing
+// Version 9: end init code with LEAVE, too, if no SUB/FUNCTION follows
+// Version A: #36374 at DIM AS NEW... construct variable too
+// Version B: #40689 reorganized static
+// Version C: #41606 bug at static
+// Version D: #42678 bug at RTL-function spc
+// Version E: #56204 DCREATE, to also construct arrays at DIM AS NEW
+// Version F: #57844 introduction of SvNumberformat::StringToDouble
+// Version 10: #29955 generate for-loop-level in Statement-PCodes
+// Version 11: #29955 force anew compilation because of build-inconsistences
#define B_LEGACYVERSION 0x00000011L
#define B_CURVERSION 0x00000012L
#define B_EXT_IMG_VERSION 0x00000012L
-// Eine Datei enthaelt entweder einen Modul- oder einen Library-Record.
-// Diese Records enthalten wiederum weitere Records. Jeder Record hat
-// den folgenden Header:
+// The file contains either a module- or a library-record.
+// Those records contain further records. Every record's got
+// the following header:
-// sal_uInt16 Kennung
-// sal_uInt32 Laenge des Records ohne Header
-// sal_uInt16 Anzahl Unterelemente
+// sal_uInt16 identifier
+// sal_uInt32 the record's length without the header
+// sal_uInt16 number of sub-elements
-// Alle Datei-Offsets in Records sind relativ zum Start des Moduls!
+// all the file-offsets in records are relative to the module's start!
#define B_LIBRARY 0x4C42 // BL Library Record
#define B_MODULE 0x4D42 // BM Module Record
@@ -84,92 +84,92 @@ class SvStream;
#define B_EXTSOURCE 0x5345 // ES extended source
#endif
-// Ein Library Record enthaelt nur Module Records
-// sal_uInt16 Kennung BL
-// sal_uInt32 Laenge des Records
-// sal_uInt16 Anzahl Module
+// A library record contains only module records
+// sal_uInt16 identifier BL
+// sal_uInt32 the record's length
+// sal_uInt16 number of modules
-// Ein Modul-Record enthaelt alle anderen Recordtypen
-// sal_uInt16 Kennung BM
-// sal_uInt32 Laenge des Records
+// A module-record contains all the other record types
+// sal_uInt16 identifier BM
+// sal_uInt32 the record's length
// sal_uInt16 1
-// Daten:
-// sal_uInt32 Versionsnummer
-// sal_uInt32 Zeichensatz
-// sal_uInt32 Startadresse Initialisierungscode
-// sal_uInt32 Startadresse Sub Main
-// sal_uInt32 Reserviert
-// sal_uInt32 Reserviert
-
-// Modulname, Kommentar und Quellcode:
-// sal_uInt16 Kennung MN, MC oder SC
-// sal_uInt32 Laenge des Records
+// Data:
+// sal_uInt32 version number
+// sal_uInt32 character set
+// sal_uInt32 starting address initialisation code
+// sal_uInt32 starting address sub main
+// sal_uInt32 reserved
+// sal_uInt32 reserved
+
+// module name, comment and source code:
+// sal_uInt16 identifier MN, MC or SC
+// sal_uInt32 the record's length
// sal_uInt16 1
-// Daten:
-// String-Instanz
+// Data:
+// string instance
// P-Code:
-// sal_uInt16 Kennung PC
-// sal_uInt32 Laenge des Records
+// sal_uInt16 identifier PC
+// sal_uInt32 the record's length
// sal_uInt16 1
-// Daten:
-// Der P-Code als Bytesack
-
-// Alle Symbole und Strings werden in einem String-Pool gehalten.
-// Verweise auf diese Strings sind in Form eines Indexes in diesen Pool.
-
-// Liste aller Publics:
-// sal_uInt16 Kennung PU oder Pu
-// sal_uInt32 Laenge des Records
-// sal_uInt16 Anzahl der Publics
-// Daten fuer jeden Public-Eintrag:
-// sal_uInt16 String-Index
-// sal_uInt32 Startadresse im P-Code-Image (sal_uInt16 fuer alte Publics)
-// sal_uInt16 Datentyp des Returnwertes (ab Version 2)
-
-// Verzeichnis der Symbol-Tabellen:
-// sal_uInt16 Kennung SP
-// sal_uInt32 Laenge des Records
-// sal_uInt16 Anzahl der Symboltabellen
-// Daten fuer jede Symboltabelle:
-// sal_uInt16 Stringindex des Namens
-// sal_uInt16 Anzahl Symbole
-// sal_uInt16 Scope-Kennung
-
-// Symboltabelle:
-// sal_uInt16 Kennung SY
-// sal_uInt32 Laenge des Records
-// sal_uInt16 Anzahl der Symbole
-// Daten:
-// sal_uInt16 Stringindex des Namens
-// sal_uInt16 Anzahl Symbole
-// Daten fuer jedes Symbol:
-// sal_uInt16 Stringindex des Namens
-// sal_uInt16 Datentyp
-// sal_uInt16 Laenge bei STRING*n-Symbolen (0x8000: STATIC-Variable)
+// Data:
+// the P-Code as bytesack
+
+// All symbols and strings are kept in a string-pool.
+// References to these strings are in this pool in the form of an index.
+
+// List of all publics:
+// sal_uInt16 identifier PU or Pu
+// sal_uInt32 the record's length
+// sal_uInt16 number of publics
+// Data for every public-entry:
+// sal_uInt16 string index
+// sal_uInt32 starting address in the p-code-image (sal_uInt16 for old publics)
+// sal_uInt16 data type of the return value (from version 2)
+
+// Register of the symbol tables:
+// sal_uInt16 identifier SP
+// sal_uInt32 the record's length
+// sal_uInt16 number of symbol tables
+// Data for every symbol table:
+// sal_uInt16 stringindex of the name
+// sal_uInt16 number of symbols
+// sal_uInt16 scope identifier
+
+// symbol table:
+// sal_uInt16 identifier SY
+// sal_uInt32 the record's length
+// sal_uInt16 number of symbols
+// Data:
+// sal_uInt16 stringindex of the name
+// sal_uInt16 number of symbols
+// Data for every symbol:
+// sal_uInt16 stringindex of the name
+// sal_uInt16 data type
+// sal_uInt16 length for STRING*n-symbols (0x8000: STATIC variable)
// Stringpool:
-// sal_uInt16 Kennung ST
-// sal_uInt32 Laenge des Records
-// sal_uInt16 Anzahl der Strings
-// Daten fuer jeden String:
-// sal_uInt32 Offset in den Block aller Strings
-// Danach folgt der Block aller Strings, die dort als ASCIIZ-Strings liegen.
-
-// Line Ranges:
-// sal_uInt16 Kennung LR
-// sal_uInt32 Laenge des Records
-// sal_uInt16 Anzahl der Strings
-// Daten fuer jedes Public:
+// sal_uInt16 identifier ST
+// sal_uInt32 the record's length
+// sal_uInt16 number of strings
+// Data for every string:
+// sal_uInt32 Offset in the block of all strings
+// the block of all strings (ASCIIZ) follows then
+
+// line ranges:
+// sal_uInt16 identifier LR
+// sal_uInt32 the record's length
+// sal_uInt16 number of strings
+// Data for every public:
// sal_uInt16 1. Zeile (Sub XXX)
// sal_uInt16 2. Zeile (End Sub)
-// SBX-Objekte:
-// sal_uInt16 Anzahl Objekte
-// .... Objektdaten
+// SBX-objects:
+// sal_uInt16 number of objects
+// .... object data
-// Service-Routinen (in IMAGE.CXX)
+// service routines (in IMAGE.CXX)
sal_Bool SbGood( SvStream& r );
sal_uIntPtr SbOpenRecord( SvStream&, sal_uInt16 nSignature, sal_uInt16 nElem );
diff --git a/basic/source/inc/image.hxx b/basic/source/inc/image.hxx
index 0f0ffdf7df9a..f91d56f91e05 100644
--- a/basic/source/inc/image.hxx
+++ b/basic/source/inc/image.hxx
@@ -33,13 +33,13 @@
#include <rtl/ustring.hxx>
#include <filefmt.hxx>
-// Diese Klasse liest das vom Compiler erzeugte Image ein und verwaltet
-// den Zugriff auf die einzelnen Elemente.
+// This class reads in the image that's been produced by the compiler
+// and manages the access to the single elements.
struct SbPublicEntry;
class SbiImage {
- friend class SbiCodeGen; // Compiler-Klassen, die die private-
+ friend class SbiCodeGen; // compiler classes, that the private-
SbxArrayRef rTypes; // User defined types
SbxArrayRef rEnums; // Enum types
@@ -47,35 +47,35 @@ class SbiImage {
sal_Unicode* pStrings; // StringPool
char* pCode; // Code-Image
char* pLegacyPCode; // Code-Image
- sal_Bool bError; // sal_True: Fehler
- sal_uInt16 nFlags; // Flags (s.u.)
- short nStrings; // Anzahl Strings
- sal_uInt32 nStringSize; // Groesse des String-Puffers
- sal_uInt32 nCodeSize; // Groesse des Code-Blocks
- sal_uInt16 nLegacyCodeSize; // Groesse des Code-Blocks
- sal_uInt16 nDimBase; // OPTION BASE-Wert
- rtl_TextEncoding eCharSet; // Zeichensatz fuer Strings
- // temporaere Verwaltungs-Variable:
- short nStringIdx; // aktueller String-Index
- sal_uInt32 nStringOff; // aktuelle Pos im Stringpuffer
- // Routinen fuer Compiler:
- void MakeStrings( short ); // StringPool einrichten
- void AddString( const String& );// String zufuegen
- void AddCode( char*, sal_uInt32 ); // Codeblock dazu
- void AddType(SbxObject *); // User-Type mit aufnehmen
- void AddEnum(SbxObject *); // Register enum type
+ sal_Bool bError;
+ sal_uInt16 nFlags;
+ short nStrings;
+ sal_uInt32 nStringSize;
+ sal_uInt32 nCodeSize;
+ sal_uInt16 nLegacyCodeSize;
+ sal_uInt16 nDimBase; // OPTION BASE value
+ rtl_TextEncoding eCharSet;
+ // temporary management-variable:
+ short nStringIdx;
+ sal_uInt32 nStringOff; // current Pos in the stringbuffer
+ // routines for the compiler:
+ void MakeStrings( short ); // establish StringPool
+ void AddString( const String& );
+ void AddCode( char*, sal_uInt32 );
+ void AddType(SbxObject *);
+ void AddEnum(SbxObject *);
public:
- String aName; // Makroname
- ::rtl::OUString aOUSource; // Quellcode
- String aComment; // Kommentar
- sal_Bool bInit; // sal_True: Init-Code ist gelaufen
- sal_Bool bFirstInit; // sal_True, wenn das Image das erste mal nach
- // dem Compilieren initialisiert wird.
+ String aName; // macro name
+ ::rtl::OUString aOUSource; // source code
+ String aComment;
+ sal_Bool bInit;
+ sal_Bool bFirstInit;
+
SbiImage();
~SbiImage();
- void Clear(); // Inhalt loeschen
- sal_Bool Load( SvStream&, sal_uInt32& nVer ); // Loads image from stream
+ void Clear();
+ sal_Bool Load( SvStream&, sal_uInt32& nVer );
// nVer is set to version
// of image
sal_Bool Load( SvStream& );
@@ -100,9 +100,9 @@ public:
};
-#define SBIMG_EXPLICIT 0x0001 // OPTION EXPLICIT ist aktiv
-#define SBIMG_COMPARETEXT 0x0002 // OPTION COMPARE TEXT ist aktiv
-#define SBIMG_INITCODE 0x0004 // Init-Code vorhanden
+#define SBIMG_EXPLICIT 0x0001 // OPTION EXPLICIT is active
+#define SBIMG_COMPARETEXT 0x0002 // OPTION COMPARE TEXT is active
+#define SBIMG_INITCODE 0x0004 // Init-Code does exist
#define SBIMG_CLASSMODULE 0x0008 // OPTION ClassModule is active
#endif
diff --git a/basic/source/inc/iosys.hxx b/basic/source/inc/iosys.hxx
index 48d6ce39d506..f9e7319f0e4e 100644
--- a/basic/source/inc/iosys.hxx
+++ b/basic/source/inc/iosys.hxx
@@ -34,29 +34,28 @@
class SvStream;
-// Zur Zeit sind globale Dateien (Kanalnummern 256 bis 511)
-// nicht implementiert.
+// Global files (channel numbers 256 to 511) are not
+// implemented at the moment.
#define CHANNELS 256
#define CONSOLE 0
-#define SBSTRM_INPUT 0x0001 // Input
-#define SBSTRM_OUTPUT 0x0002 // Output
-#define SBSTRM_RANDOM 0x0004 // Random
-#define SBSTRM_APPEND 0x0008 // Append
-#define SBSTRM_BINARY 0x0010 // Binary
+#define SBSTRM_INPUT 0x0001
+#define SBSTRM_OUTPUT 0x0002
+#define SBSTRM_RANDOM 0x0004
+#define SBSTRM_APPEND 0x0008
+#define SBSTRM_BINARY 0x0010
class SbiStream {
- SvStream* pStrm; // der Stream
- sal_uIntPtr nExpandOnWriteTo; // bei Schreibzugriff, den Stream
- // bis zu dieser Groesse aufblasen
- ByteString aLine; // aktuelle Zeile
- sal_uIntPtr nLine; // aktuelle Zeilennummer
- short nLen; // Pufferlaenge
- short nMode; // Bits:
- short nChan; // aktueller Kanal
- SbError nError; // letzter Fehlercode
- void MapError(); // Fehlercode mappen
+ SvStream* pStrm;
+ sal_uIntPtr nExpandOnWriteTo; // during writing access expand the stream to this size
+ ByteString aLine;
+ sal_uIntPtr nLine;
+ short nLen; // buffer length
+ short nMode;
+ short nChan;
+ SbError nError;
+ void MapError();
public:
SbiStream();
@@ -82,10 +81,10 @@ public:
class SbiIoSystem {
SbiStream* pChan[ CHANNELS ];
- ByteString aPrompt; // Input-Prompt
- ByteString aIn, aOut; // Console-Buffer
- short nChan; // aktueller Kanal
- SbError nError; // letzter Fehlercode
+ ByteString aPrompt;
+ ByteString aIn, aOut;
+ short nChan;
+ SbError nError;
void ReadCon( ByteString& );
void WriteCon( const ByteString& );
public:
diff --git a/basic/source/inc/object.hxx b/basic/source/inc/object.hxx
index 52af24b2b994..bf9440cacb44 100644
--- a/basic/source/inc/object.hxx
+++ b/basic/source/inc/object.hxx
@@ -34,27 +34,26 @@
#include <basic/sbxobj.hxx>
// 1) Properties:
-// Name der Name, R/O
-// Value ein double-Wert, R/W
-// 2) Methoden:
-// Display Ausgabe eines Textes
-// Square Argument * Argument
-// Event Aufruf eines Basic-Programms
-// 3) Unterobjekte:
-// eine Collection names "Elements". Der Zugriff ist sowohl als
-// Property (fuer das gesamte Objekt) als auch als Methode (fuer
-// einzelne Elemente, wird durchgereicht) implementiert.
-// Diese Implementation ist ein Beispiel fuer eine tabellengesteuerte
-// Version, die sehr viele Elemente enthalten kann.
-// Die Collection findet sich in COLLECTN.*, die in der Collection
-// enthaltenen Objekte in COLLELEM.*
+// Name R/O
+// Value a double-value, R/W
+// 2) Methods:
+// Display display a text
+// Square argument * argument
+// Event call of a Basic-program
+// 3) Sub-objects:
+// a collection named "elements". The access is implemented as
+// property (for the whole object) and as method (for single
+// elements, is passed through).
+// This implementation is an example for a table controlled
+// version that can contain many elements.
+// The collection is located in COLLECTN.*, the collection's
+// objects in COLLELEM.*
class SampleObject : public SbxObject
{
using SbxVariable::GetInfo;
- // Definition eines Tabelleneintrags. Dies wird hier gemacht,
- // da dadurch die Methoden und Properties als private deklariert
- // werden koennen.
+ // Definition of a table entry. This is done here because
+ // methods and properties can be declared private that way.
#if defined ( ICC ) || defined ( C50 )
public:
#endif
@@ -65,30 +64,29 @@ private:
#endif
struct Methods {
- const char* pName; // Name des Eintrags
- SbxDataType eType; // Datentyp
- pMeth pFunc; // Function Pointer
- short nArgs; // Argumente und Flags
+ const char* pName; // name of an entry
+ SbxDataType eType; // data type
+ pMeth pFunc;
+ short nArgs; // arguments and flags
};
- static Methods aMethods[]; // Methodentabelle
+ static Methods aMethods[]; // method table
- // Methoden
+ // methods
void Display( SbxVariable*, SbxArray*, sal_Bool );
void Event( SbxVariable*, SbxArray*, sal_Bool );
void Square( SbxVariable*, SbxArray*, sal_Bool );
void Create( SbxVariable*, SbxArray*, sal_Bool );
- // Infoblock auffuellen
+ // fill infoblock
SbxInfo* GetInfo( short nIdx );
// Broadcaster Notification
virtual void SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
const SfxHint& rHint, const TypeId& rHintType );
public:
SampleObject( const String& );
- // Suchen eines Elements
+
virtual SbxVariable* Find( const String&, SbxClassType );
};
-// Die dazugehoerige Factory:
class SampleObjectFac : public SbxFactory
{
diff --git a/basic/source/inc/opcodes.hxx b/basic/source/inc/opcodes.hxx
index 156ef8bd625a..bf8b20fb2942 100644
--- a/basic/source/inc/opcodes.hxx
+++ b/basic/source/inc/opcodes.hxx
@@ -31,60 +31,60 @@
#include "sbintern.hxx"
-// Ein Opcode ist entweder 1, 3 oder 5 Bytes lang, je nach numerischen
-// Wert des Opcodes (s.u.).
+// An opcode can have a length of 1, 3 or 5 bytes,
+// depending on its numeric value (see below).
enum SbiOpcode {
- // Alle Opcodes ohne Operanden
+ // all opcodes without operands
_NOP = 0,
SbOP0_START = _NOP,
- // Operatoren
- // die folgenden Operatoren sind genauso angeordnet
- // wie der enum SbxVarOp
+ // operators
+ // the following operators are ordered
+ // the same way as the enum SbxVarOp
_EXP, _MUL, _DIV, _MOD, _PLUS, _MINUS, _NEG,
_EQ, _NE, _LT, _GT, _LE, _GE,
_IDIV, _AND, _OR, _XOR, _EQV, _IMP, _NOT,
_CAT,
- // Ende enum SbxVarOp
+ // end of enum SbxVarOp
_LIKE, _IS,
- // Laden/speichern
- _ARGC, // neuen Argv einrichten
- _ARGV, // TOS ==> aktueller Argv
+ // load/save
+ _ARGC, // establish new Argv
+ _ARGV, // TOS ==> current Argv
_INPUT, // Input ==> TOS
_LINPUT, // Line Input ==> TOS
- _GET, // TOS anfassen
- _SET, // Speichern Objekt TOS ==> TOS-1
+ _GET, // touch TOS
+ _SET, // save object TOS ==> TOS-1
_PUT, // TOS ==> TOS-1
- _PUTC, // TOS ==> TOS-1, dann ReadOnly
+ _PUTC, // TOS ==> TOS-1, then ReadOnly
_DIM, // DIM
_REDIM, // REDIM
_REDIMP, // REDIM PRESERVE
- _ERASE, // TOS loeschen
- // Verzweigen
- _STOP, // Programmende
- _INITFOR, // FOR-Variable initialisieren
- _NEXT, // FOR-Variable inkrementieren
- _CASE, // Anfang CASE
- _ENDCASE, // Ende CASE
- _STDERROR, // Standard-Fehlerbehandlung
- _NOERROR, // keine Fehlerbehandlung
- _LEAVE, // UP verlassen
+ _ERASE, // delete TOS
+ // branch
+ _STOP, // end of program
+ _INITFOR, // initialize FOR-variable
+ _NEXT, // increment FOR-variable
+ _CASE, // beginning CASE
+ _ENDCASE, // end CASE
+ _STDERROR, // standard error handling
+ _NOERROR, // no error handling
+ _LEAVE, // leave UP
// E/A
- _CHANNEL, // TOS = Kanalnummer
+ _CHANNEL, // TOS = channel number
_BPRINT, // print TOS
_PRINTF, // print TOS in field
_BWRITE, // write TOS
_RENAME, // Rename Tos+1 to Tos
_PROMPT, // TOS = Prompt for Input
- _RESTART, // Restartpunkt definieren
- _CHAN0, // I/O-Kanal 0
- // Sonstiges
- _EMPTY, // Leeren Ausdruck auf Stack
- _ERROR, // TOS = Fehlercode
- _LSET, // Speichern Objekt TOS ==> TOS-1
- _RSET, // Speichern Objekt TOS ==> TOS-1
+ _RESTART, // define restart point
+ _CHAN0, // I/O-channel 0
+ // miscellaneous
+ _EMPTY, // empty expression on stack
+ _ERROR, // TOS = error code
+ _LSET, // saving object TOS ==> TOS-1
+ _RSET, // saving object TOS ==> TOS-1
_REDIMP_ERASE, // Copies array to be later used by REDIM PRESERVE before erasing it
_INITFOREACH,
_VBASET, // VBA-like Set
@@ -94,70 +94,70 @@ enum SbiOpcode {
SbOP0_END = _BYVAL,
- // Alle Opcodes mit einem Operanden
+ // all opcodes with one operand
- _NUMBER = 0x40, // Laden einer numerischen Konstanten (+ID)
+ _NUMBER = 0x40, // loading a numeric constant (+ID)
SbOP1_START = _NUMBER,
- _SCONST, // Laden einer Stringkonstanten (+ID)
- _CONST, // Immediate Load (+Wert)
- _ARGN, // Speichern eines named Args in Argv (+StringID)
- _PAD, // String auf feste Laenge bringen (+Laenge)
+ _SCONST, // loading a stringconstant (+ID)
+ _CONST, // Immediate Load (+ value)
+ _ARGN, // saving a named Arg in Argv (+StringID)
+ _PAD, // bring string to a firm length (+length)
// Verzweigungen
- _JUMP, // Sprung (+Target)
- _JUMPT, // TOS auswerten, bedingter Sprung (+Target)
- _JUMPF, // TOS auswerten, bedingter Sprung (+Target)
- _ONJUMP, // TOS auswerten, Sprung in JUMP-Tabelle (+MaxVal)
- _GOSUB, // UP-Aufruf (+Target)
- _RETURN, // UP-Return (+0 oder Target)
- _TESTFOR, // FOR-Variable testen, inkrementieren (+Endlabel)
+ _JUMP, // jump (+target)
+ _JUMPT, // evaluate TOS, conditional jump (+target)
+ _JUMPF, // evaluate TOS, conditional jump (+target)
+ _ONJUMP, // evaluate TOS, jump into JUMP-table (+MaxVal)
+ _GOSUB, // UP-call (+Target)
+ _RETURN, // UP-return (+0 or Target)
+ _TESTFOR, // test FOR-variable, increment (+Endlabel)
_CASETO, // Tos+1 <= Case <= Tos, 2xremove (+Target)
- _ERRHDL, // Fehler-Handler (+Offset)
- _RESUME, // Resume nach Fehlern (+0 or 1 or Label)
+ _ERRHDL, // error handler (+Offset)
+ _RESUME, // Resume after errors (+0 or 1 or Label)
// E/A
- _CLOSE, // (+Kanal/0)
+ _CLOSE, // (+channel/0)
_PRCHAR, // (+char)
// Verwaltung
- _SETCLASS, // Set + Klassennamen testen (+StringId)
+ _SETCLASS, // test set + class names (+StringId)
_TESTCLASS, // Check TOS class (+StringId)
- _LIB, // Libnamen fuer Declare-Procs setzen (+StringId)
- _BASED, // TOS wird um BASE erhoeht, BASE davor gepusht (+base)
- // Typanpassung im Argv
- _ARGTYP, // Letzten Parameter in Argv konvertieren (+Typ)
+ _LIB, // set lib name for declar-procs (+StringId)
+ _BASED, // TOS is incremented by BASE, BASE is pushed before (+base)
+ // type adjustment in the Argv
+ _ARGTYP, // convert last parameter in Argv (+type)
_VBASETCLASS, // VBA-like Set
SbOP1_END = _VBASETCLASS,
- // Alle Opcodes mit zwei Operanden
+ // all opcodes with two operands
- _RTL = 0x80, // Laden aus RTL (+StringID+Typ)
+ _RTL = 0x80, // load from the RTL (+StringID+Typ)
SbOP2_START = _RTL,
- _FIND, // Laden (+StringID+Typ)
- _ELEM, // Laden Element (+StringID+Typ)
- _PARAM, // Parameter (+Offset+Typ)
- // Verzweigen
- _CALL, // DECLARE-Methode rufen (+StringID+Typ)
- _CALLC, // Cdecl-DECLARE-Methode rufen (+StringID+Typ)
- _CASEIS, // Case-Test (+Test-Opcode+True-Target)
- // Verwaltung
- _STMNT, // Beginn eines Statements (+Line+Col)
+ _FIND, // load (+StringID+Typ)
+ _ELEM, // load element (+StringID+Typ)
+ _PARAM, // parameters (+Offset+Typ)
+ // branch
+ _CALL, // call DECLARE-method (+StringID+Typ)
+ _CALLC, // call Cdecl-DECLARE-Method (+StringID+Typ)
+ _CASEIS, // case-test (+Test-Opcode+True-Target)
+ // management
+ _STMNT, // begin of a statement (+Line+Col)
// E/A
_OPEN, // (+SvStreamFlags+Flags)
- // Objekte
- _LOCAL, // Lokale Variable definieren (+StringID+Typ)
- _PUBLIC, // Modulglobale Variable (+StringID+Typ)
- _GLOBAL, // Globale Variable definieren, public-Anweisung (+StringID+Typ)
- _CREATE, // Objekt kreieren (+StringId+StringID)
- _STATIC, // Statische Variabl (+StringID+Typ) JSM
- _TCREATE, // User Defined Objekt kreieren
- _DCREATE, // Objekt-Array kreieren (+StringId+StringID)
- _GLOBAL_P, // Globale Variable definieren, die beim Neustart von Basic
- // nicht ueberschrieben wird, P=PERSIST (+StringID+Typ)
- _FIND_G, // Sucht globale Variable mit Spezialbehandlung wegen _GLOBAL_P
- _DCREATE_REDIMP, // Objekt-Array redimensionieren (+StringId+StringID)
+ // objects
+ _LOCAL, // define locals variables (+StringID+Typ)
+ _PUBLIC, // module global variables (+StringID+Typ)
+ _GLOBAL, // define global variables, public command (+StringID+Typ)
+ _CREATE, // create object (+StringId+StringID)
+ _STATIC, // static variable (+StringID+Typ) JSM
+ _TCREATE, // create user-defined object
+ _DCREATE, // create object-array (+StringId+StringID)
+ _GLOBAL_P, // define global variable that's not overwritten on restarting
+ // the Basic, P=PERSIST (+StringID+Typ)
+ _FIND_G, // finds global variable with special treatment due to _GLOBAL_P
+ _DCREATE_REDIMP, // redimension object-array (+StringId+StringID)
_FIND_CM, // Search inside a class module (CM) to enable global search in time
_PUBLIC_P, // Module global Variable (persisted between calls)(+StringID+Typ)
_FIND_STATIC, // local static var lookup (+StringID+Typ)
diff --git a/basic/source/inc/parser.hxx b/basic/source/inc/parser.hxx
index 1b58e5d39f0b..c17c99daa8b3 100644
--- a/basic/source/inc/parser.hxx
+++ b/basic/source/inc/parser.hxx
@@ -43,42 +43,42 @@ class SbiParser : public SbiTokenizer
{
friend class SbiExpression;
- SbiParseStack* pStack; // Block-Stack
- SbiProcDef* pProc; // aktuelle Prozedur
- SbiExprNode* pWithVar; // aktuelle With-Variable
- SbiToken eEndTok; // das Ende-Token
- sal_uInt32 nGblChain; // Chainkette fuer globale DIMs
- sal_Bool bGblDefs; // sal_True globale Definitionen allgemein
- sal_Bool bNewGblDefs; // sal_True globale Definitionen vor Sub
- sal_Bool bSingleLineIf; // sal_True einzeiliges if-Statement
-
- SbiSymDef* VarDecl( SbiDimList**,sal_Bool,sal_Bool );// Variablen-Deklaration
- SbiProcDef* ProcDecl(sal_Bool bDecl);// Prozedur-Deklaration
+ SbiParseStack* pStack;
+ SbiProcDef* pProc;
+ SbiExprNode* pWithVar;
+ SbiToken eEndTok;
+ sal_uInt32 nGblChain; // for global DIMs
+ sal_Bool bGblDefs; // sal_True global definitions general
+ sal_Bool bNewGblDefs; // sal_True globale definitions before sub
+ sal_Bool bSingleLineIf;
+
+ SbiSymDef* VarDecl( SbiDimList**,sal_Bool,sal_Bool );
+ SbiProcDef* ProcDecl(sal_Bool bDecl);
void DefStatic( sal_Bool bPrivate );
- void DefProc( sal_Bool bStatic, sal_Bool bPrivate ); // Prozedur einlesen
- void DefVar( SbiOpcode eOp, sal_Bool bStatic ); // DIM/REDIM einlesen
- void TypeDecl( SbiSymDef&, sal_Bool bAsNewAlreadyParsed=sal_False ); // AS-Deklaration
- void OpenBlock( SbiToken, SbiExprNode* = NULL ); // Block oeffnen
- void CloseBlock(); // Block aufloesen
- sal_Bool Channel( sal_Bool=sal_False ); // Kanalnummer parsen
- void StmntBlock( SbiToken ); // Statement-Block abarbeiten
+ void DefProc( sal_Bool bStatic, sal_Bool bPrivate ); // read in procedure
+ void DefVar( SbiOpcode eOp, sal_Bool bStatic ); // read in DIM/REDIM
+ void TypeDecl( SbiSymDef&, sal_Bool bAsNewAlreadyParsed=sal_False ); // AS-declaration
+ void OpenBlock( SbiToken, SbiExprNode* = NULL );
+ void CloseBlock();
+ sal_Bool Channel( sal_Bool=sal_False ); // parse channel number
+ void StmntBlock( SbiToken );
void DefType( sal_Bool bPrivate ); // Parse type declaration
void DefEnum( sal_Bool bPrivate ); // Parse enum declaration
void DefDeclare( sal_Bool bPrivate );
void EnableCompatibility();
public:
- SbxArrayRef rTypeArray; // das Type-Array
- SbxArrayRef rEnumArray; // Enum types
- SbiStringPool aGblStrings; // der String-Pool
- SbiStringPool aLclStrings; // der String-Pool
- SbiSymPool aGlobals; // globale Variable
- SbiSymPool aPublics; // modulglobale Variable
+ SbxArrayRef rTypeArray;
+ SbxArrayRef rEnumArray;
+ SbiStringPool aGblStrings; // string-pool
+ SbiStringPool aLclStrings; // string-pool
+ SbiSymPool aGlobals;
+ SbiSymPool aPublics; // module global
SbiSymPool aRtlSyms; // Runtime-Library
SbiCodeGen aGen; // Code-Generator
- StarBASIC* pBasic; // StarBASIC-Instanz
- SbiSymPool* pPool; // aktueller Pool
- SbiExprType eCurExpr; // aktueller Expr-Typ
- short nBase; // OPTION BASE-Wert
+ StarBASIC* pBasic; // StarBASIC instance
+ SbiSymPool* pPool;
+ SbiExprType eCurExpr;
+ short nBase; // OPTION BASE-value
sal_Bool bText; // OPTION COMPARE TEXT
sal_Bool bExplicit; // sal_True: OPTION EXPLICIT
sal_Bool bClassModule; // sal_True: OPTION ClassModule
@@ -87,28 +87,28 @@ public:
SbxDataType eDefTypes[26]; // DEFxxx-Datentypen
SbiParser( StarBASIC*, SbModule* );
- sal_Bool Parse(); // die Aktion
- SbiExprNode* GetWithVar(); // Innerste With-Variable liefern
+ sal_Bool Parse();
+ SbiExprNode* GetWithVar();
- // AB 31.3.1996, Symbol in Runtime-Library suchen
+ // from 31.3.1996, search symbol in the runtime-library
SbiSymDef* CheckRTLForSym( const String& rSym, SbxDataType eType );
void AddConstants( void );
- sal_Bool HasGlobalCode(); // Globaler Code definiert?
+ sal_Bool HasGlobalCode();
- sal_Bool TestToken( SbiToken ); // bestimmtes TOken?
- sal_Bool TestSymbol( sal_Bool=sal_False ); // Symbol?
- sal_Bool TestComma(); // Komma oder EOLN?
- void TestEoln(); // EOLN?
+ sal_Bool TestToken( SbiToken );
+ sal_Bool TestSymbol( sal_Bool=sal_False );
+ sal_Bool TestComma();
+ void TestEoln();
- void Symbol( const KeywordSymbolInfo* pKeywordSymbolInfo = NULL ); // Let oder Call
+ void Symbol( const KeywordSymbolInfo* pKeywordSymbolInfo = NULL ); // let or call
void ErrorStmnt(); // ERROR n
- void NotImp(); // nicht implementiert
+ void NotImp(); // not implemented
void BadBlock(); // LOOP/WEND/NEXT
- void BadSyntax(); // Falsches SbiToken
- void NoIf(); // ELSE/ELSE IF ohne IF
+ void BadSyntax(); // wrong SbiToken
+ void NoIf(); // ELSE/ELSE IF without IF
void Assign(); // LET
- void Attribute(); // Attribute
+ void Attribute();
void Call(); // CALL
void Close(); // CLOSE
void Declare(); // DECLARE
diff --git a/basic/source/inc/runtime.hxx b/basic/source/inc/runtime.hxx
index d8e8b2507640..b81e88b2db64 100644
--- a/basic/source/inc/runtime.hxx
+++ b/basic/source/inc/runtime.hxx
@@ -61,16 +61,16 @@ public:
}
-class SbiInstance; // aktiver StarBASIC-Prozess
-class SbiRuntime; // aktive StarBASIC-Prozedur-Instanz
+class SbiInstance; // active StarBASIC process
+class SbiRuntime; // active StarBASIC procedure instance
struct SbiArgvStack; // Argv stack element
struct SbiGosubStack; // GOSUB stack element
class SbiImage; // Code-Image
-class SbiIoSystem; // Dateisystem
-class SbiDdeControl; // DDE-Steuerung
-class SbiDllMgr; // Aufrufe in DLLs
-class SvNumberFormatter; // Zeit/Datumsfunktionen
+class SbiIoSystem;
+class SbiDdeControl;
+class SbiDllMgr;
+class SvNumberFormatter; // time/date functions
enum ForType
{
@@ -113,7 +113,7 @@ struct SbiGosubStack { // GOSUB-Stack:
sal_uInt16 nStartForLvl; // #118235: For Level in moment of gosub
};
-#define MAXRECURSION 500 // max. 500 Rekursionen
+#define MAXRECURSION 500
#define Sb_ATTR_NORMAL 0x0000
#define Sb_ATTR_HIDDEN 0x0002
@@ -143,9 +143,9 @@ public:
~SbiRTLData();
};
-// Die Instanz entspricht einem laufenden StarBASIC. Mehrere gleichzeitig
-// laufende BASICs werden ueber verkettete Instanzen verwaltet. Hier liegen
-// alle Daten, die nur leben, wenn BASIC auch lebt, wie z.B. das I/O-System.
+// The instance matches a running StarBASIC. Many basics running at the same
+// time are managed by chained instances. There is all the data that only lives
+// when the BASIC is living too, like the I/O-system.
typedef ::std::vector
<
@@ -160,7 +160,7 @@ class SbiInstance
SbiRTLData aRTLData;
- SbiIoSystem* pIosys; // Dateisystem
+ SbiIoSystem* pIosys; // file system
SbiDdeControl* pDdeCtrl; // DDE
SbiDllMgr* pDllMgr; // DLL-Calls (DECLARE)
StarBASIC* pBasic;
@@ -169,33 +169,33 @@ class SbiInstance
DateFormat meFormatterDateFormat;
sal_uInt32 nStdDateIdx, nStdTimeIdx, nStdDateTimeIdx;
- SbError nErr; // aktueller Fehlercode
- String aErrorMsg; // letzte Error-Message fuer $ARG
- sal_uInt16 nErl; // aktuelle Fehlerzeile
- sal_Bool bReschedule; // Flag: sal_True = Reschedule in Hauptschleife
+ SbError nErr;
+ String aErrorMsg; // last error message for $ARG
+ sal_uInt16 nErl; // current error line
+ sal_Bool bReschedule; // Flag: sal_True = Reschedule in main loop
sal_Bool bCompatibility; // Flag: sal_True = VBA runtime compatibility mode
ComponentVector_t ComponentVector;
public:
SbiRuntime* pRun; // Call-Stack
- SbiInstance* pNext; // Instanzen-Chain
+ SbiInstance* pNext; // instances chain
- // #31460 Neues Konzept fuer StepInto/Over/Out,
- // Erklaerung siehe runtime.cxx bei SbiInstance::CalcBreakCallLevel()
- sal_uInt16 nCallLvl; // Call-Level (wg. Rekursion)
- sal_uInt16 nBreakCallLvl; // Call-Level zum Anhalten
- void CalcBreakCallLevel( sal_uInt16 nFlags ); // Gemaess Flags setzen
+ // #31460 new concept for StepInto/Over/Out,
+ // Explaination see runtime.cxx at SbiInstance::CalcBreakCallLevel()
+ sal_uInt16 nCallLvl;
+ sal_uInt16 nBreakCallLvl;
+ void CalcBreakCallLevel( sal_uInt16 nFlags );
SbiInstance( StarBASIC* );
~SbiInstance();
void Error( SbError ); // trappable Error
- void Error( SbError, const String& rMsg ); // trappable Error mit Message
+ void Error( SbError, const String& rMsg ); // trappable Error with message
void ErrorVB( sal_Int32 nVBNumber, const String& rMsg );
void setErrorVB( sal_Int32 nVBNumber, const String& rMsg );
void FatalError( SbError ); // non-trappable Error
void FatalError( SbError, const String& ); // non-trappable Error
- void Abort(); // Abbruch mit aktuellem Fehlercode
+ void Abort(); // with current error code
void Stop();
SbError GetErr() { return nErr; }
@@ -223,16 +223,16 @@ public:
sal_uInt32 GetStdTimeIdx() const { return nStdTimeIdx; }
sal_uInt32 GetStdDateTimeIdx() const { return nStdDateTimeIdx; }
- // NumberFormatter auch statisch anbieten
+ // offer NumberFormatter also static
static void PrepareNumberFormatter( SvNumberFormatter*& rpNumberFormatter,
sal_uInt32 &rnStdDateIdx, sal_uInt32 &rnStdTimeIdx, sal_uInt32 &rnStdDateTimeIdx,
LanguageType* peFormatterLangType=NULL, DateFormat* peFormatterDateFormat=NULL );
};
-SbiIoSystem* SbGetIoSystem(); // das aktuelle I/O-System
+SbiIoSystem* SbGetIoSystem();
-// Verkettbare Items, um Referenzen temporaer zu halten
+// chainable items to keep references temporary
struct RefSaveItem
{
SbxVariableRef xRef;
@@ -242,9 +242,8 @@ struct RefSaveItem
};
-// Eine Instanz dieser Klasse wird fuer jedes ausgefuehrte Unterprogramm
-// aufgesetzt. Diese Instanz ist das Herz der BASIC-Maschine und enthaelt
-// nur lokale Daten.
+// There's one instance of this class for every executed sub-program.
+// This instance is the heart of the BASIC-machine and contains only local data.
class SbiRuntime
{
@@ -253,52 +252,52 @@ class SbiRuntime
typedef void( SbiRuntime::*pStep0 )();
typedef void( SbiRuntime::*pStep1 )( sal_uInt32 nOp1 );
typedef void( SbiRuntime::*pStep2 )( sal_uInt32 nOp1, sal_uInt32 nOp2 );
- static pStep0 aStep0[]; // Opcode-Tabelle Gruppe 0
- static pStep1 aStep1[]; // Opcode-Tabelle Gruppe 1
- static pStep2 aStep2[]; // Opcode-Tabelle Gruppe 2
-
- StarBASIC& rBasic; // StarBASIC-Instanz
- SbiInstance* pInst; // aktiver Thread
- SbModule* pMod; // aktuelles Modul
- SbMethod* pMeth; // Methoden-Instanz
+ static pStep0 aStep0[]; // opcode-table group 0
+ static pStep1 aStep1[];
+ static pStep2 aStep2[];
+
+ StarBASIC& rBasic; // StarBASIC instance
+ SbiInstance* pInst; // current thread
+ SbModule* pMod; // current module
+ SbMethod* pMeth; // method instance
SbiIoSystem* pIosys; // I/O-System
const SbiImage* pImg; // Code-Image
SbxArrayRef refExprStk; // expression stack
SbxArrayRef refCaseStk; // CASE expression stack
SbxArrayRef refRedimpArray; // Array saved to use for REDIM PRESERVE
SbxVariableRef refRedim; // Array saved to use for REDIM
- SbxVariableRef xDummyVar; // Ersatz fuer nicht gefundene Variablen
+ SbxVariableRef xDummyVar; // substitute for variables that weren't found
SbxVariable* mpExtCaller; // Caller ( external - e.g. button name, shape, range object etc. - only in vba mode )
SbiArgvStack* pArgvStk; // ARGV-Stack
SbiGosubStack* pGosubStk; // GOSUB stack
SbiForStack* pForStk; // FOR/NEXT-Stack
- sal_uInt16 nExprLvl; // Tiefe des Expr-Stacks
- sal_uInt16 nGosubLvl; // Zum Vermeiden von Tot-Rekursionen
+ sal_uInt16 nExprLvl; // depth of the expr-stack
+ sal_uInt16 nGosubLvl; // to prevent dead-recursions
sal_uInt16 nForLvl; // #118235: Maintain for level
- const sal_uInt8* pCode; // aktueller Code-Pointer
- const sal_uInt8* pStmnt; // Beginn des lezten Statements
- const sal_uInt8* pError; // Adresse des aktuellen Error-Handlers
- const sal_uInt8* pRestart; // Restart-Adresse
- const sal_uInt8* pErrCode; // Restart-Adresse RESUME NEXT
+ const sal_uInt8* pCode; // current Code-Pointer
+ const sal_uInt8* pStmnt; // beginning of the last statement
+ const sal_uInt8* pError; // address of the current error handler
+ const sal_uInt8* pRestart; // restart-address
+ const sal_uInt8* pErrCode; // restart-adresse RESUME NEXT
const sal_uInt8* pErrStmnt; // Restart-Adresse RESUMT 0
- String aLibName; // Lib-Name fuer Declare-Call
- SbxArrayRef refParams; // aktuelle Prozedur-Parameter
- SbxArrayRef refLocals; // lokale Variable
- SbxArrayRef refArgv; // aktueller Argv
- // #74254, Ein refSaveObj reicht nicht! Neu: pRefSaveList (s.u.)
- short nArgc; // aktueller Argc
- sal_Bool bRun; // sal_True: Programm ist aktiv
- sal_Bool bError; // sal_True: Fehler behandeln
- sal_Bool bInError; // sal_True: in einem Fehler-Handler
+ String aLibName; // Lib-name for declare-call
+ SbxArrayRef refParams; // current procedure parameters
+ SbxArrayRef refLocals; // local variable
+ SbxArrayRef refArgv;
+ // #74254, one refSaveObj is not enough! new: pRefSaveList (see above)
+ short nArgc;
+ sal_Bool bRun;
+ sal_Bool bError; // sal_True: handle errors
+ sal_Bool bInError; // sal_True: in an error handler
sal_Bool bBlocked; // sal_True: blocked by next call level, #i48868
sal_Bool bVBAEnabled;
sal_uInt16 nFlags; // Debugging-Flags
- SbError nError; // letzter Fehler
- sal_uInt16 nOps; // Opcode-Zaehler
+ SbError nError;
+ sal_uInt16 nOps; // opcode counter
sal_uInt32 m_nLastTime;
- RefSaveItem* pRefSaveList; // #74254 Temporaere Referenzen sichern
- RefSaveItem* pItemStoreList; // Unbenutzte Items aufbewahren
+ RefSaveItem* pRefSaveList; // #74254 save temporary references
+ RefSaveItem* pItemStoreList; // keep unused items
void SaveRef( SbxVariable* pVar )
{
RefSaveItem* pItem = pItemStoreList;
@@ -327,43 +326,43 @@ class SbiRuntime
void SetupArgs( SbxVariable*, sal_uInt32 );
SbxVariable* CheckArray( SbxVariable* );
- void PushVar( SbxVariable* ); // Variable push
- SbxVariableRef PopVar(); // Variable pop
- SbxVariable* GetTOS( short=0 ); // Variable vom TOS holen
- void TOSMakeTemp(); // TOS in temp. Variable wandeln
- sal_Bool ClearExprStack(); // Expr-Stack freigeben
+ void PushVar( SbxVariable* );
+ SbxVariableRef PopVar();
+ SbxVariable* GetTOS( short=0 );
+ void TOSMakeTemp();
+ sal_Bool ClearExprStack();
- void PushGosub( const sal_uInt8* ); // GOSUB-Element push
- void PopGosub(); // GOSUB-Element pop
- void ClearGosubStack(); // GOSUB-Stack freigeben
+ void PushGosub( const sal_uInt8* );
+ void PopGosub();
+ void ClearGosubStack();
- void PushArgv(); // Argv-Element push
- void PopArgv(); // Argv-Element pop
- void ClearArgvStack(); // Argv-Stack freigeben
+ void PushArgv();
+ void PopArgv();
+ void ClearArgvStack();
- void PushFor(); // For-Element push
- void PushForEach(); // For-Each-Element push
- void PopFor(); // For-Element pop
- void ClearForStack(); // For-Stack freigeben
+ void PushFor();
+ void PushForEach();
+ void PopFor();
+ void ClearForStack();
- void StepArith( SbxOperator ); // arithmetische Verknuepfungen
- void StepUnary( SbxOperator ); // unaere Verknuepfungen
- void StepCompare( SbxOperator );// Vergleiche
+ void StepArith( SbxOperator );
+ void StepUnary( SbxOperator );
+ void StepCompare( SbxOperator );
- void SetParameters( SbxArray* );// Parameter uebernehmen
+ void SetParameters( SbxArray* );
- // MUSS NOCH IMPLEMENTIERT WERDEN
+ // HAS TO BE IMPLEMENTED SOME TIME
void DllCall( const String&, const String&, SbxArray*, SbxDataType, sal_Bool );
- // #56204 DIM-Funktionalitaet in Hilfsmethode auslagern (step0.cxx)
+ // #56204 swap out DIM-functionality into help method (step0.cxx)
void DimImpl( SbxVariableRef refVar );
bool implIsClass( SbxObject* pObj, const ::rtl::OUString& aClass );
void StepSETCLASS_impl( sal_uInt32 nOp1, bool bHandleDflt = false );
- // Die nachfolgenden Routinen werden vom Single Stepper
- // gerufen und implementieren die einzelnen Opcodes
+ // the following routines are called by the single
+ // stepper and implement the single opcodes
void StepNOP(), StepEXP(), StepMUL(), StepDIV();
void StepMOD(), StepPLUS(), StepMINUS(), StepNEG();
void StepEQ(), StepNE(), StepLT(), StepGT();
@@ -382,7 +381,7 @@ class SbiRuntime
void StepRESTART(), StepEMPTY(), StepLEAVE();
void StepLSET(), StepRSET(), StepREDIMP_ERASE(), StepERASE_CLEAR();
void StepARRAYACCESS(), StepBYVAL();
- // Alle Opcodes mit einem Operanden
+ // all opcodes with one operand
void StepLOADNC( sal_uInt32 ), StepLOADSC( sal_uInt32 ), StepLOADI( sal_uInt32 );
void StepARGN( sal_uInt32 ), StepBASED( sal_uInt32 ), StepPAD( sal_uInt32 );
void StepJUMP( sal_uInt32 ), StepJUMPT( sal_uInt32 );
@@ -392,7 +391,7 @@ class SbiRuntime
void StepRESUME( sal_uInt32 ), StepSETCLASS( sal_uInt32 ), StepVBASETCLASS( sal_uInt32 ), StepTESTCLASS( sal_uInt32 ), StepLIB( sal_uInt32 );
bool checkClass_Impl( const SbxVariableRef& refVal, const ::rtl::OUString& aClass, bool bRaiseErrors, bool bDefault = true );
void StepCLOSE( sal_uInt32 ), StepPRCHAR( sal_uInt32 ), StepARGTYP( sal_uInt32 );
- // Alle Opcodes mit zwei Operanden
+ // all opcodes with two operands
void StepRTL( sal_uInt32, sal_uInt32 ), StepPUBLIC( sal_uInt32, sal_uInt32 ), StepPUBLIC_P( sal_uInt32, sal_uInt32 );
void StepPUBLIC_Impl( sal_uInt32, sal_uInt32, bool bUsedForClassModule );
void StepFIND_Impl( SbxObject* pObj, sal_uInt32 nOp1, sal_uInt32 nOp2, SbError, sal_Bool bLocal, sal_Bool bStatic = sal_False );
@@ -413,18 +412,18 @@ public:
void SetVBAEnabled( bool bEnabled );
sal_uInt16 GetImageFlag( sal_uInt16 n ) const;
sal_uInt16 GetBase();
- xub_StrLen nLine,nCol1,nCol2; // aktuelle Zeile, Spaltenbereich
+ xub_StrLen nLine,nCol1,nCol2;
SbiRuntime* pNext; // Stack-Chain
SbiRuntime( SbModule*, SbMethod*, sal_uInt32 );
~SbiRuntime();
- void Error( SbError, bool bVBATranslationAlreadyDone = false ); // Fehler setzen, falls != 0
- void Error( SbError, const String& ); // Fehler setzen, falls != 0
- void FatalError( SbError ); // Fehlerbehandlung=Standard, Fehler setzen
- void FatalError( SbError, const String& ); // Fehlerbehandlung=Standard, Fehler setzen
+ void Error( SbError, bool bVBATranslationAlreadyDone = false ); // set error if != 0
+ void Error( SbError, const String& ); // set error if != 0
+ void FatalError( SbError ); // error handling = standard, set error
+ void FatalError( SbError, const String& ); // error handling = standard, set error
static sal_Int32 translateErrorToVba( SbError nError, String& rMsg );
void DumpPCode();
- sal_Bool Step(); // Einzelschritt (ein Opcode)
+ sal_Bool Step(); // single step (one opcode)
void Stop() { bRun = sal_False; }
sal_Bool IsRun() { return bRun; }
void block( void ) { bBlocked = sal_True; }
@@ -460,7 +459,7 @@ inline void checkArithmeticOverflow( SbxVariable* pVar )
}
}
-// Hilfsfunktion, um aktives Basic zu finden
+
StarBASIC* GetCurrentBasic( StarBASIC* pRTBasic );
// Get information if security restrictions should be
diff --git a/basic/source/inc/sbcomp.hxx b/basic/source/inc/sbcomp.hxx
index 2918e67880f0..1cb8e14d9271 100644
--- a/basic/source/inc/sbcomp.hxx
+++ b/basic/source/inc/sbcomp.hxx
@@ -29,12 +29,12 @@
#ifndef _SBCOMP_HXX
#define _SBCOMP_HXX
-// das folgende habe ich der neuen Datei von MD entnommen! (MT)
+// I've taken the following from the new file by MD! (MT)
#include "sbintern.hxx"
-#include "token.hxx" // Tokenizer
-#include "symtbl.hxx" // Symbolverwaltung
-#include "parser.hxx" // Parser
-#include "codegen.hxx" // Code-Generator
+#include "token.hxx"
+#include "symtbl.hxx"
+#include "parser.hxx"
+#include "codegen.hxx"
#endif
diff --git a/basic/source/inc/sbintern.hxx b/basic/source/inc/sbintern.hxx
index 501b278c4e52..df6ce57152b8 100644
--- a/basic/source/inc/sbintern.hxx
+++ b/basic/source/inc/sbintern.hxx
@@ -87,7 +87,7 @@ public:
SbModule* FindClass( const String& rClassName );
};
-// Stack fuer die im Fehlerfall abgebaute SbiRuntime Kette
+// stack for the SbiRuntime chain which is removed in the case of an error
class BASIC_DLLPUBLIC SbErrorStackEntry
{
public:
@@ -153,27 +153,27 @@ private:
struct SbiGlobals
{
- SbiInstance* pInst; // alle aktiven Runtime-Instanzen
+ SbiInstance* pInst; // all active runtime instances
SbiFactory* pSbFac; // StarBASIC-Factory
- SbUnoFactory* pUnoFac; // Factory fuer Uno-Structs bei DIM AS NEW
+ SbUnoFactory* pUnoFac; // Factory for Uno-Structs at DIM AS NEW
SbTypeFactory* pTypeFac; // Factory for user defined types
SbClassFactory* pClassFac; // Factory for user defined classes (based on class modules)
SbOLEFactory* pOLEFac; // Factory for OLE types
SbFormFactory* pFormFac; // Factory for user forms
- SbModule* pMod; // aktuell aktives Modul
- SbModule* pCompMod; // aktuell compiliertes Modul
- short nInst; // Anzahl BASICs
- Link aErrHdl; // globaler Error-Handler
- Link aBreakHdl; // globaler Break-Handler
- SbError nCode; // aktueller Fehlercode
- xub_StrLen nLine; // aktuelle Zeile
- xub_StrLen nCol1,nCol2; // aktuelle Spalten (von,bis)
- sal_Bool bCompiler; // Flag fuer Compiler-Error
- sal_Bool bGlobalInitErr; // Beim GlobalInit trat ein Compiler-Fehler auf
- sal_Bool bRunInit; // sal_True, wenn RunInit vom Basic aktiv ist
- String aErrMsg; // Puffer fuer GetErrorText()
- SbLanguageMode eLanguageMode; // Flag fuer Visual-Basic-Script-Modus
- SbErrorStack* pErrStack; // Stack fuer die im Fehlerfall abgebaute SbiRuntime Kette
+ SbModule* pMod; // currently active module
+ SbModule* pCompMod; // currently compiled module
+ short nInst; // number of BASICs
+ Link aErrHdl; // global error handler
+ Link aBreakHdl; // global break handler
+ SbError nCode;
+ xub_StrLen nLine;
+ xub_StrLen nCol1,nCol2; // from... to...
+ sal_Bool bCompiler; // flag for compiler error
+ sal_Bool bGlobalInitErr;
+ sal_Bool bRunInit; // sal_True, if RunInit active from the Basic
+ String aErrMsg; // buffer for GetErrorText()
+ SbLanguageMode eLanguageMode; // flag for Visual-Basic-Script-Modus
+ SbErrorStack* pErrStack; // for the SbiRuntime chain
::utl::TransliterationWrapper* pTransliterationWrapper; // For StrComp
sal_Bool bBlockCompilerError;
BasicManager* pAppBasMgr;
@@ -183,7 +183,7 @@ struct SbiGlobals
~SbiGlobals();
};
-// Utility-Makros und -Routinen
+// utility macros and routines
BASIC_DLLPUBLIC SbiGlobals* GetSbData();
diff --git a/basic/source/inc/sbjsmeth.hxx b/basic/source/inc/sbjsmeth.hxx
index f2cc8a3d3865..d37ba22a4de1 100644
--- a/basic/source/inc/sbjsmeth.hxx
+++ b/basic/source/inc/sbjsmeth.hxx
@@ -32,9 +32,9 @@
#include <basic/sbmeth.hxx>
-// Basic-Modul fuer JavaScript-Sourcen.
-// Alle Basic-spezifischen Methoden muessen virtuell ueberladen und deaktiviert
-// werden. Die Unterscheidung von normalen Modulen erfolgt uebr RTTI.
+// basic module for JavaScript sources
+// All the basic-specific methods must be overloaded virtually and must
+// be deactivated. The differentiation of normal modules is done by RTTI.
class SbJScriptMethod : public SbMethod
{
diff --git a/basic/source/inc/sbjsmod.hxx b/basic/source/inc/sbjsmod.hxx
index 55091dc681c5..7c00874de63a 100644
--- a/basic/source/inc/sbjsmod.hxx
+++ b/basic/source/inc/sbjsmod.hxx
@@ -31,9 +31,9 @@
#include <basic/sbmod.hxx>
-// Basic-Modul fuer JavaScript-Sourcen.
-// Alle Basic-spezifischen Methoden muessen virtuell ueberladen und deaktiviert
-// werden. Die Unterscheidung von normalen Modulen erfolgt uebr RTTI.
+// basic module for JavaScript sources
+// All the basic-specific methods must be overloaded virtually and must
+// be deactivated. The differentiation of normal modules is done by RTTI.
class SbJScriptModule : public SbModule
{
@@ -42,7 +42,7 @@ class SbJScriptModule : public SbModule
public:
SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_JSCRIPTMOD,1);
TYPEINFO();
- SbJScriptModule( const String& ); // DURCHREICHEN
+ SbJScriptModule( const String& ); // hand through
};
#endif
diff --git a/basic/source/inc/sbunoobj.hxx b/basic/source/inc/sbunoobj.hxx
index cc0f03903f17..5e833c26795d 100644
--- a/basic/source/inc/sbunoobj.hxx
+++ b/basic/source/inc/sbunoobj.hxx
@@ -56,11 +56,11 @@ class SbUnoObject: public SbxObject
sal_Bool bNativeCOMObject;
::com::sun::star::uno::Any maTmpUnoObj; // Only to save obj for doIntrospection!
- // Hilfs-Methode zum Anlegen der dbg_-Properties
+ // help method to establish the dbg_-properties
void implCreateDbgProperties( void );
- // Hilfs-Methode zum Anlegen aller Properties und Methoden
- // (Beim on-demand-Mechanismus erforderlich fuer die dbg_-Properties)
+ // help method to establish all properties and methods
+ // (on the on-demand-mechanism required for the dbg_-properties)
void implCreateAll( void );
public:
@@ -69,17 +69,17 @@ public:
SbUnoObject( const ::rtl::OUString& aName_, const ::com::sun::star::uno::Any& aUnoObj_ );
~SbUnoObject();
- // #76470 Introspection on Demand durchfuehren
+ // #76470 do introspection on demand
void doIntrospection( void );
- // Find ueberladen, um z.B. NameAccess zu unterstuetzen
+ // Find overloaded to support e. g. NameAccess
virtual SbxVariable* Find( const String&, SbxClassType );
// Force creation of all properties for debugging
void createAllProperties( void )
{ implCreateAll(); }
- // Wert rausgeben
+ // give out value
::com::sun::star::uno::Any getUnoAny( void );
::com::sun::star::uno::Reference< ::com::sun::star::beans::XIntrospectionAccess > getIntrospectionAccess( void ) { return mxUnoAccess; }
::com::sun::star::uno::Reference< ::com::sun::star::script::XInvocation > getInvocation( void ) { return mxInvocation; }
@@ -92,7 +92,7 @@ public:
SV_DECL_IMPL_REF(SbUnoObject);
-// #67781 Rueckgabewerte der Uno-Methoden loeschen
+// #67781 delete return values of the uno-methods
void clearUnoMethods( void );
void clearUnoMethodsForBasic( StarBASIC* pBasic );
@@ -105,7 +105,7 @@ class SbUnoMethod : public SbxMethod
::com::sun::star::uno::Reference< ::com::sun::star::reflection::XIdlMethod > m_xUnoMethod;
::com::sun::star::uno::Sequence< ::com::sun::star::reflection::ParamInfo >* pParamInfoSeq;
- // #67781 Verweis auf vorige und naechste Methode in der Methoden-Liste
+ // #67781 reference to the previous and the next method in the method list
SbUnoMethod* pPrev;
SbUnoMethod* pNext;
@@ -134,7 +134,6 @@ class SbUnoProperty : public SbxProperty
{
friend class SbUnoObject;
- // Daten der Uno-Property
::com::sun::star::beans::Property aUnoProp;
sal_Int32 nId;
@@ -150,7 +149,7 @@ public:
{ return mbInvocation; }
};
-// Factory-Klasse fuer das Anlegen von Uno-Structs per DIM AS NEW
+// factory class to create uno-structs per DIM AS NEW
class SbUnoFactory : public SbxFactory
{
public:
@@ -158,7 +157,7 @@ public:
virtual SbxObject* CreateObject( const String& );
};
-// Wrapper fuer eine Uno-Klasse
+// wrapper for an uno-class
class SbUnoClass : public SbxObject
{
const ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XIdlClass > m_xClass;
@@ -173,18 +172,18 @@ public:
, m_xClass( xClass_ )
{}
- // Find ueberladen, um Elemente on Demand anzulegen
+
virtual SbxVariable* Find( const String&, SbxClassType );
- // Wert rausgeben
+
const ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XIdlClass >& getUnoClass( void ) { return m_xClass; }
};
SV_DECL_IMPL_REF(SbUnoClass);
-// Funktion, um einen globalen Bezeichner im
-// UnoScope zu suchen und fuer Sbx zu wrappen
+// function to find a global identifier in
+// the UnoScope and to wrap it for Sbx
SbUnoClass* findUnoClass( const ::rtl::OUString& rName );
@@ -290,7 +289,7 @@ public:
class StarBASIC;
-// Impl-Methoden fuer RTL
+// Impl-methods for RTL
void RTL_Impl_CreateUnoStruct( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite );
void RTL_Impl_CreateUnoService( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite );
void RTL_Impl_CreateUnoServiceWithArguments( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite );
diff --git a/basic/source/inc/scanner.hxx b/basic/source/inc/scanner.hxx
index 5abfc1efdd3c..06447faa9e3b 100644
--- a/basic/source/inc/scanner.hxx
+++ b/basic/source/inc/scanner.hxx
@@ -32,43 +32,42 @@
#include <tools/string.hxx>
#include <basic/sberrors.hxx>
-// Der Scanner ist stand-alone, d.h. er kann von ueberallher verwendet
-// werden. Eine BASIC-Instanz ist fuer Fehlermeldungen notwendig. Ohne
-// BASIC werden die Fehler nur gezaehlt. Auch ist Basic notwendig, wenn
-// eine erweiterte SBX-Variable zur Erkennung von Datentypen etc. verwendet
-// werden soll.
+// The scanner is stand-alone, i. e. it can be used from everywhere.
+// A BASIC-instance is necessary for error messages. Without BASIC
+// the errors are only counted. Also the BASICC is necessary when an
+// advanced SBX-variable shall be used for data type recognition etc.
class StarBASIC;
class SbiScanner
{
- ::rtl::OUString aBuf; // Input-Puffer
- ::rtl::OUString aLine; // aktuelle Zeile
- const sal_Unicode* pLine; // Pointer
- const sal_Unicode* pSaveLine; // Merker fuer Line
+ ::rtl::OUString aBuf; // input buffer
+ ::rtl::OUString aLine;
+ const sal_Unicode* pLine;
+ const sal_Unicode* pSaveLine;
protected:
- String aSym; // Symbolpuffer
- String aError; // Fehler-String
- SbxDataType eScanType; // evtl. Datentyp
- StarBASIC* pBasic; // Instanz fuer Fehler-Callbacks
- double nVal; // numerischer Wert
- short nCurCol1; // aktuelle Spalte 1
- short nSavedCol1; // gerettete Spalte 1
- short nCol; // aktuelle Spaltennummer
- short nErrors; // Anzahl Fehler
- short nColLock; // Lock-Zaehler fuer Col1
- sal_Int32 nBufPos; // aktuelle Buffer-Pos
- sal_uInt16 nLine; // aktuelle Zeile
- sal_uInt16 nCol1, nCol2; // aktuelle 1. und 2. Spalte
- sal_Bool bSymbol; // sal_True: Symbol gescannt
- sal_Bool bNumber; // sal_True: Zahl gescannt
- sal_Bool bSpaces; // sal_True: Whitespace vor Token
- sal_Bool bErrors; // sal_True: Fehler generieren
- sal_Bool bAbort; // sal_True: abbrechen
- sal_Bool bHash; // sal_True: # eingelesen
- sal_Bool bError; // sal_True: Fehler generieren
- sal_Bool bUsedForHilite; // sal_True: Nutzung fuer Highlighting
- sal_Bool bCompatible; // sal_True: OPTION Compatibl
+ String aSym;
+ String aError;
+ SbxDataType eScanType;
+ StarBASIC* pBasic; // instance for error callbacks
+ double nVal; // numeric value
+ short nCurCol1;
+ short nSavedCol1;
+ short nCol;
+ short nErrors;
+ short nColLock; // lock counter for Col1
+ sal_Int32 nBufPos;
+ sal_uInt16 nLine;
+ sal_uInt16 nCol1, nCol2;
+ sal_Bool bSymbol; // sal_True: symbol scanned
+ sal_Bool bNumber; // sal_True: number scanned
+ sal_Bool bSpaces; // sal_True: whitespace before token
+ sal_Bool bErrors; // sal_True: generate errors
+ sal_Bool bAbort;
+ sal_Bool bHash; // sal_True: # has been read in
+ sal_Bool bError; // sal_True: generate error
+ sal_Bool bUsedForHilite;
+ sal_Bool bCompatible; // sal_True: OPTION compatible
sal_Bool bVBASupportOn; // sal_True: OPTION VBASupport 1 otherwise default False
sal_Bool bPrevLineExtentsComment; // sal_True: Previous line is comment and ends on "... _"
@@ -96,7 +95,7 @@ public:
void UnlockColumn();
sal_Bool DoesColonFollow();
- sal_Bool NextSym(); // naechstes Symbol lesen
+ sal_Bool NextSym();
const String& GetSym() { return aSym; }
SbxDataType GetType() { return eScanType; }
double GetDbl() { return nVal; }
diff --git a/basic/source/inc/symtbl.hxx b/basic/source/inc/symtbl.hxx
index a52d8c499a07..60223ba617fa 100644
--- a/basic/source/inc/symtbl.hxx
+++ b/basic/source/inc/symtbl.hxx
@@ -34,11 +34,11 @@
#include <basic/sbxdef.hxx>
#include <basic/sbdef.hxx>
-class SbiSymDef; // Basisklasse
-class SbiProcDef; // Prozedur
-class SbiConstDef; // Konstante
-class SbiSymPool; // Symbol-Pool
-class SbiStringPool; // gepoolte Strings
+class SbiSymDef; // base class
+class SbiProcDef;
+class SbiConstDef;
+class SbiSymPool;
+class SbiStringPool;
class SvStream;
class SbiParser;
@@ -46,21 +46,21 @@ class SbiParser;
enum SbiSymScope { SbLOCAL, SbPARAM, SbPUBLIC, SbGLOBAL, SbRTL };
-// Der String-Pool nimmt String-Eintraege auf und sorgt dafuer,
-// dass sie nicht doppelt vorkommen.
+// The string-pool collects string entries and
+// makes sure that they don't exist twice.
SV_DECL_PTRARR_DEL(SbiStrings,String*,5,5)
-class SbiStringPool { // String-Pool
- SbiStrings aData; // Daten
+class SbiStringPool {
+ SbiStrings aData;
String aEmpty; // for convenience
- SbiParser* pParser; // der Parser
+ SbiParser* pParser;
public:
SbiStringPool( SbiParser* );
~SbiStringPool();
sal_uInt16 GetSize() const { return aData.Count(); }
- // AB 8.4.1999, Default wegen #64236 auf sal_True geaendert
- // Wenn der Bug sauber behoben ist, wieder auf sal_False aendern.
+ // From 8.4.1999: default changed to sal_True because of #64236 -
+ // change it back to sal_False when the bug is cleanly removed.
short Add( const String&, sal_Bool=sal_True );
short Add( double, SbxDataType );
const String& Find( sal_uInt16 ) const;
@@ -70,17 +70,17 @@ public:
SV_DECL_PTRARR_DEL(SbiSymbols,SbiSymDef*,5,5)
-class SbiSymPool { // Symbol-Pool
+class SbiSymPool {
friend class SbiSymDef;
friend class SbiProcDef;
protected:
- SbiStringPool& rStrings; // verwendeter Stringpool
- SbiSymbols aData; // Daten
- SbiSymPool* pParent; // uebergeordneter Symbol-Pool
- SbiParser* pParser; // der Parser
- SbiSymScope eScope; // Scope des Pools
- sal_uInt16 nProcId; // aktuelles ProcId fuer STATIC-Variable
- sal_uInt16 nCur; // Iterator
+ SbiStringPool& rStrings;
+ SbiSymbols aData;
+ SbiSymPool* pParent;
+ SbiParser* pParser;
+ SbiSymScope eScope;
+ sal_uInt16 nProcId; // for STATIC-variable
+ sal_uInt16 nCur; // iterator
public:
SbiSymPool( SbiStringPool&, SbiSymScope );
~SbiSymPool();
@@ -94,41 +94,41 @@ public:
void SetScope( SbiSymScope s ) { eScope = s; }
SbiParser* GetParser() { return pParser; }
- SbiSymDef* AddSym( const String& ); // Symbol hinzufuegen
- SbiProcDef* AddProc( const String& );// Prozedur hinzufuegen
- void Add( SbiSymDef* ); // Symbol uebernehmen
- SbiSymDef* Find( const String& ) const;// Variablenname
- SbiSymDef* FindId( sal_uInt16 ) const; // Variable per ID suchen
- SbiSymDef* Get( sal_uInt16 ) const; // Variable per Position suchen
- SbiSymDef* First(), *Next(); // Iteratoren
-
- sal_uInt32 Define( const String& ); // Label definieren
- sal_uInt32 Reference( const String& ); // Label referenzieren
- void CheckRefs(); // offene Referenzen suchen
+ SbiSymDef* AddSym( const String& );
+ SbiProcDef* AddProc( const String& );
+ void Add( SbiSymDef* );
+ SbiSymDef* Find( const String& ) const; // variable name
+ SbiSymDef* FindId( sal_uInt16 ) const;
+ SbiSymDef* Get( sal_uInt16 ) const; // find variable per position
+ SbiSymDef* First(), *Next(); // iterators
+
+ sal_uInt32 Define( const String& );
+ sal_uInt32 Reference( const String& );
+ void CheckRefs();
};
-class SbiSymDef { // Allgemeiner Symboleintrag
+class SbiSymDef { // general symbol entry
friend class SbiSymPool;
protected:
- String aName; // Name des Eintrags
- SbxDataType eType; // Typ des Eintrags
- SbiSymPool* pIn; // Parent-Pool
- SbiSymPool* pPool; // Pool fuer Unterelemente
- short nLen; // Stringlaenge bei STRING*n
- short nDims; // Array-Dimensionen
- sal_uInt16 nId; // Symbol-Nummer
- sal_uInt16 nTypeId; // String-ID des Datentyps (Dim X AS Dytentyp)
- sal_uInt16 nProcId; // aktuelles ProcId fuer STATIC-Variable
- sal_uInt16 nPos; // Positions-Nummer
- sal_uInt32 nChain; // Backchain-Kette
+ String aName;
+ SbxDataType eType;
+ SbiSymPool* pIn; // parent pool
+ SbiSymPool* pPool; // pool for sub-elements
+ short nLen; // string length for STRING*n
+ short nDims;
+ sal_uInt16 nId;
+ sal_uInt16 nTypeId; // Dim X AS data type
+ sal_uInt16 nProcId;
+ sal_uInt16 nPos;
+ sal_uInt32 nChain;
sal_Bool bNew : 1; // sal_True: Dim As New...
- sal_Bool bChained : 1; // sal_True: Symbol ist in Code definiert
- sal_Bool bByVal : 1; // sal_True: ByVal-Parameter
- sal_Bool bOpt : 1; // sal_True: optionaler Parameter
- sal_Bool bStatic : 1; // sal_True: STATIC-Variable
- sal_Bool bAs : 1; // sal_True: Datentyp per AS XXX definiert
- sal_Bool bGlobal : 1; // sal_True: Global-Variable
+ sal_Bool bChained : 1; // sal_True: symbol is defined in code
+ sal_Bool bByVal : 1; // sal_True: ByVal-parameter
+ sal_Bool bOpt : 1; // sal_True: optional parameter
+ sal_Bool bStatic : 1; // sal_True: STATIC variable
+ sal_Bool bAs : 1; // sal_True: data type defined per AS XXX
+ sal_Bool bGlobal : 1; // sal_True: global variable
sal_Bool bParamArray : 1; // sal_True: ParamArray parameter
sal_Bool bWithEvents : 1; // sal_True: Declared WithEvents
sal_Bool bWithBrackets : 1; // sal_True: Followed by ()
@@ -180,24 +180,24 @@ public:
void SetFixedStringLength( short n ) { nFixedStringLength = n; }
SbiSymPool& GetPool();
- sal_uInt32 Define(); // Symbol in Code definieren
- sal_uInt32 Reference(); // Symbol in Code referenzieren
+ sal_uInt32 Define(); // define symbol in code
+ sal_uInt32 Reference(); // reference symbol in code
private:
SbiSymDef( const SbiSymDef& );
};
-class SbiProcDef : public SbiSymDef { // Prozedur-Definition (aus Basic):
- SbiSymPool aParams; // Parameter
- SbiSymPool aLabels; // lokale Sprungziele
- String aLibName; // LIB "name"
- String aAlias; // ALIAS "name"
- sal_uInt16 nLine1, nLine2; // Zeilenbereich
+class SbiProcDef : public SbiSymDef { // procedure definition (from basic):
+ SbiSymPool aParams;
+ SbiSymPool aLabels; // local jump targets
+ String aLibName;
+ String aAlias;
+ sal_uInt16 nLine1, nLine2; // line area
PropertyMode mePropMode; // Marks if this is a property procedure and which
String maPropName; // Property name if property procedure (!= proc name)
- sal_Bool bCdecl : 1; // sal_True: CDECL angegeben
- sal_Bool bPublic : 1; // sal_True: proc ist PUBLIC
+ sal_Bool bCdecl : 1; // sal_True: CDECL given
+ sal_Bool bPublic : 1; // sal_True: proc is PUBLIC
sal_Bool mbProcDecl : 1; // sal_True: instanciated by SbiParser::ProcDecl
public:
SbiProcDef( SbiParser*, const String&, sal_Bool bProcDecl=false );
@@ -222,9 +222,8 @@ public:
void setPropertyMode( PropertyMode ePropMode );
const String& GetPropName() { return maPropName; }
- // Match mit einer Forward-Deklaration. Die Parameternamen
- // werden abgeglichen und die Forward-Deklaration wird
- // durch this ersetzt
+ // Match with a forward-declaration. The parameter names are
+ // compared and the forward declaration is replaced by this
void Match( SbiProcDef* pForward );
private:
diff --git a/basic/source/inc/token.hxx b/basic/source/inc/token.hxx
index deb6764f2e2c..666c8e4ee8ff 100644
--- a/basic/source/inc/token.hxx
+++ b/basic/source/inc/token.hxx
@@ -37,28 +37,28 @@
#undef SHARED
#endif
-// Der Tokenizer ist stand-alone, d.h. er kann von ueberallher verwendet
-// werden. Eine BASIC-Instanz ist fuer Fehlermeldungen notwendig. Ohne
-// BASIC werden die Fehler nur gezaehlt. Auch ist Basic notwendig, wenn
-// eine erweiterte SBX-Variable zur Erkennung von Datentypen etc. verwendet
-// werden soll.
+// The tokenizer is stand-alone, i. e. he can be used from everywhere.
+// A BASIC-instance is necessary for error messages. Without BASIC the
+// errors are only counted. The BASIC is also necessary when an advanced
+// SBX-variable shall be used for recognition of data types etc.
+
enum SbiToken {
NIL = 0,
- // Token zwischen 0x20 und 0x3F sind Literale:
+ // tokens between 0x20 and 0x3F are literals:
LPAREN = '(', RPAREN = ')', COMMA = ',', DOT = '.', EXCLAM = '!',
HASH = '#', SEMICOLON = ';',
- // Anweisungen:
+ // commands:
FIRSTKWD = 0x40,
AS = FIRSTKWD, ALIAS, ASSIGN,
CALL, CASE, CLOSE, COMPARE, _CONST_,
DECLARE, DIM, DO,
- // in der Reihenfolge der Datentyp-Enums!
+ // in the order of the data type enums!
DEFINT, DEFLNG, DEFSNG, DEFDBL, DEFCUR, DEFDATE, DEFSTR, DEFOBJ,
DEFERR, DEFBOOL, DEFVAR,
- // in der Reihenfolge der Datentyp-Enums!
+ // in the order of the data type enums!
DATATYPE1,
TINTEGER = DATATYPE1,
TLONG, TSINGLE, TDOUBLE, TCURRENCY, TDATE, TSTRING, TOBJECT,
@@ -79,29 +79,29 @@ enum SbiToken {
UNTIL,
WEND, WHILE, WITH, WRITE,
ENDENUM, ENDIF, ENDFUNC, ENDPROPERTY, ENDSUB, ENDTYPE, ENDSELECT, ENDWITH,
- // Ende aller Keywords
+ // end of all keywords
LASTKWD = ENDWITH,
- // Statement-Ende
+ // statement end
EOS, EOLN,
- // Operatoren:
+ // operators:
EXPON, NEG, MUL,
DIV, IDIV, MOD, PLUS, MINUS,
EQ, NE, LT, GT, LE, GE,
NOT, AND, OR, XOR, EQV,
IMP, CAT, LIKE, IS, TYPEOF,
- // Sonstiges:
+ // miscellaneous:
FIRSTEXTRA,
NUMBER=FIRSTEXTRA, FIXSTRING, SYMBOL, _CDECL_, BYVAL, BYREF,
OUTPUT, RANDOM, APPEND, BINARY, ACCESS,
LOCK, READ, PRESERVE, BASE, ANY, LIB, _OPTIONAL_,
EXPLICIT, COMPATIBLE, CLASSMODULE, PARAMARRAY, WITHEVENTS,
- // Ab hier kommen JavaScript-Tokens (gleiches enum, damit gleicher Typ)
+ // from here there are JavaScript-tokens (same enum so that same type)
FIRSTJAVA,
JS_BREAK=FIRSTJAVA, JS_CONTINUE, JS_FOR, JS_FUNCTION, JS_IF, JS_NEW,
JS_RETURN, JS_THIS, JS_VAR, JS_WHILE, JS_WITH,
- // JavaScript-Operatoren
+ // JavaScript-operators
// _ASS_ = Assignment
JS_COMMA, JS_ASSIGNMENT, JS_ASS_PLUS, JS_ASS_MINUS, JS_ASS_MUL,
JS_ASS_DIV, JS_ASS_MOD, JS_ASS_LSHIFT, JS_ASS_RSHIFT, JS_ASS_RSHIFT_Z,
@@ -139,13 +139,13 @@ class SbiTokenizer : public SbiScanner {
TokenLabelInfo m_aTokenLabelInfo;
protected:
- SbiToken eCurTok; // aktuelles Token
- SbiToken ePush; // Pushback-Token
- sal_uInt16 nPLine, nPCol1, nPCol2; // Pushback-Location
- sal_Bool bEof; // sal_True bei Dateiende
- sal_Bool bEos; // sal_True bei Statement-Ende
- sal_Bool bKeywords; // sal_True, falls Keywords geparst werden
- sal_Bool bAs; // letztes Keyword war AS
+ SbiToken eCurTok;
+ SbiToken ePush;
+ sal_uInt16 nPLine, nPCol1, nPCol2; // pushback location
+ sal_Bool bEof;
+ sal_Bool bEos;
+ sal_Bool bKeywords; // sal_True, if keywords are parsed
+ sal_Bool bAs; // last keyword was AS
sal_Bool bErrorIsSymbol; // Handle Error token as Symbol, not keyword
public:
SbiTokenizer( const ::rtl::OUString&, StarBASIC* = NULL );
@@ -154,14 +154,14 @@ public:
inline sal_Bool IsEof() { return bEof; }
inline sal_Bool IsEos() { return bEos; }
- void Push( SbiToken ); // Pushback eines Tokens
- const String& Symbol( SbiToken );// Rueckumwandlung
+ void Push( SbiToken );
+ const String& Symbol( SbiToken ); // reconversion
- SbiToken Peek(); // das naechste Token lesen
- SbiToken Next(); // Ein Token lesen
- sal_Bool MayBeLabel( sal_Bool= sal_False ); // Kann es ein Label sein?
+ SbiToken Peek(); // read the next token
+ SbiToken Next(); // read a token
+ sal_Bool MayBeLabel( sal_Bool= sal_False );
- void Hilite( SbTextPortions& ); // Syntax-Highlighting
+ void Hilite( SbTextPortions& );
void Error( SbError c ) { GenError( c ); }
void Error( SbError, SbiToken );