26#include <osl/diagnose.h>
27#include <com/sun/star/reflection/theCoreReflection.hpp>
29#include <com/sun/star/uno/Exception.hpp>
43 bool bWithEvents =
false;
57 if( !pDim->GetDims() )
72 *ppDim = std::move(pDim);
82 if( !(bAsNewAlreadyParsed ||
Peek() ==
AS) )
86 if( !bAsNewAlreadyParsed )
90 if( !bAsNewAlreadyParsed && eTok ==
NEW )
136 OUString aCompleteName =
aSym;
141 OUString aDotStr(
'.' );
144 aCompleteName += aDotStr;
150 aCompleteName +=
aSym;
205 bool bSwitchPool =
false;
206 bool bPersistentGlobal =
false;
215 bPersistentGlobal =
true;
220 bPersistentGlobal =
true;
237 bool bPrivate = ( eFirstTok ==
PRIVATE );
294 sal_uInt32 nEndOfStaticLbl = 0;
301 bool bDefined =
false;
302 while( ( pDef =
VarDecl( &pDim, bStatic, bConst ) ) !=
nullptr )
312 bool bRtlSym =
false;
333 bool bError_ =
false;
348 delete pDef; pDef = pOld;
377 sal_uInt32 nOpnd2 = sal::static_int_cast< sal_uInt16 >( pDef->
GetType() );
385 if( nFixedStringLength >= 0 )
388 if( pDim !=
nullptr && pDim->GetDims() > 0 )
427 pDef->
SetDims( pDim->GetDims() );
442 pDef->
SetDims( pDim->GetDims() );
464 sal_uInt32 come_from = 0;
500 if( !bDefined && aExpr.
IsValid() )
539 pDef->
SetDims( pDim->GetDims() );
540 if( bPersistentGlobal )
619 while( !bDone && !
IsEof() )
621 std::unique_ptr<SbiSymDef> pElem;
636 pElem.reset(
VarDecl(&pDim,
false,
false));
643 OUString aElemName = pElem->GetName();
655 if ( pDim->GetSize() )
659 for (
short i=0;
i<pDim->GetSize();++
i )
661 sal_Int32 lb =
nBase;
664 if ( !pDim->Get(
i )->IsBased() )
666 if ( ++
i >= pDim->GetSize() )
668 pNode = pDim->Get(
i)->GetExprNode();
690 sal_uInt16 nElemTypeId = pElem->GetTypeId();
691 if( nElemTypeId != 0 )
695 if( pTypeObj !=
nullptr )
702 pTypeMembers->
Insert(pTypeElem, pTypeMembers->
Count());
727 OUString aEnumName =
aSym;
743 sal_Int32 nCurrentEnumValue = -1;
744 while( !bDone && !
IsEof() )
763 pElem =
VarDecl( &pDim,
false,
true );
786 xConvertVar->PutString( aExpr.
GetString() );
788 xConvertVar->PutDouble( aExpr.
GetValue() );
790 nCurrentEnumValue = xConvertVar->GetLong();
815 sal::static_int_cast< sal_uInt16 >( pElem->
GetType() ) );
831 pEnumElem->
PutLong( nCurrentEnumValue );
834 pEnumMembers->
Insert(pEnumElem, pEnumMembers->
Count());
889 if( !pDef->
GetLib().isEmpty() )
905 else if( pDef->
GetLib().isEmpty() )
932 bool bOptional =
false;
933 bool bParamArray =
false;
952 if( bByVal || bOptional )
990 auto pDefaultExpr = std::make_unique<SbiConstExpression>(
this);
993 sal_uInt16 nStringId;
1003 pDefaultExpr.reset();
1060 if( pDef->
GetLib().isEmpty() )
1090 if( !pDef->
GetLib().isEmpty())
1098 sal_uInt16 nSavLine =
nLine;
1105 sal_uInt16 nParCount = rPool.
GetSize();
1116 for( sal_uInt16
i = 1 ;
i < nParCount ; ++
i )
1124 sal_uInt16 nTyp = sal::static_int_cast< sal_uInt16 >( pParDef->
GetType() );
1202 sal_uInt16 l1 =
nLine;
1296 sal_uInt16 l2 =
nLine;
1353 return css::reflection::theCoreReflection::get(
1358 OSL_FAIL(
"Could not create reflection.CoreReflection.");
static bool IsExtendedTypeDeclaration()
sal_uInt32 Gen(SbiOpcode)
void BackChain(sal_uInt32 off)
void Set(double, SbxDataType)
SbxDataType GetType() const
const OUString & GetString() const
static SbiExprListPtr ParseDimList(SbiParser *)
void Gen(RecursiveMode eRecMode=UNDEFINED)
void DefEnum(bool bPrivate)
void DefProc(bool bStatic, bool bPrivate)
void StmntBlock(SbiToken)
static bool IsUnoInterface(const OUString &sTypeName)
SbiStringPool aGblStrings
void OpenBlock(SbiToken, SbiExprNode *=nullptr)
std::vector< OUString > aRequiredTypes
void DefVar(SbiOpcode eOp, bool bStatic)
void TypeDecl(SbiSymDef &, bool bAsNewAlreadyParsed=false)
void DefDeclare(bool bPrivate)
SbiSymDef * CheckRTLForSym(const OUString &rSym, SbxDataType eType)
void DefStatic(bool bPrivate)
SbiSymDef * VarDecl(SbiExprListPtr *, bool, bool)
SbiProcDef * ProcDecl(bool bDecl)
void SetLine1(sal_uInt16 n)
bool IsUsedForProcDecl() const
void setPropertyMode(PropertyMode ePropMode)
void Match(SbiProcDef *pForward)
PropertyMode getPropertyMode() const
void SetLine2(sal_uInt16 n)
virtual void SetType(SbxDataType) override
bool IsVBASupportOn() const
OUString Find(sal_uInt32) const
short Add(const OUString &)
SbiSymScope GetScope() const
virtual SbiProcDef * GetProcDef()
virtual SbiConstDef * GetConstDef()
sal_uInt16 GetTypeId() const
SbxDataType GetType() const
void SetDefaultId(sal_uInt16 n)
const OUString & GetName()
short GetFixedStringLength() const
void SetTypeId(sal_uInt16 n)
bool IsWithEvents() const
void SetStatic(bool bAsStatic=true)
virtual void SetType(SbxDataType)
void SetFixedStringLength(short n)
void SetByVal(bool bByVal_)
SbiSymDef * Find(const OUString &, bool bSearchInParents=true)
SbiSymDef * Get(sal_uInt16)
void SetParent(SbiSymPool *p)
sal_uInt16 GetSize() const
static bool IsKwd(SbiToken t)
SbxVariable * Find(const OUString &, SbxClassType)
void Insert(SbxVariable *, sal_uInt32)
void SetFlags(SbxFlagBits n)
void SetFlag(SbxFlagBits n)
SbxFlagBits GetFlags() const
void ResetFlag(SbxFlagBits n)
void AddDim(sal_Int32, sal_Int32)
void setHasFixedSize(bool bHasFixedSize)
void unoAddDim(sal_Int32, sal_Int32)
SbxArray * GetProperties()
void Remove(const OUString &, SbxClassType)
bool PutObject(SbxBase *)
static void FatalError(ErrCode)
static VBAConstantHelper & instance()
std::unique_ptr< SbiExprList > SbiExprListPtr
Reference< XComponentContext > getProcessComponentContext()
SbxObjectRef cloneTypeObjectImpl(const SbxObject &rTypeObj)
#define ERRCODE_BASIC_EXPECTED
#define ERRCODE_BASIC_BAD_DECLARATION
#define ERRCODE_BASIC_NOT_IN_SUBR
#define ERRCODE_BASIC_UNDEF_TYPE
#define ERRCODE_BASIC_UNEXPECTED
#define ERRCODE_BASIC_PROC_DEFINED
#define ERRCODE_BASIC_OUT_OF_RANGE
#define ERRCODE_BASIC_SYNTAX
#define ERRCODE_BASIC_VAR_DEFINED
#define ERRCODE_BASIC_INTERNAL_ERROR
#define ERRCODE_BASIC_NOT_IMPLEMENTED
const sal_uInt32 SBX_TYPE_DIM_AS_NEW_FLAG
const sal_uInt32 SBX_TYPE_WITH_EVENTS_FLAG
const sal_uInt32 SBX_TYPE_VAR_TO_DIM_FLAG
const sal_uInt32 SBX_FIXED_LEN_STRING_FLAG