Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
e2b85f96
Kaydet (Commit)
e2b85f96
authored
Agu 06, 2010
tarafından
Andreas Bregas
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
mib18: #163121# Declare Rework
üst
f4f1756a
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
96 additions
and
70 deletions
+96
-70
codegen.cxx
basic/source/comp/codegen.cxx
+4
-0
dim.cxx
basic/source/comp/dim.cxx
+60
-1
exprgen.cxx
basic/source/comp/exprgen.cxx
+18
-51
exprtree.cxx
basic/source/comp/exprtree.cxx
+0
-10
expr.hxx
basic/source/inc/expr.hxx
+0
-3
symtbl.hxx
basic/source/inc/symtbl.hxx
+2
-1
basmodnode.cxx
scripting/source/basprov/basmodnode.cxx
+11
-3
basprov.cxx
scripting/source/basprov/basprov.cxx
+1
-1
No files found.
basic/source/comp/codegen.cxx
Dosyayı görüntüle @
e2b85f96
...
...
@@ -259,6 +259,10 @@ void SbiCodeGen::Save()
if
(
!
pProc
->
IsPublic
()
)
pMeth
->
SetFlag
(
SBX_PRIVATE
);
// Declare? -> Hidden
if
(
pProc
->
GetLib
().
Len
()
>
0
)
pMeth
->
SetFlag
(
SBX_HIDDEN
);
pMeth
->
nStart
=
pProc
->
GetAddr
();
pMeth
->
nLine1
=
pProc
->
GetLine1
();
pMeth
->
nLine2
=
pProc
->
GetLine2
();
...
...
basic/source/comp/dim.cxx
Dosyayı görüntüle @
e2b85f96
...
...
@@ -877,7 +877,7 @@ SbiProcDef* SbiParser::ProcDecl( BOOL bDecl )
}
if
(
bCompatible
&&
Peek
()
==
PARAMARRAY
)
{
if
(
bByVal
||
b
ByVal
||
b
Optional
)
if
(
bByVal
||
bOptional
)
Error
(
SbERR_UNEXPECTED
,
PARAMARRAY
);
Next
();
bParamArray
=
TRUE
;
...
...
@@ -949,6 +949,8 @@ void SbiParser::DefDeclare( BOOL bPrivate )
Error
(
SbERR_UNEXPECTED
,
eCurTok
);
else
{
bool
bFunction
=
(
eCurTok
==
FUNCTION
);
SbiProcDef
*
pDef
=
ProcDecl
(
TRUE
);
if
(
pDef
)
{
...
...
@@ -973,7 +975,64 @@ void SbiParser::DefDeclare( BOOL bPrivate )
aPublics
.
Add
(
pDef
);
if
(
pDef
)
{
pDef
->
SetPublic
(
!
bPrivate
);
// New declare handling
if
(
pDef
->
GetLib
().
Len
()
>
0
)
{
USHORT
nSavLine
=
nLine
;
aGen
.
Statement
();
pDef
->
Define
();
pDef
->
SetLine1
(
nSavLine
);
pDef
->
SetLine2
(
nSavLine
);
SbiSymPool
&
rPool
=
pDef
->
GetParams
();
USHORT
nParCount
=
rPool
.
GetSize
();
SbxDataType
eType
=
pDef
->
GetType
();
if
(
bFunction
)
aGen
.
Gen
(
_PARAM
,
0
,
sal
::
static_int_cast
<
UINT16
>
(
eType
)
);
if
(
nParCount
>
1
)
{
aGen
.
Gen
(
_ARGC
);
for
(
USHORT
i
=
1
;
i
<
nParCount
;
++
i
)
{
SbiSymDef
*
pParDef
=
rPool
.
Get
(
i
);
SbxDataType
eParType
=
pParDef
->
GetType
();
aGen
.
Gen
(
_PARAM
,
i
,
sal
::
static_int_cast
<
UINT16
>
(
eParType
)
);
aGen
.
Gen
(
_ARGV
);
USHORT
nTyp
=
sal
::
static_int_cast
<
USHORT
>
(
pParDef
->
GetType
()
);
if
(
pParDef
->
IsByVal
()
)
{
// Reset to avoid additional byval in call to wrapper function
pParDef
->
SetByVal
(
FALSE
);
nTyp
|=
0x8000
;
}
aGen
.
Gen
(
_ARGTYP
,
nTyp
);
}
}
aGen
.
Gen
(
_LIB
,
aGblStrings
.
Add
(
pDef
->
GetLib
()
)
);
SbiOpcode
eOp
=
pDef
->
IsCdecl
()
?
_CALLC
:
_CALL
;
USHORT
nId
=
pDef
->
GetId
();
if
(
pDef
->
GetAlias
().
Len
()
)
nId
=
(
nId
&
0x8000
)
|
aGblStrings
.
Add
(
pDef
->
GetAlias
()
);
if
(
nParCount
>
1
)
nId
|=
0x8000
;
aGen
.
Gen
(
eOp
,
nId
,
sal
::
static_int_cast
<
UINT16
>
(
eType
)
);
if
(
bFunction
)
aGen
.
Gen
(
_PUT
);
aGen
.
Gen
(
_LEAVE
);
}
}
}
}
}
...
...
basic/source/comp/exprgen.cxx
Dosyayı görüntüle @
e2b85f96
...
...
@@ -115,13 +115,8 @@ void SbiExprNode::Gen( RecursiveMode eRecMode )
}
else
{
SbiProcDef
*
pProc
=
aVar
.
pDef
->
GetProcDef
();
// per DECLARE definiert?
if
(
pProc
&&
pProc
->
GetLib
().
Len
()
)
eOp
=
pProc
->
IsCdecl
()
?
_CALLC
:
_CALL
;
else
eOp
=
(
aVar
.
pDef
->
GetScope
()
==
SbRTL
)
?
_RTL
:
(
aVar
.
pDef
->
IsGlobal
()
?
_FIND_G
:
_FIND
);
eOp
=
(
aVar
.
pDef
->
GetScope
()
==
SbRTL
)
?
_RTL
:
(
aVar
.
pDef
->
IsGlobal
()
?
_FIND_G
:
_FIND
);
}
if
(
eOp
==
_FIND
)
...
...
@@ -187,17 +182,6 @@ void SbiExprNode::GenElement( SbiOpcode eOp )
aVar
.
pPar
->
Gen
();
}
SbiProcDef
*
pProc
=
aVar
.
pDef
->
GetProcDef
();
// per DECLARE definiert?
if
(
pProc
)
{
// Dann evtl. einen LIB-Befehl erzeugen
if
(
pProc
->
GetLib
().
Len
()
)
pGen
->
Gen
(
_LIB
,
pGen
->
GetParser
()
->
aGblStrings
.
Add
(
pProc
->
GetLib
()
)
);
// und den Aliasnamen nehmen
if
(
pProc
->
GetAlias
().
Len
()
)
nId
=
(
nId
&
0x8000
)
|
pGen
->
GetParser
()
->
aGblStrings
.
Add
(
pProc
->
GetAlias
()
);
}
pGen
->
Gen
(
eOp
,
nId
,
sal
::
static_int_cast
<
UINT16
>
(
GetType
()
)
);
if
(
aVar
.
pvMorePar
)
...
...
@@ -225,11 +209,6 @@ void SbiExprList::Gen()
// AB 10.1.96: Typ-Anpassung bei DECLARE
USHORT
nCount
=
1
,
nParAnz
=
0
;
SbiSymPool
*
pPool
=
NULL
;
if
(
pProc
)
{
pPool
=
&
pProc
->
GetParams
();
nParAnz
=
pPool
->
GetSize
();
}
for
(
SbiExpression
*
pExpr
=
pFirst
;
pExpr
;
pExpr
=
pExpr
->
pNext
,
nCount
++
)
{
pExpr
->
Gen
();
...
...
@@ -239,6 +218,7 @@ void SbiExprList::Gen()
USHORT
nSid
=
pParser
->
aGblStrings
.
Add
(
pExpr
->
GetName
()
);
pParser
->
aGen
.
Gen
(
_ARGN
,
nSid
);
/* TODO: Check after Declare concept change
// AB 10.1.96: Typanpassung bei named -> passenden Parameter suchen
if( pProc )
{
...
...
@@ -246,39 +226,26 @@ void SbiExprList::Gen()
pParser->Error( SbERR_NO_NAMED_ARGS );
// Spaeter, wenn Named Args bei DECLARE moeglich
/*
for( USHORT i = 1 ; i < nParAnz ; i++ )
{
SbiSymDef* pDef = pPool->Get( i );
const String& rName = pDef->GetName();
if( rName.Len() )
{
if( pExpr->GetName().ICompare( rName )
== COMPARE_EQUAL )
{
pParser->aGen.Gen( _ARGTYP, pDef->GetType() );
break;
}
}
}
*/
//for( USHORT i = 1 ; i < nParAnz ; i++ )
//{
// SbiSymDef* pDef = pPool->Get( i );
// const String& rName = pDef->GetName();
// if( rName.Len() )
// {
// if( pExpr->GetName().ICompare( rName )
// == COMPARE_EQUAL )
// {
// pParser->aGen.Gen( _ARGTYP, pDef->GetType() );
// break;
// }
// }
//}
}
*/
}
else
{
pParser
->
aGen
.
Gen
(
_ARGV
);
// Funktion mit DECLARE -> Typ-Anpassung
if
(
pProc
&&
nCount
<
nParAnz
)
{
SbiSymDef
*
pDef
=
pPool
->
Get
(
nCount
);
USHORT
nTyp
=
sal
::
static_int_cast
<
USHORT
>
(
pDef
->
GetType
()
);
// Zustzliches Flag fr BYVAL einbauen
if
(
pDef
->
IsByVal
()
)
nTyp
|=
0x8000
;
pParser
->
aGen
.
Gen
(
_ARGTYP
,
nTyp
);
}
}
}
}
...
...
basic/source/comp/exprtree.cxx
Dosyayı görüntüle @
e2b85f96
...
...
@@ -338,15 +338,6 @@ SbiExprNode* SbiExpression::Term( const KeywordSymbolInfo* pKeywordSymbolInfo )
// damit erwischen wir n% = 5 : print n
eType
=
eDefType
;
}
// Funktion?
if
(
pDef
->
GetProcDef
()
)
{
SbiProcDef
*
pProc
=
pDef
->
GetProcDef
();
if
(
pPar
&&
pProc
->
GetLib
().
Len
()
)
// DECLARE benutzt?
pPar
->
SetProc
(
pProc
);
// Wenn keine Pars, vorerst nichts machen
// Pruefung auf Typ-Anzahl waere denkbar
}
// Typcheck bei Variablen:
// ist explizit im Scanner etwas anderes angegeben?
// Bei Methoden ist dies OK!
...
...
@@ -868,7 +859,6 @@ SbiExprList::SbiExprList( SbiParser* p )
{
pParser
=
p
;
pFirst
=
NULL
;
pProc
=
NULL
;
nExpr
=
nDim
=
0
;
bError
=
...
...
basic/source/inc/expr.hxx
Dosyayı görüntüle @
e2b85f96
...
...
@@ -234,7 +234,6 @@ class SbiExprList { // Basisklasse fuer Parameter und Dims
protected
:
SbiParser
*
pParser
;
// Parser
SbiExpression
*
pFirst
;
// Expressions
SbiProcDef
*
pProc
;
// DECLARE-Funktion (Parameter-Anpassung)
short
nExpr
;
// Anzahl Expressions
short
nDim
;
// Anzahl Dimensionen
BOOL
bError
;
// TRUE: Fehler
...
...
@@ -249,8 +248,6 @@ public:
SbiExpression
*
Get
(
short
);
BOOL
Test
(
const
SbiProcDef
&
);
// Parameter-Checks
void
Gen
();
// Code-Erzeugung
// Setzen einer Funktionsdefinition zum Abgleich der Parameter
void
SetProc
(
SbiProcDef
*
p
)
{
pProc
=
p
;
}
void
addExpression
(
SbiExpression
*
pExpr
);
};
...
...
basic/source/inc/symtbl.hxx
Dosyayı görüntüle @
e2b85f96
...
...
@@ -159,7 +159,8 @@ public:
void
SetOptional
()
{
bOpt
=
TRUE
;
}
void
SetParamArray
()
{
bParamArray
=
TRUE
;
}
void
SetWithEvents
()
{
bWithEvents
=
TRUE
;
}
void
SetByVal
()
{
bByVal
=
TRUE
;
}
void
SetByVal
(
BOOL
bByVal_
=
TRUE
)
{
bByVal
=
bByVal_
;
}
void
SetStatic
(
BOOL
bAsStatic
=
TRUE
)
{
bStatic
=
bAsStatic
;
}
void
SetNew
()
{
bNew
=
TRUE
;
}
void
SetDefinedAs
()
{
bAs
=
TRUE
;
}
...
...
scripting/source/basprov/basmodnode.cxx
Dosyayı görüntüle @
e2b85f96
...
...
@@ -97,14 +97,22 @@ namespace basprov
if
(
pMethods
)
{
sal_Int32
nCount
=
pMethods
->
Count
();
aChildNodes
.
realloc
(
nCount
);
sal_Int32
nRealCount
=
0
;
for
(
sal_Int32
i
=
0
;
i
<
nCount
;
++
i
)
{
SbMethod
*
pMethod
=
static_cast
<
SbMethod
*
>
(
pMethods
->
Get
(
static_cast
<
USHORT
>
(
i
)
)
);
if
(
pMethod
&&
!
pMethod
->
IsHidden
()
)
++
nRealCount
;
}
aChildNodes
.
realloc
(
nRealCount
);
Reference
<
browse
::
XBrowseNode
>*
pChildNodes
=
aChildNodes
.
getArray
();
sal_Int32
iTarget
=
0
;
for
(
sal_Int32
i
=
0
;
i
<
nCount
;
++
i
)
{
SbMethod
*
pMethod
=
static_cast
<
SbMethod
*
>
(
pMethods
->
Get
(
static_cast
<
USHORT
>
(
i
)
)
);
if
(
pMethod
)
pChildNodes
[
i
]
=
static_cast
<
browse
::
XBrowseNode
*
>
(
new
BasicMethodNodeImpl
(
m_xContext
,
m_sScriptingContext
,
pMethod
,
m_bIsAppScript
)
);
if
(
pMethod
&&
!
pMethod
->
IsHidden
()
)
pChildNodes
[
i
Target
++
]
=
static_cast
<
browse
::
XBrowseNode
*
>
(
new
BasicMethodNodeImpl
(
m_xContext
,
m_sScriptingContext
,
pMethod
,
m_bIsAppScript
)
);
}
}
}
...
...
scripting/source/basprov/basprov.cxx
Dosyayı görüntüle @
e2b85f96
...
...
@@ -412,7 +412,7 @@ namespace basprov
if
(
pMethods
)
{
SbMethod
*
pMethod
=
static_cast
<
SbMethod
*
>
(
pMethods
->
Find
(
aMethod
,
SbxCLASS_METHOD
)
);
if
(
pMethod
)
if
(
pMethod
&&
!
pMethod
->
IsHidden
()
)
{
if
(
m_pDocBasicManager
==
pBasicMgr
)
xScript
=
new
BasicScriptImpl
(
aDescription
,
pMethod
,
*
m_pDocBasicManager
,
m_xInvocationContext
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment