summaryrefslogtreecommitdiff
path: root/basic/source/sbx/sbxexec.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'basic/source/sbx/sbxexec.cxx')
-rwxr-xr-x[-rw-r--r--]basic/source/sbx/sbxexec.cxx74
1 files changed, 37 insertions, 37 deletions
diff --git a/basic/source/sbx/sbxexec.cxx b/basic/source/sbx/sbxexec.cxx
index 9b43a94873f0..f12ffc0bf817 100644..100755
--- a/basic/source/sbx/sbxexec.cxx
+++ b/basic/source/sbx/sbxexec.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_basic.hxx"
#include <tools/errcode.hxx>
-#ifndef _APP_HXX //autogen
#include <vcl/svapp.hxx>
-#endif
#include <basic/sbx.hxx>
@@ -68,13 +67,13 @@ static const xub_Unicode* SkipWhitespace( const xub_Unicode* p )
return p;
}
-// Scannen eines Symbol. Das Symbol wird in rSym eingetragen, der Returnwert
-// ist die neue Scanposition. Bei Fehlern ist das Symbol leer.
+// Scanning of a symbol. The symbol were inserted in rSym, the return value
+// is the new scan position. The symbol is at errors empty.
static const xub_Unicode* Symbol( const xub_Unicode* p, XubString& rSym, const SbxSimpleCharClass& rCharClass )
{
sal_uInt16 nLen = 0;
- // Haben wir ein Sondersymbol?
+ // Did we have a nonstandard symbol?
if( *p == '[' )
{
rSym = ++p;
@@ -84,16 +83,16 @@ static const xub_Unicode* Symbol( const xub_Unicode* p, XubString& rSym, const S
}
else
{
- // Ein Symbol muss mit einem Buchstaben oder einem Underline beginnen
+ // A symbol had to begin with a alphabetic character or an underline
if( !rCharClass.isAlpha( *p ) && *p != '_' )
SbxBase::SetError( SbxERR_SYNTAX );
else
{
rSym = p;
- // Dann darf es Buchstaben, Zahlen oder Underlines enthalten
+ // The it can contain alphabetic characters, numbers or underlines
while( *p && (rCharClass.isAlphaNumeric( *p ) || *p == '_') )
p++, nLen++;
- // BASIC-Standard-Suffixe werden ignoriert
+ // BASIC-Standard-Suffixes were ignored
if( *p && (*p == '%' || *p == '&' || *p == '!' || *p == '#' || *p == '$' ) )
p++;
}
@@ -102,7 +101,7 @@ static const xub_Unicode* Symbol( const xub_Unicode* p, XubString& rSym, const S
return p;
}
-// Qualifizierter Name. Element.Element....
+// Qualified name. Element.Element....
static SbxVariable* QualifiedName
( SbxObject* pObj, SbxObject* pGbl, const xub_Unicode** ppBuf, SbxClassType t )
@@ -113,21 +112,21 @@ static SbxVariable* QualifiedName
const xub_Unicode* p = SkipWhitespace( *ppBuf );
if( aCharClass.isAlpha( *p ) || *p == '_' || *p == '[' )
{
- // Element einlesen
+ // Read in the element
refVar = Element( pObj, pGbl, &p, t, aCharClass );
while( refVar.Is() && (*p == '.' || *p == '!') )
{
- // Es folgt noch ein Objektelement. Das aktuelle Element
- // muss also ein SBX-Objekt sein oder liefern!
+ // It follows still an objectelement. The current element
+ // had to be a SBX-Object or had to deliver such an object!
pObj = PTR_CAST(SbxObject,(SbxVariable*) refVar);
if( !pObj )
- // Dann muss es ein Objekt liefern
+ // Then it had to deliver an object
pObj = PTR_CAST(SbxObject,refVar->GetObject());
refVar.Clear();
if( !pObj )
break;
p++;
- // Und das naechste Element bitte
+ // And the next element please
refVar = Element( pObj, pGbl, &p, t, aCharClass );
}
}
@@ -139,8 +138,8 @@ static SbxVariable* QualifiedName
return refVar;
}
-// Einlesen eines Operanden. Dies kann eine Zahl, ein String oder
-// eine Funktion (mit optionalen Parametern) sein.
+// Read in of an operand. This could be a number, a string or
+// a function (with optional parameters).
static SbxVariable* Operand
( SbxObject* pObj, SbxObject* pGbl, const xub_Unicode** ppBuf, sal_Bool bVar )
@@ -154,7 +153,7 @@ static SbxVariable* Operand
|| *p == '-'
|| *p == '&' ) )
{
- // Eine Zahl kann direkt eingescant werden!
+ // A number could be scanned in directly!
sal_uInt16 nLen;
if( !refVar->Scan( XubString( p ), &nLen ) )
refVar.Clear();
@@ -163,15 +162,15 @@ static SbxVariable* Operand
}
else if( !bVar && *p == '"' )
{
- // Ein String
+ // A string
XubString aString;
p++;
for( ;; )
{
- // Das ist wohl ein Fehler
+ // This is perhaps an error
if( !*p )
return NULL;
- // Doppelte Quotes sind OK
+ // Double quotes are OK
if( *p == '"' )
if( *++p != '"' )
break;
@@ -187,8 +186,8 @@ static SbxVariable* Operand
return refVar;
}
-// Einlesen einer einfachen Term. Die Operatoren +, -, * und /
-// werden unterstuetzt.
+// Read in of a simple term. The operands +, -, * and /
+// are supported.
static SbxVariable* MulDiv( SbxObject* pObj, SbxObject* pGbl, const xub_Unicode** ppBuf )
{
@@ -201,7 +200,7 @@ static SbxVariable* MulDiv( SbxObject* pObj, SbxObject* pGbl, const xub_Unicode*
SbxVariableRef refVar2( Operand( pObj, pGbl, &p, sal_False ) );
if( refVar2.Is() )
{
- // temporaere Variable!
+ // temporary variable!
SbxVariable* pVar = refVar;
pVar = new SbxVariable( *pVar );
refVar = pVar;
@@ -263,7 +262,7 @@ static SbxVariable* Assign( SbxObject* pObj, SbxObject* pGbl, const xub_Unicode*
{
if( *p == '=' )
{
- // Nur auf Props zuweisen!
+ // Assign only onto properties!
if( refVar->GetClass() != SbxCLASS_PROPERTY )
{
SbxBase::SetError( SbxERR_BAD_ACTION );
@@ -283,7 +282,7 @@ static SbxVariable* Assign( SbxObject* pObj, SbxObject* pGbl, const xub_Unicode*
}
}
else
- // Einfacher Aufruf: einmal aktivieren
+ // Simple call: once activating
refVar->Broadcast( SBX_HINT_DATAWANTED );
}
*ppBuf = p;
@@ -292,9 +291,9 @@ static SbxVariable* Assign( SbxObject* pObj, SbxObject* pGbl, const xub_Unicode*
return refVar;
}
-// Einlesen eines Elements. Dies ist ein Symbol, optional gefolgt
-// von einer Parameterliste. Das Symbol wird im angegebenen Objekt
-// gesucht und die Parameterliste wird ggf. angefuegt.
+// Read in of an element. This is a symbol, optional followed
+// by a parameter list. The symbol will be searched in the
+// specified object and the parameter list will be attached if necessary.
static SbxVariable* Element
( SbxObject* pObj, SbxObject* pGbl, const xub_Unicode** ppBuf,
@@ -313,29 +312,29 @@ static SbxVariable* Element
if( refVar.Is() )
{
refVar->SetParameters( NULL );
- // folgen noch Parameter?
+ // Follow still parameter?
p = SkipWhitespace( p );
if( *p == '(' )
{
p++;
SbxArrayRef refPar = new SbxArray;
sal_uInt16 nArg = 0;
- // Wird sind mal relaxed und akzeptieren auch
- // das Zeilen- oder Komandoende als Begrenzer
- // Parameter immer global suchen!
+ // We are once relaxed and accept as well
+ // the line- or commandend as delimiter
+ // Search parameter always global!
while( *p && *p != ')' && *p != ']' )
{
SbxVariableRef refArg = PlusMinus( pGbl, pGbl, &p );
if( !refArg )
{
- // Fehler beim Parsing
+ // Error during the parsing
refVar.Clear(); break;
}
else
{
- // Man kopiere den Parameter, damit
- // man den aktuellen Zustand hat (loest auch
- // den Aufruf per Zugriff aus)
+ // One copies the parameter, so that
+ // one have the current status (triggers also
+ // the call per access)
SbxVariable* pArg = refArg;
refPar->Put( new SbxVariable( *pArg ), ++nArg );
}
@@ -358,7 +357,7 @@ static SbxVariable* Element
return refVar;
}
-// Hauptroutine
+// Mainroutine
SbxVariable* SbxObject::Execute( const XubString& rTxt )
{
@@ -399,3 +398,4 @@ SbxVariable* SbxObject::FindQualified( const XubString& rName, SbxClassType t )
return pVar;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */