loplugin:staticfunction
Change-Id: Id796b799f8e2fcc3eae98d43800c5e31fec27fef
This commit is contained in:
parent
44790193a7
commit
aa7a829e7d
@ -1046,7 +1046,7 @@ private:
|
|||||||
virtual sal_uInt32 checkInheritedMemberCount() const SAL_OVERRIDE
|
virtual sal_uInt32 checkInheritedMemberCount() const SAL_OVERRIDE
|
||||||
{ return BaseOffset(m_typeMgr, entity_).get(); }
|
{ return BaseOffset(m_typeMgr, entity_).get(); }
|
||||||
|
|
||||||
void dumpExceptionSpecification(
|
static void dumpExceptionSpecification(
|
||||||
FileStream & out, std::vector< OUString > const & exceptions,
|
FileStream & out, std::vector< OUString > const & exceptions,
|
||||||
bool runtimeException);
|
bool runtimeException);
|
||||||
|
|
||||||
|
@ -134,11 +134,11 @@ private:
|
|||||||
rtl::OUString const & name,
|
rtl::OUString const & name,
|
||||||
rtl::Reference< unoidl::Entity > const & entity);
|
rtl::Reference< unoidl::Entity > const & entity);
|
||||||
|
|
||||||
css::uno::Any getEnumMember(
|
static css::uno::Any getEnumMember(
|
||||||
rtl::Reference< unoidl::EnumTypeEntity > const & entity,
|
rtl::Reference< unoidl::EnumTypeEntity > const & entity,
|
||||||
rtl::OUString const & member);
|
rtl::OUString const & member);
|
||||||
|
|
||||||
css::uno::Any getConstant(
|
static css::uno::Any getConstant(
|
||||||
rtl::OUString const & constantGroupName,
|
rtl::OUString const & constantGroupName,
|
||||||
rtl::Reference< unoidl::ConstantGroupEntity > const & entity,
|
rtl::Reference< unoidl::ConstantGroupEntity > const & entity,
|
||||||
rtl::OUString const & member);
|
rtl::OUString const & member);
|
||||||
|
@ -62,7 +62,7 @@ private:
|
|||||||
OUString SAL_CALL quotedPValue( );
|
OUString SAL_CALL quotedPValue( );
|
||||||
OUString SAL_CALL nonquotedPValue( );
|
OUString SAL_CALL nonquotedPValue( );
|
||||||
void SAL_CALL comment( void );
|
void SAL_CALL comment( void );
|
||||||
bool SAL_CALL isInRange( const OUString& aChr, const OUString& aRange );
|
static bool SAL_CALL isInRange( const OUString& aChr, const OUString& aRange );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
::osl::Mutex m_aMutex;
|
::osl::Mutex m_aMutex;
|
||||||
|
@ -175,7 +175,7 @@ private:
|
|||||||
|
|
||||||
void setupDataPath();
|
void setupDataPath();
|
||||||
void setup();
|
void setup();
|
||||||
void teardown();
|
static void teardown();
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
@ -90,41 +90,41 @@ class ErrorHandler
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// Report errors with varying numbers of arguments
|
// Report errors with varying numbers of arguments
|
||||||
void error0(ErrorCode e);
|
static void error0(ErrorCode e);
|
||||||
void error1(ErrorCode e, AstDeclaration const * d);
|
static void error1(ErrorCode e, AstDeclaration const * d);
|
||||||
void error2(
|
static void error2(
|
||||||
ErrorCode e, AstDeclaration const * d1, AstDeclaration const * d2);
|
ErrorCode e, AstDeclaration const * d1, AstDeclaration const * d2);
|
||||||
void error3(ErrorCode e, AstDeclaration* d1, AstDeclaration* d2, AstDeclaration* d3);
|
static void error3(ErrorCode e, AstDeclaration* d1, AstDeclaration* d2, AstDeclaration* d3);
|
||||||
|
|
||||||
// Warning
|
// Warning
|
||||||
void warning0(WarningCode e, const sal_Char* warningmsg);
|
static void warning0(WarningCode e, const sal_Char* warningmsg);
|
||||||
|
|
||||||
// Report a syntax error in IDL input
|
// Report a syntax error in IDL input
|
||||||
void syntaxError(ParseState state, sal_Int32 lineNumber, const sal_Char* errmsg);
|
static void syntaxError(ParseState state, sal_Int32 lineNumber, const sal_Char* errmsg);
|
||||||
|
|
||||||
// Report an unsuccessful coercion attempt
|
// Report an unsuccessful coercion attempt
|
||||||
void coercionError(AstExpression *pExpr, ExprType et);
|
static void coercionError(AstExpression *pExpr, ExprType et);
|
||||||
|
|
||||||
// Report a failed name lookup attempt
|
// Report a failed name lookup attempt
|
||||||
void lookupError(const OString& n);
|
static void lookupError(const OString& n);
|
||||||
// Report a failed name lookup attempt
|
// Report a failed name lookup attempt
|
||||||
void lookupError(ErrorCode e, const OString& n, AstDeclaration* pScope);
|
static void lookupError(ErrorCode e, const OString& n, AstDeclaration* pScope);
|
||||||
|
|
||||||
|
|
||||||
// Report a type error
|
// Report a type error
|
||||||
void noTypeError(AstDeclaration const * pDecl);
|
static void noTypeError(AstDeclaration const * pDecl);
|
||||||
|
|
||||||
void inheritanceError(NodeType nodeType, const OString* name, AstDeclaration* pDecl);
|
static void inheritanceError(NodeType nodeType, const OString* name, AstDeclaration* pDecl);
|
||||||
|
|
||||||
void flagError(ErrorCode e, sal_uInt32 flag);
|
static void flagError(ErrorCode e, sal_uInt32 flag);
|
||||||
|
|
||||||
void forwardLookupError(const AstDeclaration* pForward, const OString& name);
|
static void forwardLookupError(const AstDeclaration* pForward, const OString& name);
|
||||||
|
|
||||||
void constantExpected(AstDeclaration* pDecl, const OString& name);
|
static void constantExpected(AstDeclaration* pDecl, const OString& name);
|
||||||
|
|
||||||
void evalError(AstExpression* pExpr);
|
static void evalError(AstExpression* pExpr);
|
||||||
|
|
||||||
bool checkPublished(AstDeclaration const * decl, bool bOptiional=false);
|
static bool checkPublished(AstDeclaration const * decl, bool bOptiional=false);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // INCLUDED_IDLC_INC_IDLC_ERRORHANDLER_HXX
|
#endif // INCLUDED_IDLC_INC_IDLC_ERRORHANDLER_HXX
|
||||||
|
@ -47,7 +47,7 @@ public:
|
|||||||
|
|
||||||
bool initOptions(std::vector< std::string > & rArgs)
|
bool initOptions(std::vector< std::string > & rArgs)
|
||||||
throw(IllegalArgument);
|
throw(IllegalArgument);
|
||||||
bool badOption(char const * reason, std::string const & rArg)
|
static bool badOption(char const * reason, std::string const & rArg)
|
||||||
throw(IllegalArgument);
|
throw(IllegalArgument);
|
||||||
bool setOption(char const * option, std::string const & rArg);
|
bool setOption(char const * option, std::string const & rArg);
|
||||||
|
|
||||||
|
@ -1088,7 +1088,7 @@ AstExprValue* AstExpression::eval_symbol(EvalKind ek)
|
|||||||
*/
|
*/
|
||||||
if (m_pSymbolicName == NULL)
|
if (m_pSymbolicName == NULL)
|
||||||
{
|
{
|
||||||
idlc()->error()->evalError(this);
|
ErrorHandler::evalError(this);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
@ -1098,7 +1098,7 @@ AstExprValue* AstExpression::eval_symbol(EvalKind ek)
|
|||||||
pScope = idlc()->scopes()->topNonNull();
|
pScope = idlc()->scopes()->topNonNull();
|
||||||
if ( !pScope )
|
if ( !pScope )
|
||||||
{
|
{
|
||||||
idlc()->error()->lookupError(*m_pSymbolicName);
|
ErrorHandler::lookupError(*m_pSymbolicName);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
@ -1107,7 +1107,7 @@ AstExprValue* AstExpression::eval_symbol(EvalKind ek)
|
|||||||
pDecl = pScope->lookupByName(*m_pSymbolicName);
|
pDecl = pScope->lookupByName(*m_pSymbolicName);
|
||||||
if (pDecl == NULL)
|
if (pDecl == NULL)
|
||||||
{
|
{
|
||||||
idlc()->error()->lookupError(*m_pSymbolicName);
|
ErrorHandler::lookupError(*m_pSymbolicName);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
@ -1116,10 +1116,10 @@ AstExprValue* AstExpression::eval_symbol(EvalKind ek)
|
|||||||
if (pDecl->getNodeType() != NT_const &&
|
if (pDecl->getNodeType() != NT_const &&
|
||||||
pDecl->getNodeType() != NT_enum_val)
|
pDecl->getNodeType() != NT_enum_val)
|
||||||
{
|
{
|
||||||
idlc()->error()->constantExpected(pDecl, *m_pSymbolicName);
|
ErrorHandler::constantExpected(pDecl, *m_pSymbolicName);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (!idlc()->error()->checkPublished(pDecl))
|
if (!ErrorHandler::checkPublished(pDecl))
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ AstDeclaration* AstScope::addDeclaration(AstDeclaration* pDecl)
|
|||||||
{
|
{
|
||||||
if ( pDecl->hasAncestor(pDeclaration) )
|
if ( pDecl->hasAncestor(pDeclaration) )
|
||||||
{
|
{
|
||||||
idlc()->error()->error2(EIDL_REDEF_SCOPE, pDecl, pDeclaration);
|
ErrorHandler::error2(EIDL_REDEF_SCOPE, pDecl, pDeclaration);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if ( (pDecl->getNodeType() == pDeclaration->getNodeType()) &&
|
if ( (pDecl->getNodeType() == pDeclaration->getNodeType()) &&
|
||||||
@ -75,7 +75,7 @@ AstDeclaration* AstScope::addDeclaration(AstDeclaration* pDecl)
|
|||||||
return pDecl;
|
return pDecl;
|
||||||
}
|
}
|
||||||
|
|
||||||
idlc()->error()->error2(EIDL_REDEF_SCOPE, scopeAsDecl(this), pDecl);
|
ErrorHandler::error2(EIDL_REDEF_SCOPE, scopeAsDecl(this), pDecl);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -221,7 +221,7 @@ AstDeclaration* AstScope::lookupInInherited(const OString& scopedName) const
|
|||||||
// Can't look in an interface which was not yet defined
|
// Can't look in an interface which was not yet defined
|
||||||
if ( !pInterface->getScope() )
|
if ( !pInterface->getScope() )
|
||||||
{
|
{
|
||||||
idlc()->error()->forwardLookupError(pInterface, scopedName);
|
ErrorHandler::forwardLookupError(pInterface, scopedName);
|
||||||
}
|
}
|
||||||
|
|
||||||
// OK, loop through inherited interfaces. Stop when you find it
|
// OK, loop through inherited interfaces. Stop when you find it
|
||||||
|
@ -55,7 +55,7 @@ AstType const * FeDeclarator::compose(AstDeclaration const * pDecl)
|
|||||||
}
|
}
|
||||||
if ( !pDecl->isType() )
|
if ( !pDecl->isType() )
|
||||||
{
|
{
|
||||||
idlc()->error()->noTypeError(pDecl);
|
ErrorHandler::noTypeError(pDecl);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
pType = static_cast<const AstType*>(pDecl);
|
pType = static_cast<const AstType*>(pDecl);
|
||||||
@ -92,20 +92,20 @@ void FeInheritanceHeader::initializeInherits(OString* pInherits)
|
|||||||
|| static_cast< AstInterface const * >(
|
|| static_cast< AstInterface const * >(
|
||||||
resolved)->isDefined()) )
|
resolved)->isDefined()) )
|
||||||
{
|
{
|
||||||
if ( idlc()->error()->checkPublished( pDecl ) )
|
if ( ErrorHandler::checkPublished( pDecl ) )
|
||||||
{
|
{
|
||||||
m_pInherits = pDecl;
|
m_pInherits = pDecl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
idlc()->error()->inheritanceError(
|
ErrorHandler::inheritanceError(
|
||||||
getNodeType(), getName(), pDecl);
|
getNodeType(), getName(), pDecl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
idlc()->error()->lookupError(*pInherits);
|
ErrorHandler::lookupError(*pInherits);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -86,12 +86,12 @@ void checkIdentifier(::rtl::OString* id)
|
|||||||
msg.append("mismatched identifier '");
|
msg.append("mismatched identifier '");
|
||||||
msg.append(*id);
|
msg.append(*id);
|
||||||
msg.append("'");
|
msg.append("'");
|
||||||
idlc()->error()->syntaxError(idlc()->getParseState(),
|
ErrorHandler::syntaxError(idlc()->getParseState(),
|
||||||
idlc()->getLineNumber(),
|
idlc()->getLineNumber(),
|
||||||
msg.getStr());
|
msg.getStr());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
idlc()->error()->warning0(WIDL_WRONG_NAMING_CONV, id->getStr());
|
ErrorHandler::warning0(WIDL_WRONG_NAMING_CONV, id->getStr());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -102,7 +102,7 @@ void reportDoubleMemberDeclarations(
|
|||||||
doubleMembers.begin());
|
doubleMembers.begin());
|
||||||
i != doubleMembers.end(); ++i)
|
i != doubleMembers.end(); ++i)
|
||||||
{
|
{
|
||||||
idlc()->error()->error2(EIDL_DOUBLE_MEMBER, i->first, i->second);
|
ErrorHandler::error2(EIDL_DOUBLE_MEMBER, i->first, i->second);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -113,9 +113,9 @@ void addInheritedInterface(
|
|||||||
AstDeclaration * decl = ifc->lookupByName(name);
|
AstDeclaration * decl = ifc->lookupByName(name);
|
||||||
AstDeclaration const * resolved = resolveTypedefs(decl);
|
AstDeclaration const * resolved = resolveTypedefs(decl);
|
||||||
if (resolved != 0 && resolved->getNodeType() == NT_interface) {
|
if (resolved != 0 && resolved->getNodeType() == NT_interface) {
|
||||||
if (idlc()->error()->checkPublished(decl)) {
|
if (ErrorHandler::checkPublished(decl)) {
|
||||||
if (!static_cast< AstInterface const * >(resolved)->isDefined()) {
|
if (!static_cast< AstInterface const * >(resolved)->isDefined()) {
|
||||||
idlc()->error()->inheritanceError(
|
ErrorHandler::inheritanceError(
|
||||||
NT_interface, &ifc->getScopedName(), decl);
|
NT_interface, &ifc->getScopedName(), decl);
|
||||||
} else {
|
} else {
|
||||||
AstInterface::DoubleDeclarations doubleDecls(
|
AstInterface::DoubleDeclarations doubleDecls(
|
||||||
@ -133,7 +133,7 @@ void addInheritedInterface(
|
|||||||
doubleDecls.interfaces.begin());
|
doubleDecls.interfaces.begin());
|
||||||
i != doubleDecls.interfaces.end(); ++i)
|
i != doubleDecls.interfaces.end(); ++i)
|
||||||
{
|
{
|
||||||
idlc()->error()->error1(
|
ErrorHandler::error1(
|
||||||
EIDL_DOUBLE_INHERITANCE, *i);
|
EIDL_DOUBLE_INHERITANCE, *i);
|
||||||
}
|
}
|
||||||
reportDoubleMemberDeclarations(doubleDecls.members);
|
reportDoubleMemberDeclarations(doubleDecls.members);
|
||||||
@ -141,7 +141,7 @@ void addInheritedInterface(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
idlc()->error()->lookupError(
|
ErrorHandler::lookupError(
|
||||||
EIDL_INTERFACEMEMBER_LOOKUP, name, scopeAsDecl(ifc));
|
EIDL_INTERFACEMEMBER_LOOKUP, name, scopeAsDecl(ifc));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -153,14 +153,14 @@ AstDeclaration const * createNamedType(
|
|||||||
*scopedName);
|
*scopedName);
|
||||||
AstDeclaration const * resolved = resolveTypedefs(decl);
|
AstDeclaration const * resolved = resolveTypedefs(decl);
|
||||||
if (decl == 0) {
|
if (decl == 0) {
|
||||||
idlc()->error()->lookupError(*scopedName);
|
ErrorHandler::lookupError(*scopedName);
|
||||||
} else if (!idlc()->error()->checkPublished(decl)) {
|
} else if (!ErrorHandler::checkPublished(decl)) {
|
||||||
decl = 0;
|
decl = 0;
|
||||||
} else if (resolved->getNodeType() == NT_struct) {
|
} else if (resolved->getNodeType() == NT_struct) {
|
||||||
if (static_cast< AstStruct const * >(resolved)->getTypeParameterCount()
|
if (static_cast< AstStruct const * >(resolved)->getTypeParameterCount()
|
||||||
!= (typeArgs == 0 ? 0 : typeArgs->size()))
|
!= (typeArgs == 0 ? 0 : typeArgs->size()))
|
||||||
{
|
{
|
||||||
idlc()->error()->error0(EIDL_WRONG_NUMBER_OF_TYPE_ARGUMENTS);
|
ErrorHandler::error0(EIDL_WRONG_NUMBER_OF_TYPE_ARGUMENTS);
|
||||||
decl = 0;
|
decl = 0;
|
||||||
} else if (typeArgs != 0) {
|
} else if (typeArgs != 0) {
|
||||||
AstScope * global = idlc()->scopes()->bottom();
|
AstScope * global = idlc()->scopes()->bottom();
|
||||||
@ -173,11 +173,11 @@ AstDeclaration const * createNamedType(
|
|||||||
}
|
}
|
||||||
} else if (decl->isType()) {
|
} else if (decl->isType()) {
|
||||||
if (typeArgs != 0) {
|
if (typeArgs != 0) {
|
||||||
idlc()->error()->error0(EIDL_WRONG_NUMBER_OF_TYPE_ARGUMENTS);
|
ErrorHandler::error0(EIDL_WRONG_NUMBER_OF_TYPE_ARGUMENTS);
|
||||||
decl = 0;
|
decl = 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
idlc()->error()->noTypeError(decl);
|
ErrorHandler::noTypeError(decl);
|
||||||
decl = 0;
|
decl = 0;
|
||||||
}
|
}
|
||||||
delete scopedName;
|
delete scopedName;
|
||||||
@ -534,7 +534,7 @@ forward_dcl :
|
|||||||
delete pForward;
|
delete pForward;
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
idlc()->error()->error2(EIDL_REDEF_SCOPE, scopeAsDecl(pScope), pDecl);
|
ErrorHandler::error2(EIDL_REDEF_SCOPE, scopeAsDecl(pScope), pDecl);
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
@ -583,14 +583,14 @@ interface_dcl :
|
|||||||
{
|
{
|
||||||
if ( pForward->getScopedName() != pInterface->getScopedName() )
|
if ( pForward->getScopedName() != pInterface->getScopedName() )
|
||||||
{
|
{
|
||||||
idlc()->error()->error3(EIDL_SCOPE_CONFLICT,
|
ErrorHandler::error3(EIDL_SCOPE_CONFLICT,
|
||||||
pInterface, pForward, scopeAsDecl(pScope));
|
pInterface, pForward, scopeAsDecl(pScope));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( !pInterface->isPublished()
|
else if ( !pInterface->isPublished()
|
||||||
&& pForward->isPublished() )
|
&& pForward->isPublished() )
|
||||||
{
|
{
|
||||||
idlc()->error()->error0(EIDL_PUBLISHED_FORWARD);
|
ErrorHandler::error0(EIDL_PUBLISHED_FORWARD);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* All OK, set full definition
|
* All OK, set full definition
|
||||||
@ -728,7 +728,7 @@ attribute :
|
|||||||
{
|
{
|
||||||
idlc()->setParseState(PS_AttrCompleted);
|
idlc()->setParseState(PS_AttrCompleted);
|
||||||
if (($1 & ~(AF_BOUND | AF_READONLY)) != AF_ATTRIBUTE) {
|
if (($1 & ~(AF_BOUND | AF_READONLY)) != AF_ATTRIBUTE) {
|
||||||
idlc()->error()->flagError(EIDL_BAD_ATTRIBUTE_FLAGS, $1);
|
ErrorHandler::flagError(EIDL_BAD_ATTRIBUTE_FLAGS, $1);
|
||||||
}
|
}
|
||||||
AstInterface * scope = static_cast< AstInterface * >(
|
AstInterface * scope = static_cast< AstInterface * >(
|
||||||
idlc()->scopes()->top());
|
idlc()->scopes()->top());
|
||||||
@ -769,7 +769,7 @@ opt_attrflags :
|
|||||||
opt_attrflags ',' opt_attrflag
|
opt_attrflags ',' opt_attrflag
|
||||||
{
|
{
|
||||||
if ( ($1 & $3) == $3 )
|
if ( ($1 & $3) == $3 )
|
||||||
idlc()->error()->flagError(EIDL_DEFINED_ATTRIBUTEFLAG, $3);
|
ErrorHandler::flagError(EIDL_DEFINED_ATTRIBUTEFLAG, $3);
|
||||||
|
|
||||||
$$ = $1 | $3;
|
$$ = $1 | $3;
|
||||||
}
|
}
|
||||||
@ -914,7 +914,7 @@ attribute_set_raises:
|
|||||||
if (static_cast< AstAttribute * >(idlc()->scopes()->top())->
|
if (static_cast< AstAttribute * >(idlc()->scopes()->top())->
|
||||||
isReadonly())
|
isReadonly())
|
||||||
{
|
{
|
||||||
idlc()->error()->error0(EIDL_READONLY_ATTRIBUTE_SET_EXCEPTIONS);
|
ErrorHandler::error0(EIDL_READONLY_ATTRIBUTE_SET_EXCEPTIONS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
raises ';'
|
raises ';'
|
||||||
@ -1057,10 +1057,10 @@ parameter :
|
|||||||
if ( pType )
|
if ( pType )
|
||||||
{
|
{
|
||||||
if (pScope->isConstructor() && $2 != DIR_IN) {
|
if (pScope->isConstructor() && $2 != DIR_IN) {
|
||||||
idlc()->error()->error0(EIDL_CONSTRUCTOR_PARAMETER_NOT_IN);
|
ErrorHandler::error0(EIDL_CONSTRUCTOR_PARAMETER_NOT_IN);
|
||||||
}
|
}
|
||||||
if (pScope->isVariadic()) {
|
if (pScope->isVariadic()) {
|
||||||
idlc()->error()->error0(EIDL_REST_PARAMETER_NOT_LAST);
|
ErrorHandler::error0(EIDL_REST_PARAMETER_NOT_LAST);
|
||||||
}
|
}
|
||||||
if ($7) {
|
if ($7) {
|
||||||
AstDeclaration const * type = resolveTypedefs(pType);
|
AstDeclaration const * type = resolveTypedefs(pType);
|
||||||
@ -1068,17 +1068,17 @@ parameter :
|
|||||||
|| (static_cast< AstBaseType const * >(type)->
|
|| (static_cast< AstBaseType const * >(type)->
|
||||||
getExprType() != ET_any))
|
getExprType() != ET_any))
|
||||||
{
|
{
|
||||||
idlc()->error()->error0(EIDL_REST_PARAMETER_NOT_ANY);
|
ErrorHandler::error0(EIDL_REST_PARAMETER_NOT_ANY);
|
||||||
}
|
}
|
||||||
if (pScope->isConstructor()) {
|
if (pScope->isConstructor()) {
|
||||||
if (pScope->getIteratorBegin()
|
if (pScope->getIteratorBegin()
|
||||||
!= pScope->getIteratorEnd())
|
!= pScope->getIteratorEnd())
|
||||||
{
|
{
|
||||||
idlc()->error()->error0(
|
ErrorHandler::error0(
|
||||||
EIDL_CONSTRUCTOR_REST_PARAMETER_NOT_FIRST);
|
EIDL_CONSTRUCTOR_REST_PARAMETER_NOT_FIRST);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
idlc()->error()->error0(EIDL_METHOD_HAS_REST_PARAMETER);
|
ErrorHandler::error0(EIDL_METHOD_HAS_REST_PARAMETER);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1176,11 +1176,11 @@ exception_name:
|
|||||||
AstDeclaration * decl = idlc()->scopes()->nextToTop()->lookupByName(
|
AstDeclaration * decl = idlc()->scopes()->nextToTop()->lookupByName(
|
||||||
*$1);
|
*$1);
|
||||||
if (decl == 0) {
|
if (decl == 0) {
|
||||||
idlc()->error()->lookupError(*$1);
|
ErrorHandler::lookupError(*$1);
|
||||||
} else if (!idlc()->error()->checkPublished(decl)) {
|
} else if (!ErrorHandler::checkPublished(decl)) {
|
||||||
decl = 0;
|
decl = 0;
|
||||||
} else if (decl->getNodeType() != NT_exception) {
|
} else if (decl->getNodeType() != NT_exception) {
|
||||||
idlc()->error()->error1(EIDL_ILLEGAL_RAISES, decl);
|
ErrorHandler::error1(EIDL_ILLEGAL_RAISES, decl);
|
||||||
decl = 0;
|
decl = 0;
|
||||||
}
|
}
|
||||||
delete $1;
|
delete $1;
|
||||||
@ -1199,7 +1199,7 @@ interface_inheritance_decl:
|
|||||||
AstInterface * ifc = static_cast< AstInterface * >(
|
AstInterface * ifc = static_cast< AstInterface * >(
|
||||||
idlc()->scopes()->top());
|
idlc()->scopes()->top());
|
||||||
if (ifc->usesSingleInheritance()) {
|
if (ifc->usesSingleInheritance()) {
|
||||||
idlc()->error()->error0(EIDL_MIXED_INHERITANCE);
|
ErrorHandler::error0(EIDL_MIXED_INHERITANCE);
|
||||||
} else {
|
} else {
|
||||||
addInheritedInterface(
|
addInheritedInterface(
|
||||||
ifc, *$4, $1,
|
ifc, *$4, $1,
|
||||||
@ -1249,7 +1249,7 @@ constants_export :
|
|||||||
{
|
{
|
||||||
if ( !$9->coerce($3) )
|
if ( !$9->coerce($3) )
|
||||||
{
|
{
|
||||||
idlc()->error()->coercionError($9, $3);
|
ErrorHandler::coercionError($9, $3);
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
pConstant = new AstConstant($3, $9, *$5, pScope);
|
pConstant = new AstConstant($3, $9, *$5, pScope);
|
||||||
@ -1440,7 +1440,7 @@ positive_int_expr :
|
|||||||
$1->evaluate(EK_const);
|
$1->evaluate(EK_const);
|
||||||
if ( !$1->coerce(ET_ulong) )
|
if ( !$1->coerce(ET_ulong) )
|
||||||
{
|
{
|
||||||
idlc()->error()->coercionError($1, ET_ulong);
|
ErrorHandler::coercionError($1, ET_ulong);
|
||||||
delete $1;
|
delete $1;
|
||||||
$$ = NULL;
|
$$ = NULL;
|
||||||
}
|
}
|
||||||
@ -1462,7 +1462,7 @@ const_type :
|
|||||||
* to a scalar constant type
|
* to a scalar constant type
|
||||||
*/
|
*/
|
||||||
if ( pScope && (type = pScope->lookupByName(*$1)) ) {
|
if ( pScope && (type = pScope->lookupByName(*$1)) ) {
|
||||||
if (!idlc()->error()->checkPublished(type))
|
if (!ErrorHandler::checkPublished(type))
|
||||||
{
|
{
|
||||||
type = 0;
|
type = 0;
|
||||||
$$ = ET_none;
|
$$ = ET_none;
|
||||||
@ -1556,14 +1556,14 @@ property :
|
|||||||
|
|
||||||
if ( pScope->getScopeNodeType() == NT_singleton )
|
if ( pScope->getScopeNodeType() == NT_singleton )
|
||||||
{
|
{
|
||||||
idlc()->error()->error0(EIDL_ILLEGAL_ADD);
|
ErrorHandler::error0(EIDL_ILLEGAL_ADD);
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
if ( ($1 & AF_ATTRIBUTE) == AF_ATTRIBUTE )
|
if ( ($1 & AF_ATTRIBUTE) == AF_ATTRIBUTE )
|
||||||
idlc()->error()->flagError(EIDL_WRONGATTRIBUTEKEYWORD, AF_ATTRIBUTE);
|
ErrorHandler::flagError(EIDL_WRONGATTRIBUTEKEYWORD, AF_ATTRIBUTE);
|
||||||
|
|
||||||
if ( ($1 & AF_PROPERTY) != AF_PROPERTY )
|
if ( ($1 & AF_PROPERTY) != AF_PROPERTY )
|
||||||
idlc()->error()->flagError(EIDL_MISSINGATTRIBUTEKEYWORD, AF_PROPERTY);
|
ErrorHandler::flagError(EIDL_MISSINGATTRIBUTEKEYWORD, AF_PROPERTY);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Create nodes representing attributes and add them to the
|
* Create nodes representing attributes and add them to the
|
||||||
@ -1628,7 +1628,7 @@ service_export :
|
|||||||
|
|
||||||
if ( pScope->getScopeNodeType() == NT_singleton )
|
if ( pScope->getScopeNodeType() == NT_singleton )
|
||||||
{
|
{
|
||||||
idlc()->error()->error0(EIDL_ILLEGAL_ADD);
|
ErrorHandler::error0(EIDL_ILLEGAL_ADD);
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
@ -1649,7 +1649,7 @@ service_export :
|
|||||||
* interfaces if they are optional
|
* interfaces if they are optional
|
||||||
*/
|
*/
|
||||||
bool bOptional = (($1 & AF_OPTIONAL) == AF_OPTIONAL);
|
bool bOptional = (($1 & AF_OPTIONAL) == AF_OPTIONAL);
|
||||||
if ( idlc()->error()->checkPublished(pDecl, bOptional) )
|
if ( ErrorHandler::checkPublished(pDecl, bOptional) )
|
||||||
{
|
{
|
||||||
pIMember = new AstInterfaceMember(
|
pIMember = new AstInterfaceMember(
|
||||||
$1, (AstInterface*)pDecl, *iter, pScope);
|
$1, (AstInterface*)pDecl, *iter, pScope);
|
||||||
@ -1657,8 +1657,7 @@ service_export :
|
|||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
idlc()->error()->
|
ErrorHandler::lookupError(EIDL_INTERFACEMEMBER_LOOKUP, *iter, scopeAsDecl(pScope));
|
||||||
lookupError(EIDL_INTERFACEMEMBER_LOOKUP, *iter, scopeAsDecl(pScope));
|
|
||||||
}
|
}
|
||||||
iter++;
|
iter++;
|
||||||
}
|
}
|
||||||
@ -1691,8 +1690,8 @@ service_export :
|
|||||||
if ( pDecl && (pDecl->getNodeType() == NT_service) )
|
if ( pDecl && (pDecl->getNodeType() == NT_service) )
|
||||||
{
|
{
|
||||||
if ( static_cast< AstService * >(pDecl)->isSingleInterfaceBasedService() || (pScope->getScopeNodeType() == NT_singleton && pScope->nMembers() > 0) )
|
if ( static_cast< AstService * >(pDecl)->isSingleInterfaceBasedService() || (pScope->getScopeNodeType() == NT_singleton && pScope->nMembers() > 0) )
|
||||||
idlc()->error()->error0(EIDL_ILLEGAL_ADD);
|
ErrorHandler::error0(EIDL_ILLEGAL_ADD);
|
||||||
else if ( idlc()->error()->checkPublished(pDecl) )
|
else if ( ErrorHandler::checkPublished(pDecl) )
|
||||||
{
|
{
|
||||||
pSMember = new AstServiceMember(
|
pSMember = new AstServiceMember(
|
||||||
$1, (AstService*)pDecl, *iter, pScope);
|
$1, (AstService*)pDecl, *iter, pScope);
|
||||||
@ -1700,8 +1699,7 @@ service_export :
|
|||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
idlc()->error()->
|
ErrorHandler::lookupError(EIDL_SERVICEMEMBER_LOOKUP, *iter, scopeAsDecl(pScope));
|
||||||
lookupError(EIDL_SERVICEMEMBER_LOOKUP, *iter, scopeAsDecl(pScope));
|
|
||||||
}
|
}
|
||||||
iter++;
|
iter++;
|
||||||
}
|
}
|
||||||
@ -1720,7 +1718,7 @@ service_export :
|
|||||||
|
|
||||||
if ( pScope->getScopeNodeType() == NT_singleton )
|
if ( pScope->getScopeNodeType() == NT_singleton )
|
||||||
{
|
{
|
||||||
idlc()->error()->error0(EIDL_ILLEGAL_ADD);
|
ErrorHandler::error0(EIDL_ILLEGAL_ADD);
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
@ -1741,8 +1739,7 @@ service_export :
|
|||||||
pScope->addDeclaration(pObserves);
|
pScope->addDeclaration(pObserves);
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
idlc()->error()->
|
ErrorHandler::lookupError(EIDL_INTERFACEMEMBER_LOOKUP, *iter, scopeAsDecl(pScope));
|
||||||
lookupError(EIDL_INTERFACEMEMBER_LOOKUP, *iter, scopeAsDecl(pScope));
|
|
||||||
}
|
}
|
||||||
iter++;
|
iter++;
|
||||||
}
|
}
|
||||||
@ -1762,7 +1759,7 @@ service_export :
|
|||||||
|
|
||||||
if ( pScope->getScopeNodeType() == NT_singleton )
|
if ( pScope->getScopeNodeType() == NT_singleton )
|
||||||
{
|
{
|
||||||
idlc()->error()->error0(EIDL_ILLEGAL_ADD);
|
ErrorHandler::error0(EIDL_ILLEGAL_ADD);
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
@ -1783,8 +1780,7 @@ service_export :
|
|||||||
pScope->addDeclaration(pNeeds);
|
pScope->addDeclaration(pNeeds);
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
idlc()->error()->
|
ErrorHandler::lookupError(EIDL_SERVICEMEMBER_LOOKUP, *iter, scopeAsDecl(pScope));
|
||||||
lookupError(EIDL_SERVICEMEMBER_LOOKUP, *iter, scopeAsDecl(pScope));
|
|
||||||
}
|
}
|
||||||
iter++;
|
iter++;
|
||||||
}
|
}
|
||||||
@ -1810,7 +1806,7 @@ service_interface_header :
|
|||||||
{
|
{
|
||||||
idlc()->setParseState(PS_ServiceIFHeadSeen);
|
idlc()->setParseState(PS_ServiceIFHeadSeen);
|
||||||
if ( (AF_OPTIONAL != $1) && ( AF_INVALID != $1) )
|
if ( (AF_OPTIONAL != $1) && ( AF_INVALID != $1) )
|
||||||
idlc()->error()->flagError(EIDL_OPTIONALEXPECTED, $1);
|
ErrorHandler::flagError(EIDL_OPTIONALEXPECTED, $1);
|
||||||
$$ = $1;
|
$$ = $1;
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
@ -1826,7 +1822,7 @@ service_service_header :
|
|||||||
{
|
{
|
||||||
idlc()->setParseState(PS_ServiceSHeadSeen);
|
idlc()->setParseState(PS_ServiceSHeadSeen);
|
||||||
if ( (AF_OPTIONAL != $1) && ( AF_INVALID != $1) )
|
if ( (AF_OPTIONAL != $1) && ( AF_INVALID != $1) )
|
||||||
idlc()->error()->flagError(EIDL_OPTIONALEXPECTED, $1);
|
ErrorHandler::flagError(EIDL_OPTIONALEXPECTED, $1);
|
||||||
$$ = $1;
|
$$ = $1;
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
@ -1877,11 +1873,11 @@ service_interface_dfn:
|
|||||||
// skip the scope pushed by service_dcl
|
// skip the scope pushed by service_dcl
|
||||||
AstDeclaration * decl = scope->lookupByName(*$2);
|
AstDeclaration * decl = scope->lookupByName(*$2);
|
||||||
if (decl != 0 && resolveTypedefs(decl)->getNodeType() == NT_interface) {
|
if (decl != 0 && resolveTypedefs(decl)->getNodeType() == NT_interface) {
|
||||||
if (idlc()->error()->checkPublished(decl)) {
|
if (ErrorHandler::checkPublished(decl)) {
|
||||||
idlc()->scopes()->top()->addDeclaration(decl);
|
idlc()->scopes()->top()->addDeclaration(decl);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
idlc()->error()->lookupError(
|
ErrorHandler::lookupError(
|
||||||
EIDL_INTERFACEMEMBER_LOOKUP, *$2, scopeAsDecl(scope));
|
EIDL_INTERFACEMEMBER_LOOKUP, *$2, scopeAsDecl(scope));
|
||||||
}
|
}
|
||||||
delete $2;
|
delete $2;
|
||||||
@ -1934,7 +1930,7 @@ constructor:
|
|||||||
if (static_cast< AstService * >(idlc()->scopes()->top())->
|
if (static_cast< AstService * >(idlc()->scopes()->top())->
|
||||||
checkLastConstructor())
|
checkLastConstructor())
|
||||||
{
|
{
|
||||||
idlc()->error()->error0(EIDL_SIMILAR_CONSTRUCTORS);
|
ErrorHandler::error0(EIDL_SIMILAR_CONSTRUCTORS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
';'
|
';'
|
||||||
@ -1986,11 +1982,11 @@ singleton_interface_dfn:
|
|||||||
// skip the scope (needlessly) pushed by singleton_dcl
|
// skip the scope (needlessly) pushed by singleton_dcl
|
||||||
AstDeclaration * decl = scope->lookupByName(*$2);
|
AstDeclaration * decl = scope->lookupByName(*$2);
|
||||||
if (decl != 0 && resolveTypedefs(decl)->getNodeType() == NT_interface) {
|
if (decl != 0 && resolveTypedefs(decl)->getNodeType() == NT_interface) {
|
||||||
if (idlc()->error()->checkPublished(decl)) {
|
if (ErrorHandler::checkPublished(decl)) {
|
||||||
idlc()->scopes()->top()->addDeclaration(decl);
|
idlc()->scopes()->top()->addDeclaration(decl);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
idlc()->error()->lookupError(
|
ErrorHandler::lookupError(
|
||||||
EIDL_INTERFACEMEMBER_LOOKUP, *$2, scopeAsDecl(scope));
|
EIDL_INTERFACEMEMBER_LOOKUP, *$2, scopeAsDecl(scope));
|
||||||
}
|
}
|
||||||
delete $2;
|
delete $2;
|
||||||
@ -2033,7 +2029,7 @@ type_declarator :
|
|||||||
{
|
{
|
||||||
idlc()->setParseState(PS_TypeSpecSeen);
|
idlc()->setParseState(PS_TypeSpecSeen);
|
||||||
if ($1 != 0 && $1->getNodeType() == NT_instantiated_struct) {
|
if ($1 != 0 && $1->getNodeType() == NT_instantiated_struct) {
|
||||||
idlc()->error()->error0(EIDL_INSTANTIATED_STRUCT_TYPE_TYPEDEF);
|
ErrorHandler::error0(EIDL_INSTANTIATED_STRUCT_TYPE_TYPEDEF);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
at_least_one_declarator
|
at_least_one_declarator
|
||||||
@ -2265,7 +2261,7 @@ type_arg:
|
|||||||
simple_type_spec
|
simple_type_spec
|
||||||
{
|
{
|
||||||
if ($1 != 0 && static_cast< AstType const * >($1)->isUnsigned()) {
|
if ($1 != 0 && static_cast< AstType const * >($1)->isUnsigned()) {
|
||||||
idlc()->error()->error0(EIDL_UNSIGNED_TYPE_ARGUMENT);
|
ErrorHandler::error0(EIDL_UNSIGNED_TYPE_ARGUMENT);
|
||||||
}
|
}
|
||||||
$$ = $1;
|
$$ = $1;
|
||||||
}
|
}
|
||||||
@ -2500,7 +2496,7 @@ structure_header :
|
|||||||
// type bases, which might also cause problems in language bindings, are
|
// type bases, which might also cause problems in language bindings, are
|
||||||
// already rejected on a syntactic level.)
|
// already rejected on a syntactic level.)
|
||||||
if ($5 != 0 && $6 != 0) {
|
if ($5 != 0 && $6 != 0) {
|
||||||
idlc()->error()->error0(EIDL_STRUCT_TYPE_TEMPLATE_WITH_BASE);
|
ErrorHandler::error0(EIDL_STRUCT_TYPE_TEMPLATE_WITH_BASE);
|
||||||
}
|
}
|
||||||
|
|
||||||
$$ = new FeInheritanceHeader(NT_struct, $3, $6, $5);
|
$$ = new FeInheritanceHeader(NT_struct, $3, $6, $5);
|
||||||
@ -2524,7 +2520,7 @@ type_params:
|
|||||||
| type_params ',' identifier
|
| type_params ',' identifier
|
||||||
{
|
{
|
||||||
if (std::find($1->begin(), $1->end(), *$3) != $1->end()) {
|
if (std::find($1->begin(), $1->end(), *$3) != $1->end()) {
|
||||||
idlc()->error()->error0(EIDL_IDENTICAL_TYPE_PARAMETERS);
|
ErrorHandler::error0(EIDL_IDENTICAL_TYPE_PARAMETERS);
|
||||||
}
|
}
|
||||||
$1->push_back(*$3);
|
$1->push_back(*$3);
|
||||||
delete $3;
|
delete $3;
|
||||||
@ -2617,7 +2613,7 @@ type_or_parameter:
|
|||||||
} else {
|
} else {
|
||||||
decl = createNamedType($1, $2);
|
decl = createNamedType($1, $2);
|
||||||
if (scope != 0 && includes(decl, scopeAsDecl(scope))) {
|
if (scope != 0 && includes(decl, scopeAsDecl(scope))) {
|
||||||
idlc()->error()->error1(
|
ErrorHandler::error1(
|
||||||
EIDL_RECURSIVE_TYPE, scopeAsDecl(scope));
|
EIDL_RECURSIVE_TYPE, scopeAsDecl(scope));
|
||||||
decl = 0;
|
decl = 0;
|
||||||
}
|
}
|
||||||
@ -2718,7 +2714,7 @@ enumerator :
|
|||||||
pExpr, *$1, pScope);
|
pExpr, *$1, pScope);
|
||||||
}
|
}
|
||||||
if ( pEnum->checkValue(pEnumVal->getConstValue()) )
|
if ( pEnum->checkValue(pEnumVal->getConstValue()) )
|
||||||
idlc()->error()->error1(EIDL_EVAL_ERROR, pEnum);
|
ErrorHandler::error1(EIDL_EVAL_ERROR, pEnum);
|
||||||
|
|
||||||
pScope->addDeclaration(pEnumVal);
|
pScope->addDeclaration(pEnumVal);
|
||||||
}
|
}
|
||||||
@ -2746,12 +2742,12 @@ enumerator :
|
|||||||
$3, *$1, pScope);
|
$3, *$1, pScope);
|
||||||
}
|
}
|
||||||
if ( pEnum->checkValue(pEnumVal->getConstValue()) )
|
if ( pEnum->checkValue(pEnumVal->getConstValue()) )
|
||||||
idlc()->error()->error1(EIDL_EVAL_ERROR, pEnum);
|
ErrorHandler::error1(EIDL_EVAL_ERROR, pEnum);
|
||||||
|
|
||||||
pScope->addDeclaration(pEnumVal);
|
pScope->addDeclaration(pEnumVal);
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
idlc()->error()->coercionError($3, ET_long);
|
ErrorHandler::coercionError($3, ET_long);
|
||||||
delete $3;
|
delete $3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2773,7 +2769,7 @@ identifier:
|
|||||||
*/
|
*/
|
||||||
void yyerror(char const *errmsg)
|
void yyerror(char const *errmsg)
|
||||||
{
|
{
|
||||||
idlc()->error()->syntaxError(idlc()->getParseState(), idlc()->getLineNumber(), errmsg);
|
ErrorHandler::syntaxError(idlc()->getParseState(), idlc()->getLineNumber(), errmsg);
|
||||||
idlc()->setParseState(PS_NoState);
|
idlc()->setParseState(PS_NoState);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user