tdf#123936 Formatting files in module idl with clang-format
Change-Id: I0a2681218773288c14b6faf98dd0bb8a7dbac56d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105679 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
This commit is contained in:
committed by
Christian Lohmaier
parent
7721e7a797
commit
9c9a822920
@@ -22,17 +22,14 @@
|
|||||||
#include <database.hxx>
|
#include <database.hxx>
|
||||||
#include <osl/file.hxx>
|
#include <osl/file.hxx>
|
||||||
|
|
||||||
|
SvMetaModule::SvMetaModule() {}
|
||||||
|
|
||||||
SvMetaModule::SvMetaModule()
|
void SvMetaModule::WriteSfx(SvIdlDataBase& rBase, SvStream& rOutStm)
|
||||||
{
|
{
|
||||||
}
|
for (sal_uLong n = 0; n < aClassList.size(); n++)
|
||||||
|
|
||||||
void SvMetaModule::WriteSfx( SvIdlDataBase & rBase, SvStream & rOutStm )
|
|
||||||
{
|
|
||||||
for( sal_uLong n = 0; n < aClassList.size(); n++ )
|
|
||||||
{
|
{
|
||||||
SvMetaClass * pClass = aClassList[n];
|
SvMetaClass* pClass = aClassList[n];
|
||||||
pClass->WriteSfx( rBase, rOutStm );
|
pClass->WriteSfx(rBase, rOutStm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -26,7 +26,8 @@ class AstConstants final : public AstModule
|
|||||||
public:
|
public:
|
||||||
AstConstants(const OString& name, AstScope* pScope)
|
AstConstants(const OString& name, AstScope* pScope)
|
||||||
: AstModule(NT_constants, name, pScope)
|
: AstModule(NT_constants, name, pScope)
|
||||||
{}
|
{
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // INCLUDED_IDLC_INC_ASTCONSTANTS_HXX
|
#endif // INCLUDED_IDLC_INC_ASTCONSTANTS_HXX
|
||||||
|
@@ -23,16 +23,14 @@
|
|||||||
#include "astscope.hxx"
|
#include "astscope.hxx"
|
||||||
#include "astconstant.hxx"
|
#include "astconstant.hxx"
|
||||||
|
|
||||||
class AstEnum final : public AstType
|
class AstEnum final : public AstType, public AstScope
|
||||||
, public AstScope
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AstEnum(const OString& name, AstScope* pScope);
|
AstEnum(const OString& name, AstScope* pScope);
|
||||||
|
|
||||||
virtual ~AstEnum() override;
|
virtual ~AstEnum() override;
|
||||||
|
|
||||||
sal_Int32 getEnumValueCount()
|
sal_Int32 getEnumValueCount() { return m_enumValueCount++; }
|
||||||
{ return m_enumValueCount++; }
|
|
||||||
|
|
||||||
AstConstant* checkValue(AstExpression* pExpr);
|
AstConstant* checkValue(AstExpression* pExpr);
|
||||||
|
|
||||||
|
@@ -24,9 +24,10 @@
|
|||||||
class AstException final : public AstStruct
|
class AstException final : public AstStruct
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AstException(const OString& name, AstException const * pBaseType, AstScope* pScope)
|
AstException(const OString& name, AstException const* pBaseType, AstScope* pScope)
|
||||||
: AstStruct(NT_exception, name, pBaseType, pScope)
|
: AstStruct(NT_exception, name, pBaseType, pScope)
|
||||||
{}
|
{
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // INCLUDED_IDLC_INC_ASTEXCEPTION_HXX
|
#endif // INCLUDED_IDLC_INC_ASTEXCEPTION_HXX
|
||||||
|
@@ -22,18 +22,19 @@
|
|||||||
#include "astdeclaration.hxx"
|
#include "astdeclaration.hxx"
|
||||||
#include "astscope.hxx"
|
#include "astscope.hxx"
|
||||||
|
|
||||||
class AstModule : public AstDeclaration
|
class AstModule : public AstDeclaration, public AstScope
|
||||||
, public AstScope
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AstModule(const OString& name, AstScope* pScope)
|
AstModule(const OString& name, AstScope* pScope)
|
||||||
: AstDeclaration(NT_module, name, pScope)
|
: AstDeclaration(NT_module, name, pScope)
|
||||||
, AstScope(NT_module)
|
, AstScope(NT_module)
|
||||||
{}
|
{
|
||||||
|
}
|
||||||
AstModule(NodeType type, const OString& name, AstScope* pScope)
|
AstModule(NodeType type, const OString& name, AstScope* pScope)
|
||||||
: AstDeclaration(type, name, pScope)
|
: AstDeclaration(type, name, pScope)
|
||||||
, AstScope(type)
|
, AstScope(type)
|
||||||
{}
|
{
|
||||||
|
}
|
||||||
|
|
||||||
virtual bool dump(RegistryKey& rKey) override;
|
virtual bool dump(RegistryKey& rKey) override;
|
||||||
};
|
};
|
||||||
|
@@ -27,10 +27,11 @@ public:
|
|||||||
AstNeeds(AstService* pRealService, const OString& name, AstScope* pScope)
|
AstNeeds(AstService* pRealService, const OString& name, AstScope* pScope)
|
||||||
: AstDeclaration(NT_needs, name, pScope)
|
: AstDeclaration(NT_needs, name, pScope)
|
||||||
, m_pRealService(pRealService)
|
, m_pRealService(pRealService)
|
||||||
{}
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
AstService* getRealService() { return m_pRealService; }
|
||||||
|
|
||||||
AstService* getRealService()
|
|
||||||
{ return m_pRealService; }
|
|
||||||
private:
|
private:
|
||||||
AstService* m_pRealService;
|
AstService* m_pRealService;
|
||||||
};
|
};
|
||||||
|
@@ -27,10 +27,11 @@ public:
|
|||||||
AstObserves(AstInterface* pRealInterface, const OString& name, AstScope* pScope)
|
AstObserves(AstInterface* pRealInterface, const OString& name, AstScope* pScope)
|
||||||
: AstDeclaration(NT_observes, name, pScope)
|
: AstDeclaration(NT_observes, name, pScope)
|
||||||
, m_pRealInterface(pRealInterface)
|
, m_pRealInterface(pRealInterface)
|
||||||
{}
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
AstInterface* getRealInterface() { return m_pRealInterface; }
|
||||||
|
|
||||||
AstInterface* getRealInterface()
|
|
||||||
{ return m_pRealInterface; }
|
|
||||||
private:
|
private:
|
||||||
AstInterface* m_pRealInterface;
|
AstInterface* m_pRealInterface;
|
||||||
};
|
};
|
||||||
|
@@ -31,17 +31,13 @@ public:
|
|||||||
AstScope(NodeType nodeType);
|
AstScope(NodeType nodeType);
|
||||||
virtual ~AstScope();
|
virtual ~AstScope();
|
||||||
|
|
||||||
NodeType getScopeNodeType() const
|
NodeType getScopeNodeType() const { return m_nodeType; }
|
||||||
{ return m_nodeType; }
|
|
||||||
|
|
||||||
AstDeclaration* addDeclaration(AstDeclaration* pDecl);
|
AstDeclaration* addDeclaration(AstDeclaration* pDecl);
|
||||||
|
|
||||||
sal_uInt32 nMembers() const
|
sal_uInt32 nMembers() const { return static_cast<sal_uInt32>(m_declarations.size()); }
|
||||||
{ return static_cast<sal_uInt32>(m_declarations.size()); }
|
DeclList::const_iterator getIteratorBegin() const { return m_declarations.begin(); }
|
||||||
DeclList::const_iterator getIteratorBegin() const
|
DeclList::const_iterator getIteratorEnd() const { return m_declarations.end(); }
|
||||||
{ return m_declarations.begin(); }
|
|
||||||
DeclList::const_iterator getIteratorEnd() const
|
|
||||||
{ return m_declarations.end(); }
|
|
||||||
sal_uInt16 getNodeCount(NodeType nType) const;
|
sal_uInt16 getNodeCount(NodeType nType) const;
|
||||||
|
|
||||||
// Name look up mechanism
|
// Name look up mechanism
|
||||||
@@ -54,11 +50,10 @@ public:
|
|||||||
// Look up a predefined type by its ExprType
|
// Look up a predefined type by its ExprType
|
||||||
AstDeclaration* lookupPrimitiveType(ExprType type);
|
AstDeclaration* lookupPrimitiveType(ExprType type);
|
||||||
|
|
||||||
AstDeclaration* lookupForAdd(AstDeclaration const * pDecl) const;
|
AstDeclaration* lookupForAdd(AstDeclaration const* pDecl) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
AstDeclaration const * getLast() const
|
AstDeclaration const* getLast() const { return m_declarations.back(); }
|
||||||
{ return m_declarations.back(); }
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DeclList m_declarations;
|
DeclList m_declarations;
|
||||||
|
@@ -24,20 +24,23 @@
|
|||||||
class AstSequence final : public AstType
|
class AstSequence final : public AstType
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AstSequence(AstType const * pMemberType, AstScope* pScope)
|
AstSequence(AstType const* pMemberType, AstScope* pScope)
|
||||||
: AstType(NT_sequence, OStringLiteral("[]")+pMemberType->getScopedName(), pScope)
|
: AstType(NT_sequence, OStringLiteral("[]") + pMemberType->getScopedName(), pScope)
|
||||||
, m_pMemberType(pMemberType)
|
, m_pMemberType(pMemberType)
|
||||||
{}
|
{
|
||||||
|
}
|
||||||
|
|
||||||
AstType const * getMemberType() const
|
AstType const* getMemberType() const { return m_pMemberType; }
|
||||||
{ return m_pMemberType; }
|
|
||||||
|
|
||||||
virtual bool isUnsigned() const override
|
virtual bool isUnsigned() const override
|
||||||
{ return m_pMemberType != nullptr && m_pMemberType->isUnsigned(); }
|
{
|
||||||
|
return m_pMemberType != nullptr && m_pMemberType->isUnsigned();
|
||||||
|
}
|
||||||
|
|
||||||
virtual const char* getRelativName() const override;
|
virtual const char* getRelativName() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
AstType const * m_pMemberType;
|
AstType const* m_pMemberType;
|
||||||
mutable std::optional<OString> m_xRelativName;
|
mutable std::optional<OString> m_xRelativName;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -30,7 +30,7 @@ public:
|
|||||||
AstStack();
|
AstStack();
|
||||||
~AstStack();
|
~AstStack();
|
||||||
|
|
||||||
sal_uInt32 depth() const { return m_stack.size();}
|
sal_uInt32 depth() const { return m_stack.size(); }
|
||||||
AstScope* top();
|
AstScope* top();
|
||||||
AstScope* bottom();
|
AstScope* bottom();
|
||||||
AstScope* nextToTop();
|
AstScope* nextToTop();
|
||||||
|
@@ -26,7 +26,8 @@ class AstType : public AstDeclaration
|
|||||||
public:
|
public:
|
||||||
AstType(const NodeType type, const OString& name, AstScope* pScope)
|
AstType(const NodeType type, const OString& name, AstScope* pScope)
|
||||||
: AstDeclaration(type, name, pScope)
|
: AstDeclaration(type, name, pScope)
|
||||||
{}
|
{
|
||||||
|
}
|
||||||
|
|
||||||
virtual bool isUnsigned() const { return false; }
|
virtual bool isUnsigned() const { return false; }
|
||||||
};
|
};
|
||||||
|
@@ -17,7 +17,6 @@
|
|||||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <astexpression.hxx>
|
#include <astexpression.hxx>
|
||||||
#include <astconstant.hxx>
|
#include <astconstant.hxx>
|
||||||
#include <astscope.hxx>
|
#include <astscope.hxx>
|
||||||
@@ -30,7 +29,7 @@
|
|||||||
#include <float.h>
|
#include <float.h>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
AstExpression::AstExpression(ExprComb c, AstExpression *pExpr1, AstExpression *pExpr2)
|
AstExpression::AstExpression(ExprComb c, AstExpression* pExpr1, AstExpression* pExpr2)
|
||||||
: m_combOperator(c)
|
: m_combOperator(c)
|
||||||
, m_subExpr1(pExpr1)
|
, m_subExpr1(pExpr1)
|
||||||
, m_subExpr2(pExpr2)
|
, m_subExpr2(pExpr2)
|
||||||
@@ -40,7 +39,7 @@ AstExpression::AstExpression(ExprComb c, AstExpression *pExpr1, AstExpression *p
|
|||||||
AstExpression::AstExpression(sal_Int32 l)
|
AstExpression::AstExpression(sal_Int32 l)
|
||||||
: m_combOperator(ExprComb::NONE)
|
: m_combOperator(ExprComb::NONE)
|
||||||
{
|
{
|
||||||
m_exprValue.reset( new AstExprValue );
|
m_exprValue.reset(new AstExprValue);
|
||||||
m_exprValue->et = ET_long;
|
m_exprValue->et = ET_long;
|
||||||
m_exprValue->u.lval = l;
|
m_exprValue->u.lval = l;
|
||||||
}
|
}
|
||||||
@@ -48,7 +47,7 @@ AstExpression::AstExpression(sal_Int32 l)
|
|||||||
AstExpression::AstExpression(sal_Int32 l, ExprType et)
|
AstExpression::AstExpression(sal_Int32 l, ExprType et)
|
||||||
: m_combOperator(ExprComb::NONE)
|
: m_combOperator(ExprComb::NONE)
|
||||||
{
|
{
|
||||||
m_exprValue.reset( new AstExprValue );
|
m_exprValue.reset(new AstExprValue);
|
||||||
m_exprValue->et = et;
|
m_exprValue->et = et;
|
||||||
m_exprValue->u.lval = l;
|
m_exprValue->u.lval = l;
|
||||||
}
|
}
|
||||||
@@ -56,7 +55,7 @@ AstExpression::AstExpression(sal_Int32 l, ExprType et)
|
|||||||
AstExpression::AstExpression(sal_Int64 h)
|
AstExpression::AstExpression(sal_Int64 h)
|
||||||
: m_combOperator(ExprComb::NONE)
|
: m_combOperator(ExprComb::NONE)
|
||||||
{
|
{
|
||||||
m_exprValue.reset( new AstExprValue );
|
m_exprValue.reset(new AstExprValue);
|
||||||
m_exprValue->et = ET_hyper;
|
m_exprValue->et = ET_hyper;
|
||||||
m_exprValue->u.hval = h;
|
m_exprValue->u.hval = h;
|
||||||
}
|
}
|
||||||
@@ -64,7 +63,7 @@ AstExpression::AstExpression(sal_Int64 h)
|
|||||||
AstExpression::AstExpression(sal_uInt64 uh)
|
AstExpression::AstExpression(sal_uInt64 uh)
|
||||||
: m_combOperator(ExprComb::NONE)
|
: m_combOperator(ExprComb::NONE)
|
||||||
{
|
{
|
||||||
m_exprValue.reset( new AstExprValue );
|
m_exprValue.reset(new AstExprValue);
|
||||||
m_exprValue->et = ET_uhyper;
|
m_exprValue->et = ET_uhyper;
|
||||||
m_exprValue->u.uhval = uh;
|
m_exprValue->u.uhval = uh;
|
||||||
}
|
}
|
||||||
@@ -72,7 +71,7 @@ AstExpression::AstExpression(sal_uInt64 uh)
|
|||||||
AstExpression::AstExpression(double d)
|
AstExpression::AstExpression(double d)
|
||||||
: m_combOperator(ExprComb::NONE)
|
: m_combOperator(ExprComb::NONE)
|
||||||
{
|
{
|
||||||
m_exprValue.reset( new AstExprValue );
|
m_exprValue.reset(new AstExprValue);
|
||||||
m_exprValue->et = ET_double;
|
m_exprValue->et = ET_double;
|
||||||
m_exprValue->u.dval = d;
|
m_exprValue->u.dval = d;
|
||||||
}
|
}
|
||||||
@@ -84,17 +83,14 @@ AstExpression::AstExpression(OString* scopedName)
|
|||||||
m_xSymbolicName = *scopedName;
|
m_xSymbolicName = *scopedName;
|
||||||
}
|
}
|
||||||
|
|
||||||
AstExpression::~AstExpression()
|
AstExpression::~AstExpression() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Perform the coercion from the given AstExprValue to the requested
|
* Perform the coercion from the given AstExprValue to the requested
|
||||||
* ExprType. Return an AstExprValue if successful, NULL if failed.
|
* ExprType. Return an AstExprValue if successful, NULL if failed.
|
||||||
* must be done for hyper, uhyper
|
* must be done for hyper, uhyper
|
||||||
*/
|
*/
|
||||||
static bool
|
static bool coerce_value(AstExprValue* ev, ExprType t)
|
||||||
coerce_value(AstExprValue *ev, ExprType t)
|
|
||||||
{
|
{
|
||||||
if (ev == nullptr)
|
if (ev == nullptr)
|
||||||
return false;
|
return false;
|
||||||
@@ -735,7 +731,8 @@ coerce_value(AstExprValue *ev, ExprType t)
|
|||||||
return true;
|
return true;
|
||||||
case ET_double:
|
case ET_double:
|
||||||
{
|
{
|
||||||
if (static_cast<float>(ev->u.dval) > FLT_MAX || static_cast<float>(ev->u.dval) < -FLT_MAX)
|
if (static_cast<float>(ev->u.dval) > FLT_MAX
|
||||||
|
|| static_cast<float>(ev->u.dval) < -FLT_MAX)
|
||||||
return false;
|
return false;
|
||||||
auto tmp = static_cast<float>(ev->u.dval);
|
auto tmp = static_cast<float>(ev->u.dval);
|
||||||
ev->u.fval = tmp;
|
ev->u.fval = tmp;
|
||||||
@@ -944,7 +941,7 @@ bool AstExpression::coerce(ExprType t)
|
|||||||
return m_exprValue != nullptr;
|
return m_exprValue != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AstExpression::compareLong(AstExpression *pExpr)
|
bool AstExpression::compareLong(AstExpression* pExpr)
|
||||||
{
|
{
|
||||||
bool bRet = false;
|
bool bRet = false;
|
||||||
if (m_combOperator != pExpr->m_combOperator)
|
if (m_combOperator != pExpr->m_combOperator)
|
||||||
@@ -973,7 +970,7 @@ void AstExpression::evaluate()
|
|||||||
/*
|
/*
|
||||||
* Already evaluated?
|
* Already evaluated?
|
||||||
*/
|
*/
|
||||||
if ( m_exprValue != nullptr )
|
if (m_exprValue != nullptr)
|
||||||
return;
|
return;
|
||||||
/*
|
/*
|
||||||
* OK, must evaluate operator
|
* OK, must evaluate operator
|
||||||
@@ -1010,7 +1007,7 @@ std::unique_ptr<AstExprValue> AstExpression::eval_bin_op()
|
|||||||
{
|
{
|
||||||
ExprType eType = ET_double;
|
ExprType eType = ET_double;
|
||||||
|
|
||||||
if ( m_combOperator == ExprComb::Mod )
|
if (m_combOperator == ExprComb::Mod)
|
||||||
eType = ET_hyper;
|
eType = ET_hyper;
|
||||||
|
|
||||||
if (m_subExpr1 == nullptr || m_subExpr2 == nullptr)
|
if (m_subExpr1 == nullptr || m_subExpr2 == nullptr)
|
||||||
@@ -1026,7 +1023,7 @@ std::unique_ptr<AstExprValue> AstExpression::eval_bin_op()
|
|||||||
if (!m_subExpr2->coerce(eType))
|
if (!m_subExpr2->coerce(eType))
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
std::unique_ptr< AstExprValue > retval(new AstExprValue);
|
std::unique_ptr<AstExprValue> retval(new AstExprValue);
|
||||||
retval->et = eType;
|
retval->et = eType;
|
||||||
|
|
||||||
switch (m_combOperator)
|
switch (m_combOperator)
|
||||||
@@ -1034,21 +1031,26 @@ std::unique_ptr<AstExprValue> AstExpression::eval_bin_op()
|
|||||||
case ExprComb::Mod:
|
case ExprComb::Mod:
|
||||||
if (m_subExpr2->getExprValue()->u.hval == 0)
|
if (m_subExpr2->getExprValue()->u.hval == 0)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
retval->u.hval = m_subExpr1->getExprValue()->u.hval % m_subExpr2->getExprValue()->u.hval;
|
retval->u.hval
|
||||||
|
= m_subExpr1->getExprValue()->u.hval % m_subExpr2->getExprValue()->u.hval;
|
||||||
break;
|
break;
|
||||||
case ExprComb::Add:
|
case ExprComb::Add:
|
||||||
retval->u.dval = m_subExpr1->getExprValue()->u.dval + m_subExpr2->getExprValue()->u.dval;
|
retval->u.dval
|
||||||
|
= m_subExpr1->getExprValue()->u.dval + m_subExpr2->getExprValue()->u.dval;
|
||||||
break;
|
break;
|
||||||
case ExprComb::Minus:
|
case ExprComb::Minus:
|
||||||
retval->u.dval = m_subExpr1->getExprValue()->u.dval - m_subExpr2->getExprValue()->u.dval;
|
retval->u.dval
|
||||||
|
= m_subExpr1->getExprValue()->u.dval - m_subExpr2->getExprValue()->u.dval;
|
||||||
break;
|
break;
|
||||||
case ExprComb::Mul:
|
case ExprComb::Mul:
|
||||||
retval->u.dval = m_subExpr1->getExprValue()->u.dval * m_subExpr2->getExprValue()->u.dval;
|
retval->u.dval
|
||||||
|
= m_subExpr1->getExprValue()->u.dval * m_subExpr2->getExprValue()->u.dval;
|
||||||
break;
|
break;
|
||||||
case ExprComb::Div:
|
case ExprComb::Div:
|
||||||
if (m_subExpr2->getExprValue()->u.dval == 0.0)
|
if (m_subExpr2->getExprValue()->u.dval == 0.0)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
retval->u.dval = m_subExpr1->getExprValue()->u.dval / m_subExpr2->getExprValue()->u.dval;
|
retval->u.dval
|
||||||
|
= m_subExpr1->getExprValue()->u.dval / m_subExpr2->getExprValue()->u.dval;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return nullptr;
|
return nullptr;
|
||||||
@@ -1072,25 +1074,30 @@ std::unique_ptr<AstExprValue> AstExpression::eval_bit_op()
|
|||||||
if (!m_subExpr2->coerce(ET_long))
|
if (!m_subExpr2->coerce(ET_long))
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
std::unique_ptr< AstExprValue > retval(new AstExprValue);
|
std::unique_ptr<AstExprValue> retval(new AstExprValue);
|
||||||
retval->et = ET_long;
|
retval->et = ET_long;
|
||||||
|
|
||||||
switch (m_combOperator)
|
switch (m_combOperator)
|
||||||
{
|
{
|
||||||
case ExprComb::Or:
|
case ExprComb::Or:
|
||||||
retval->u.lval = m_subExpr1->getExprValue()->u.lval | m_subExpr2->getExprValue()->u.lval;
|
retval->u.lval
|
||||||
|
= m_subExpr1->getExprValue()->u.lval | m_subExpr2->getExprValue()->u.lval;
|
||||||
break;
|
break;
|
||||||
case ExprComb::Xor:
|
case ExprComb::Xor:
|
||||||
retval->u.lval = m_subExpr1->getExprValue()->u.lval ^ m_subExpr2->getExprValue()->u.lval;
|
retval->u.lval
|
||||||
|
= m_subExpr1->getExprValue()->u.lval ^ m_subExpr2->getExprValue()->u.lval;
|
||||||
break;
|
break;
|
||||||
case ExprComb::And:
|
case ExprComb::And:
|
||||||
retval->u.lval = m_subExpr1->getExprValue()->u.lval & m_subExpr2->getExprValue()->u.lval;
|
retval->u.lval
|
||||||
|
= m_subExpr1->getExprValue()->u.lval & m_subExpr2->getExprValue()->u.lval;
|
||||||
break;
|
break;
|
||||||
case ExprComb::Left:
|
case ExprComb::Left:
|
||||||
retval->u.lval = m_subExpr1->getExprValue()->u.lval << m_subExpr2->getExprValue()->u.lval;
|
retval->u.lval = m_subExpr1->getExprValue()->u.lval
|
||||||
|
<< m_subExpr2->getExprValue()->u.lval;
|
||||||
break;
|
break;
|
||||||
case ExprComb::Right:
|
case ExprComb::Right:
|
||||||
retval->u.lval = m_subExpr1->getExprValue()->u.lval >> m_subExpr2->getExprValue()->u.lval;
|
retval->u.lval
|
||||||
|
= m_subExpr1->getExprValue()->u.lval >> m_subExpr2->getExprValue()->u.lval;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return nullptr;
|
return nullptr;
|
||||||
@@ -1109,7 +1116,7 @@ std::unique_ptr<AstExprValue> AstExpression::eval_un_op()
|
|||||||
if (!m_subExpr1->coerce(ET_double))
|
if (!m_subExpr1->coerce(ET_double))
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
std::unique_ptr< AstExprValue > retval(new AstExprValue);
|
std::unique_ptr<AstExprValue> retval(new AstExprValue);
|
||||||
retval->et = ET_double;
|
retval->et = ET_double;
|
||||||
|
|
||||||
switch (m_combOperator)
|
switch (m_combOperator)
|
||||||
@@ -1129,9 +1136,9 @@ std::unique_ptr<AstExprValue> AstExpression::eval_un_op()
|
|||||||
|
|
||||||
std::unique_ptr<AstExprValue> AstExpression::eval_symbol()
|
std::unique_ptr<AstExprValue> AstExpression::eval_symbol()
|
||||||
{
|
{
|
||||||
AstScope *pScope = nullptr;
|
AstScope* pScope = nullptr;
|
||||||
AstDeclaration *pDecl;
|
AstDeclaration* pDecl;
|
||||||
AstConstant *pConst;
|
AstConstant* pConst;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Is there a symbol stored?
|
* Is there a symbol stored?
|
||||||
@@ -1146,7 +1153,7 @@ std::unique_ptr<AstExprValue> AstExpression::eval_symbol()
|
|||||||
*/
|
*/
|
||||||
if (idlc()->scopes()->depth() > 0)
|
if (idlc()->scopes()->depth() > 0)
|
||||||
pScope = idlc()->scopes()->topNonNull();
|
pScope = idlc()->scopes()->topNonNull();
|
||||||
if ( !pScope )
|
if (!pScope)
|
||||||
{
|
{
|
||||||
ErrorHandler::lookupError(*m_xSymbolicName);
|
ErrorHandler::lookupError(*m_xSymbolicName);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
@@ -1163,8 +1170,7 @@ std::unique_ptr<AstExprValue> AstExpression::eval_symbol()
|
|||||||
/*
|
/*
|
||||||
* Is it a constant?
|
* Is it a constant?
|
||||||
*/
|
*/
|
||||||
if (pDecl->getNodeType() != NT_const &&
|
if (pDecl->getNodeType() != NT_const && pDecl->getNodeType() != NT_enum_val)
|
||||||
pDecl->getNodeType() != NT_enum_val)
|
|
||||||
{
|
{
|
||||||
ErrorHandler::constantExpected(pDecl, *m_xSymbolicName);
|
ErrorHandler::constantExpected(pDecl, *m_xSymbolicName);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
@@ -1176,7 +1182,7 @@ std::unique_ptr<AstExprValue> AstExpression::eval_symbol()
|
|||||||
/*
|
/*
|
||||||
* OK, now evaluate the constant we just got, to produce its value
|
* OK, now evaluate the constant we just got, to produce its value
|
||||||
*/
|
*/
|
||||||
pConst = static_cast< AstConstant* >(pDecl);
|
pConst = static_cast<AstConstant*>(pDecl);
|
||||||
pConst->getConstValue()->evaluate();
|
pConst->getConstValue()->evaluate();
|
||||||
auto const val = pConst->getConstValue()->getExprValue();
|
auto const val = pConst->getConstValue()->getExprValue();
|
||||||
return val == nullptr ? nullptr : std::make_unique<AstExprValue>(*val);
|
return val == nullptr ? nullptr : std::make_unique<AstExprValue>(*val);
|
||||||
@@ -1185,10 +1191,10 @@ std::unique_ptr<AstExprValue> AstExpression::eval_symbol()
|
|||||||
OString AstExpression::toString()
|
OString AstExpression::toString()
|
||||||
{
|
{
|
||||||
OString exprStr;
|
OString exprStr;
|
||||||
if ( m_combOperator == ExprComb::Symbol )
|
if (m_combOperator == ExprComb::Symbol)
|
||||||
return m_xSymbolicName ? *m_xSymbolicName : OString("<Undefined Name>");
|
return m_xSymbolicName ? *m_xSymbolicName : OString("<Undefined Name>");
|
||||||
|
|
||||||
if ( m_exprValue )
|
if (m_exprValue)
|
||||||
{
|
{
|
||||||
switch (m_exprValue->et)
|
switch (m_exprValue->et)
|
||||||
{
|
{
|
||||||
@@ -1211,7 +1217,7 @@ OString AstExpression::toString()
|
|||||||
case ET_byte:
|
case ET_byte:
|
||||||
return OString::number(m_exprValue->u.byval);
|
return OString::number(m_exprValue->u.byval);
|
||||||
case ET_boolean:
|
case ET_boolean:
|
||||||
if ( m_exprValue->u.lval == 0)
|
if (m_exprValue->u.lval == 0)
|
||||||
return "FALSE";
|
return "FALSE";
|
||||||
else
|
else
|
||||||
return "TRUE";
|
return "TRUE";
|
||||||
@@ -1232,7 +1238,7 @@ OString AstExpression::toString()
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if ( m_subExpr1 )
|
if (m_subExpr1)
|
||||||
exprStr += m_subExpr1->toString();
|
exprStr += m_subExpr1->toString();
|
||||||
switch (m_combOperator)
|
switch (m_combOperator)
|
||||||
{
|
{
|
||||||
@@ -1270,7 +1276,7 @@ OString AstExpression::toString()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( m_subExpr2 )
|
if (m_subExpr2)
|
||||||
exprStr += m_subExpr2->toString();
|
exprStr += m_subExpr2->toString();
|
||||||
|
|
||||||
return exprStr;
|
return exprStr;
|
||||||
|
@@ -21,9 +21,7 @@
|
|||||||
#include <aststack.hxx>
|
#include <aststack.hxx>
|
||||||
#include <astscope.hxx>
|
#include <astscope.hxx>
|
||||||
|
|
||||||
AstStack::AstStack()
|
AstStack::AstStack() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
AstStack::~AstStack()
|
AstStack::~AstStack()
|
||||||
{
|
{
|
||||||
@@ -31,7 +29,6 @@ AstStack::~AstStack()
|
|||||||
delete p;
|
delete p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
AstScope* AstStack::top()
|
AstScope* AstStack::top()
|
||||||
{
|
{
|
||||||
if (m_stack.empty())
|
if (m_stack.empty())
|
||||||
@@ -58,7 +55,7 @@ AstScope* AstStack::topNonNull()
|
|||||||
{
|
{
|
||||||
for (sal_uInt32 i = m_stack.size(); i > 0; i--)
|
for (sal_uInt32 i = m_stack.size(); i > 0; i--)
|
||||||
{
|
{
|
||||||
if ( m_stack[i - 1] )
|
if (m_stack[i - 1])
|
||||||
return m_stack[i - 1];
|
return m_stack[i - 1];
|
||||||
}
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
@@ -77,9 +74,6 @@ void AstStack::pop()
|
|||||||
m_stack.pop_back();
|
m_stack.pop_back();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AstStack::clear()
|
void AstStack::clear() { m_stack.clear(); }
|
||||||
{
|
|
||||||
m_stack.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||||
|
@@ -22,10 +22,12 @@
|
|||||||
|
|
||||||
#include <rtl/ustring.hxx>
|
#include <rtl/ustring.hxx>
|
||||||
|
|
||||||
struct AttributeExceptions {
|
struct AttributeExceptions
|
||||||
struct Part {
|
{
|
||||||
OUString const * documentation;
|
struct Part
|
||||||
DeclList const * exceptions;
|
{
|
||||||
|
OUString const* documentation;
|
||||||
|
DeclList const* exceptions;
|
||||||
};
|
};
|
||||||
Part get;
|
Part get;
|
||||||
Part set;
|
Part set;
|
||||||
|
@@ -5020,7 +5020,6 @@ idl/source/cmptools/hash.cxx
|
|||||||
idl/source/cmptools/lex.cxx
|
idl/source/cmptools/lex.cxx
|
||||||
idl/source/objects/basobj.cxx
|
idl/source/objects/basobj.cxx
|
||||||
idl/source/objects/bastype.cxx
|
idl/source/objects/bastype.cxx
|
||||||
idl/source/objects/module.cxx
|
|
||||||
idl/source/objects/object.cxx
|
idl/source/objects/object.cxx
|
||||||
idl/source/objects/slot.cxx
|
idl/source/objects/slot.cxx
|
||||||
idl/source/objects/types.cxx
|
idl/source/objects/types.cxx
|
||||||
@@ -5032,27 +5031,17 @@ idl/source/prj/svidl.cxx
|
|||||||
idlc/inc/astattribute.hxx
|
idlc/inc/astattribute.hxx
|
||||||
idlc/inc/astbasetype.hxx
|
idlc/inc/astbasetype.hxx
|
||||||
idlc/inc/astconstant.hxx
|
idlc/inc/astconstant.hxx
|
||||||
idlc/inc/astconstants.hxx
|
|
||||||
idlc/inc/astdeclaration.hxx
|
idlc/inc/astdeclaration.hxx
|
||||||
idlc/inc/astenum.hxx
|
|
||||||
idlc/inc/astexception.hxx
|
|
||||||
idlc/inc/astexpression.hxx
|
idlc/inc/astexpression.hxx
|
||||||
idlc/inc/astinterface.hxx
|
idlc/inc/astinterface.hxx
|
||||||
idlc/inc/astinterfacemember.hxx
|
idlc/inc/astinterfacemember.hxx
|
||||||
idlc/inc/astmember.hxx
|
idlc/inc/astmember.hxx
|
||||||
idlc/inc/astmodule.hxx
|
|
||||||
idlc/inc/astneeds.hxx
|
|
||||||
idlc/inc/astobserves.hxx
|
|
||||||
idlc/inc/astoperation.hxx
|
idlc/inc/astoperation.hxx
|
||||||
idlc/inc/astparameter.hxx
|
idlc/inc/astparameter.hxx
|
||||||
idlc/inc/astscope.hxx
|
|
||||||
idlc/inc/astsequence.hxx
|
|
||||||
idlc/inc/astservice.hxx
|
idlc/inc/astservice.hxx
|
||||||
idlc/inc/astservicemember.hxx
|
idlc/inc/astservicemember.hxx
|
||||||
idlc/inc/aststack.hxx
|
|
||||||
idlc/inc/aststruct.hxx
|
idlc/inc/aststruct.hxx
|
||||||
idlc/inc/aststructinstance.hxx
|
idlc/inc/aststructinstance.hxx
|
||||||
idlc/inc/asttype.hxx
|
|
||||||
idlc/inc/asttypedef.hxx
|
idlc/inc/asttypedef.hxx
|
||||||
idlc/inc/errorhandler.hxx
|
idlc/inc/errorhandler.hxx
|
||||||
idlc/inc/fehelper.hxx
|
idlc/inc/fehelper.hxx
|
||||||
@@ -5064,15 +5053,12 @@ idlc/source/astconstant.cxx
|
|||||||
idlc/source/astdeclaration.cxx
|
idlc/source/astdeclaration.cxx
|
||||||
idlc/source/astdump.cxx
|
idlc/source/astdump.cxx
|
||||||
idlc/source/astenum.cxx
|
idlc/source/astenum.cxx
|
||||||
idlc/source/astexpression.cxx
|
|
||||||
idlc/source/astinterface.cxx
|
idlc/source/astinterface.cxx
|
||||||
idlc/source/astoperation.cxx
|
idlc/source/astoperation.cxx
|
||||||
idlc/source/astscope.cxx
|
idlc/source/astscope.cxx
|
||||||
idlc/source/astservice.cxx
|
idlc/source/astservice.cxx
|
||||||
idlc/source/aststack.cxx
|
|
||||||
idlc/source/aststruct.cxx
|
idlc/source/aststruct.cxx
|
||||||
idlc/source/aststructinstance.cxx
|
idlc/source/aststructinstance.cxx
|
||||||
idlc/source/attributeexceptions.hxx
|
|
||||||
idlc/source/errorhandler.cxx
|
idlc/source/errorhandler.cxx
|
||||||
idlc/source/fehelper.cxx
|
idlc/source/fehelper.cxx
|
||||||
idlc/source/idlc.cxx
|
idlc/source/idlc.cxx
|
||||||
|
Reference in New Issue
Block a user