/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
void SbiExprNode::GenElement( SbiCodeGen& rGen, SbiOpcode eOp )
{ #ifdef DBG_UTIL if ((eOp < SbiOpcode::RTL_ || eOp > SbiOpcode::CALLC_) && eOp != SbiOpcode::FIND_G_ && eOp != SbiOpcode::FIND_CM_ && eOp != SbiOpcode::FIND_STATIC_)
rGen.GetParser()->Error( ERRCODE_BASIC_INTERNAL_ERROR, u"Opcode"_ustr ); #endif
SbiSymDef* pDef = aVar.pDef; // The ID is either the position or the String-ID // If the bit Bit 0x8000 is set, the variable have // a parameter list.
sal_uInt16 nId = ( eOp == SbiOpcode::PARAM_ ) ? pDef->GetPos() : pDef->GetId(); // Build a parameter list if( aVar.pPar && aVar.pPar->GetSize() )
{
nId |= 0x8000;
aVar.pPar->Gen(rGen);
}
/* TODO: Check after Declare concept change // From 1996-01-10: Type adjustment at named -> search suitable parameter if( pProc ) { // For the present: trigger an error pParser->Error( ERRCODE_BASIC_NO_NAMED_ARGS );
// Later, if Named Args at DECLARE is possible //for( sal_uInt16 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
{
rGen.Gen( SbiOpcode::ARGV_ );
}
}
}
void SbiExpression::Gen( RecursiveMode eRecMode )
{ // special treatment for WITH // If pExpr == .-term in With, approximately Gen for Basis-Object
pExpr->Gen( pParser->aGen, eRecMode ); if( bByVal )
{
pParser->aGen.Gen( SbiOpcode::BYVAL_ );
} if( bBased )
{
sal_uInt16 uBase = pParser->nBase; if( pParser->IsCompatible() )
{
uBase |= 0x8000; // #109275 Flag compatibility
}
pParser->aGen.Gen( SbiOpcode::BASED_, uBase );
pParser->aGen.Gen( SbiOpcode::ARGV_ );
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.