[Libreoffice-commits] core.git: basic/source
Arnaud Versini
arnaud.versini at gmail.com
Sat Jan 23 22:49:16 PST 2016
basic/source/comp/exprgen.cxx | 14 +++++++-------
basic/source/comp/exprtree.cxx | 10 ++++------
basic/source/inc/expr.hxx | 6 ++----
3 files changed, 13 insertions(+), 17 deletions(-)
New commits:
commit 49b5eed56c470975927bb7b0328337ab8a76a910
Author: Arnaud Versini <arnaud.versini at gmail.com>
Date: Sun Jan 17 14:28:13 2016 +0100
BASIC : Remove SbiExprList::pParser
Change-Id: Ib9386d97ddb12f148cf76dc71aa8c41003286f50
Reviewed-on: https://gerrit.libreoffice.org/21534
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
diff --git a/basic/source/comp/exprgen.cxx b/basic/source/comp/exprgen.cxx
index ce6ff93..96efddb 100644
--- a/basic/source/comp/exprgen.cxx
+++ b/basic/source/comp/exprgen.cxx
@@ -184,7 +184,7 @@ void SbiExprNode::GenElement( SbiCodeGen& rGen, SbiOpcode eOp )
if( aVar.pPar && aVar.pPar->GetSize() )
{
nId |= 0x8000;
- aVar.pPar->Gen();
+ aVar.pPar->Gen(rGen);
}
rGen.Gen( eOp, nId, sal::static_int_cast< sal_uInt16 >( GetType() ) );
@@ -193,7 +193,7 @@ void SbiExprNode::GenElement( SbiCodeGen& rGen, SbiOpcode eOp )
{
for( auto& pExprList: *aVar.pvMorePar )
{
- pExprList->Gen();
+ pExprList->Gen(rGen);
rGen.Gen( _ARRAYACCESS );
}
}
@@ -203,11 +203,11 @@ void SbiExprNode::GenElement( SbiCodeGen& rGen, SbiOpcode eOp )
// The first element remain available for return value etc.
// See as well SbiProcDef::SbiProcDef() in symtbl.cxx
-void SbiExprList::Gen()
+void SbiExprList::Gen(SbiCodeGen& rGen)
{
if( pFirst )
{
- pParser->aGen.Gen( _ARGC );
+ rGen.Gen( _ARGC );
// Type adjustment at DECLARE
sal_uInt16 nCount = 1;
@@ -217,8 +217,8 @@ void SbiExprList::Gen()
if( !pExpr->GetName().isEmpty() )
{
// named arg
- sal_uInt16 nSid = pParser->aGblStrings.Add( pExpr->GetName() );
- pParser->aGen.Gen( _ARGN, nSid );
+ sal_uInt16 nSid = rGen.GetParser()->aGblStrings.Add( pExpr->GetName() );
+ rGen.Gen( _ARGN, nSid );
/* TODO: Check after Declare concept change
// From 1996-01-10: Type adjustment at named -> search suitable parameter
@@ -247,7 +247,7 @@ void SbiExprList::Gen()
}
else
{
- pParser->aGen.Gen( _ARGV );
+ rGen.Gen( _ARGV );
}
}
}
diff --git a/basic/source/comp/exprtree.cxx b/basic/source/comp/exprtree.cxx
index b6ed8da..ba99c00 100644
--- a/basic/source/comp/exprtree.cxx
+++ b/basic/source/comp/exprtree.cxx
@@ -920,9 +920,8 @@ short SbiConstExpression::GetShortValue()
|*
***************************************************************************/
-SbiExprList::SbiExprList( SbiParser* p )
+SbiExprList::SbiExprList( )
{
- pParser = p;
pFirst = nullptr;
nExpr =
nDim = 0;
@@ -984,8 +983,7 @@ void SbiExprList::addExpression( SbiExpression* pExpr )
// #i79918/#i80532: bConst has never been set to true
// -> reused as bStandaloneExpression
//SbiParameters::SbiParameters( SbiParser* p, sal_Bool bConst, sal_Bool bPar) :
-SbiParameters::SbiParameters( SbiParser* p, bool bStandaloneExpression, bool bPar) :
- SbiExprList( p )
+SbiParameters::SbiParameters( SbiParser* pParser, bool bStandaloneExpression, bool bPar)
{
if( !bPar )
{
@@ -1150,9 +1148,9 @@ SbiParameters::SbiParameters( SbiParser* p, bool bStandaloneExpression, bool bPa
// A list of array dimensions is parsed. The expressions are tested for being
// numeric. The bCONST-Bit is reset when all expressions are Integer constants.
-SbiDimList::SbiDimList( SbiParser* p ) : SbiExprList( p )
+SbiDimList::SbiDimList( SbiParser* pParser )
{
- bConst = true;
+ bool bConst = true;// true: everything integer constants
if( pParser->Next() != LPAREN )
{
diff --git a/basic/source/inc/expr.hxx b/basic/source/inc/expr.hxx
index 6efa150..7bcea84 100644
--- a/basic/source/inc/expr.hxx
+++ b/basic/source/inc/expr.hxx
@@ -223,21 +223,20 @@ public: // numeric constant
class SbiExprList { // base class for parameters and dims
protected:
- SbiParser* pParser;
SbiExpression* pFirst;
short nExpr;
short nDim;
bool bError;
bool bBracket;
public:
- SbiExprList( SbiParser* );
+ SbiExprList();
virtual ~SbiExprList();
bool IsBracket() { return bBracket; }
bool IsValid() { return !bError; }
short GetSize() { return nExpr; }
short GetDims() { return nDim; }
SbiExpression* Get( short );
- void Gen(); // code generation
+ void Gen( SbiCodeGen& rGen); // code generation
void addExpression( SbiExpression* pExpr );
};
@@ -247,7 +246,6 @@ public:
};
class SbiDimList : public SbiExprList {
- bool bConst; // true: everything integer constants
public:
SbiDimList( SbiParser* ); // parsing Ctor
};
More information about the Libreoffice-commits
mailing list