summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-02-16 10:12:15 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-02-16 12:42:04 +0200
commitd00431fd36eefe52d87dbc3d254d9d0ae464a333 (patch)
tree4ffa95cc1d741c5434a33a96999543d2f2e7e541
parent9651424f73a45679fcd1f6cc596e56c7432640d9 (diff)
convert ErrorCode to scoped enum
and drop unused enumerators Change-Id: I7330ebf8feead7b67e67f73ba942979e4756269d
-rw-r--r--idlc/inc/errorhandler.hxx92
-rw-r--r--idlc/source/astscope.cxx4
-rw-r--r--idlc/source/errorhandler.cxx116
-rw-r--r--idlc/source/parser.y82
4 files changed, 132 insertions, 162 deletions
diff --git a/idlc/inc/errorhandler.hxx b/idlc/inc/errorhandler.hxx
index 2e953617b78b..f906ff7395e7 100644
--- a/idlc/inc/errorhandler.hxx
+++ b/idlc/inc/errorhandler.hxx
@@ -23,58 +23,48 @@
#include <astexpression.hxx>
#include <astenum.hxx>
-enum ErrorCode
+enum class ErrorCode
{
- EIDL_NONE, // No error
- EIDL_SYNTAX_ERROR, // Syntax error in IDL input
- // More details will be gleaned from examining
- // the parse state
- EIDL_REDEF, // Redefinition
- EIDL_REDEF_SCOPE, // Redefinition inside defining scope
- EIDL_DEF_USE, // Definition after use
- EIDL_COERCION_FAILURE, // Coercion failure
- EIDL_SCOPE_CONFLICT, // Between fwd declare and full declare
- EIDL_ILLEGAL_ADD, // Illegal add action
- EIDL_ILLEGAL_USE, // Illegal type used in expression
- EIDL_ILLEGAL_RAISES, // Error in "raises" clause
- EIDL_CANT_INHERIT, // Cannot inherit from non-interface
- EIDL_LOOKUP_ERROR, // Identifier not found
- EIDL_INHERIT_FWD_ERROR, // Cannot inherit from fwd decl interface
- EIDL_CONSTANT_EXPECTED, // We got something else..
- EIDL_NAME_CASE_ERROR, // Spelling differences found
- EIDL_EVAL_ERROR, // Error in evaluating expression
- EIDL_AMBIGUOUS, // Ambiguous name definition
- EIDL_DECL_NOT_DEFINED, // Forward declared but never defined
- EIDL_FWD_DECL_LOOKUP, // Tried to lookup in fwd declared intf
- EIDL_RECURSIVE_TYPE, // Illegal recursive use of type
- EIDL_NOT_A_TYPE, // Not a type
- EIDL_TYPE_NOT_VALID, // Type is not valid in this context
- EIDL_INTERFACEMEMBER_LOOKUP, // interface is not defined or a fwd declaration not exists
- EIDL_SERVICEMEMBER_LOOKUP,
- EIDL_TYPE_IDENT_CONFLICT, // type and identifier has equal names
- EIDL_WRONGATTRIBUTEFLAG,
- EIDL_DEFINED_ATTRIBUTEFLAG,
- EIDL_WRONGATTRIBUTEKEYWORD,
- EIDL_MISSINGATTRIBUTEKEYWORD,
- EIDL_BAD_ATTRIBUTE_FLAGS,
- EIDL_OPTIONALEXPECTED,
- EIDL_MIXED_INHERITANCE,
- EIDL_DOUBLE_INHERITANCE,
- EIDL_DOUBLE_MEMBER,
- EIDL_CONSTRUCTOR_PARAMETER_NOT_IN,
- EIDL_CONSTRUCTOR_REST_PARAMETER_NOT_FIRST,
- EIDL_REST_PARAMETER_NOT_LAST,
- EIDL_REST_PARAMETER_NOT_ANY,
- EIDL_METHOD_HAS_REST_PARAMETER,
- EIDL_READONLY_ATTRIBUTE_SET_EXCEPTIONS,
- EIDL_UNSIGNED_TYPE_ARGUMENT,
- EIDL_WRONG_NUMBER_OF_TYPE_ARGUMENTS,
- EIDL_INSTANTIATED_STRUCT_TYPE_TYPEDEF,
- EIDL_IDENTICAL_TYPE_PARAMETERS,
- EIDL_STRUCT_TYPE_TEMPLATE_WITH_BASE,
- EIDL_PUBLISHED_FORWARD,
- EIDL_PUBLISHED_USES_UNPUBLISHED,
- EIDL_SIMILAR_CONSTRUCTORS
+ SyntaxError, // Syntax error in IDL input
+ // More details will be gleaned from examining
+ // the parse state
+ RedefScope, // Redefinition inside defining scope
+ CoercionFailure, // Coercion failure
+ ScopeConflict, // Between fwd declare and full declare
+ IllegalAdd, // Illegal add action
+ IllegalRaises, // Error in "raises" clause
+ CantInherit, // Cannot inherit from non-interface
+ IdentNotFound, // Identifier not found
+ CannotInheritFromForward, // Cannot inherit from fwd decl interface
+ ExpectedConstant, // We got something else..
+ Eval, // Error in evaluating expression
+ ForwardDeclLookup, // Tried to lookup in fwd declared intf
+ RecursiveType, // Illegal recursive use of type
+ NotAType, // Not a type
+ InterfaceMemberLookup, // interface is not defined or a fwd declaration not exists
+ ServiceMemberLookup,
+ DefinedAttributeFlag,
+ WrongAttributeKeyword,
+ MissingAttributeKeyword,
+ BadAttributeFlags,
+ ExpectedOptional,
+ MixedInheritance,
+ DoubleInheritance,
+ DoubleMember,
+ ConstructorParameterNotIn,
+ ConstructorRestParameterNotFirst,
+ RestParameterNotLast,
+ RestParameterNotAny,
+ MethodHasRestParameter,
+ ReadOnlyAttributeSetExceptions,
+ UnsignedTypeArgument,
+ WrongNumberOfTypeArguments,
+ InstantiatedStructTypeTypedef,
+ IdenticalTypeParameters,
+ StructTypeTemplateWithBase,
+ PublishedForward,
+ PublishedusesUnpublished,
+ SimilarConstructors
};
enum class WarningCode
diff --git a/idlc/source/astscope.cxx b/idlc/source/astscope.cxx
index 7c064bd9dc3b..c999257e1eba 100644
--- a/idlc/source/astscope.cxx
+++ b/idlc/source/astscope.cxx
@@ -48,7 +48,7 @@ AstDeclaration* AstScope::addDeclaration(AstDeclaration* pDecl)
{
if ( pDecl->hasAncestor(pDeclaration) )
{
- ErrorHandler::error2(EIDL_REDEF_SCOPE, pDecl, pDeclaration);
+ ErrorHandler::error2(ErrorCode::RedefScope, pDecl, pDeclaration);
return nullptr;
}
if ( (pDecl->getNodeType() == pDeclaration->getNodeType()) &&
@@ -75,7 +75,7 @@ AstDeclaration* AstScope::addDeclaration(AstDeclaration* pDecl)
return pDecl;
}
- ErrorHandler::error2(EIDL_REDEF_SCOPE, scopeAsDecl(this), pDecl);
+ ErrorHandler::error2(ErrorCode::RedefScope, scopeAsDecl(this), pDecl);
return nullptr;
}
diff --git a/idlc/source/errorhandler.cxx b/idlc/source/errorhandler.cxx
index 4fd23868bad0..ac3aeee77b8e 100644
--- a/idlc/source/errorhandler.cxx
+++ b/idlc/source/errorhandler.cxx
@@ -24,118 +24,98 @@ static const sal_Char* errorCodeToMessage(ErrorCode eCode)
{
switch (eCode)
{
- case EIDL_NONE:
- return "all is fine ";
- case EIDL_SYNTAX_ERROR:
+ case ErrorCode::SyntaxError:
return "";
- case EIDL_REDEF:
- return "illegal redefinition ";
- case EIDL_REDEF_SCOPE:
+ case ErrorCode::RedefScope:
return "illegal redefinition in scope ";
- case EIDL_DEF_USE:
- return "redefinition after use, ";
- case EIDL_COERCION_FAILURE:
+ case ErrorCode::CoercionFailure:
return "coercion failure ";
- case EIDL_SCOPE_CONFLICT:
+ case ErrorCode::ScopeConflict:
return "definition scope is different than fwd declare scope, ";
- case EIDL_ILLEGAL_ADD:
+ case ErrorCode::IllegalAdd:
return "illegal add operation, ";
- case EIDL_ILLEGAL_USE:
- return "illegal type used in expression, ";
- case EIDL_ILLEGAL_RAISES:
+ case ErrorCode::IllegalRaises:
return "non-exception type in raises(..) clause, ";
- case EIDL_CANT_INHERIT:
+ case ErrorCode::CantInherit:
return "cannot inherit ";
- case EIDL_LOOKUP_ERROR:
+ case ErrorCode::IdentNotFound:
return "error in lookup of symbol: ";
- case EIDL_INHERIT_FWD_ERROR:
+ case ErrorCode::CannotInheritFromForward:
return "";
- case EIDL_CONSTANT_EXPECTED:
+ case ErrorCode::ExpectedConstant:
return "constant expected: ";
- case EIDL_NAME_CASE_ERROR:
- return "identifier used with two differing spellings: ";
- case EIDL_EVAL_ERROR:
+ case ErrorCode::Eval:
return "expression evaluation error: ";
- case EIDL_AMBIGUOUS:
- return "ambiguous definition: ";
- case EIDL_DECL_NOT_DEFINED:
- return "forward declared but never defined: ";
- case EIDL_FWD_DECL_LOOKUP:
+ case ErrorCode::ForwardDeclLookup:
return "";
- case EIDL_RECURSIVE_TYPE:
+ case ErrorCode::RecursiveType:
return "illegal recursive use of type: ";
- case EIDL_NOT_A_TYPE:
+ case ErrorCode::NotAType:
return "specified symbol is not a type: ";
- case EIDL_TYPE_NOT_VALID:
- return "specified type is not valid in this context: ";
- case EIDL_INTERFACEMEMBER_LOOKUP:
+ case ErrorCode::InterfaceMemberLookup:
return "error in lookup of symbol, expected interface is not defined and no forward exists: ";
- case EIDL_SERVICEMEMBER_LOOKUP:
+ case ErrorCode::ServiceMemberLookup:
return "error in lookup of symbol, expected service is not defined: ";
- case EIDL_TYPE_IDENT_CONFLICT:
- return "type and parameter/member name are equal: ";
- case EIDL_WRONGATTRIBUTEFLAG:
- return "the used flag is not valid in this context: ";
- case EIDL_DEFINED_ATTRIBUTEFLAG:
+ case ErrorCode::DefinedAttributeFlag:
return "flag is already set: ";
- case EIDL_WRONGATTRIBUTEKEYWORD:
+ case ErrorCode::WrongAttributeKeyword:
return "keyword not allowed: ";
- case EIDL_MISSINGATTRIBUTEKEYWORD:
+ case ErrorCode::MissingAttributeKeyword:
return "missing keyword: ";
- case EIDL_BAD_ATTRIBUTE_FLAGS:
+ case ErrorCode::BadAttributeFlags:
return
"the 'attribute' flag is mandatory, and only the 'bound' and"
" 'readonly' optional flags are accepted: ";
- case EIDL_OPTIONALEXPECTED:
+ case ErrorCode::ExpectedOptional:
return "only the 'optional' flag is accepted: ";
- case EIDL_MIXED_INHERITANCE:
+ case ErrorCode::MixedInheritance:
return "interface inheritance declarations cannot appear in both an"
" interface's header and its body";
- case EIDL_DOUBLE_INHERITANCE:
+ case ErrorCode::DoubleInheritance:
return
"interface is (directly or indirectly) inherited more than once: ";
- case EIDL_DOUBLE_MEMBER:
+ case ErrorCode::DoubleMember:
return
"member is (directly or indirectly) declared more than once: ";
- case EIDL_CONSTRUCTOR_PARAMETER_NOT_IN:
+ case ErrorCode::ConstructorParameterNotIn:
return
"a service constructor parameter may not be an out or inout"
" parameter";
- case EIDL_CONSTRUCTOR_REST_PARAMETER_NOT_FIRST:
+ case ErrorCode::ConstructorRestParameterNotFirst:
return
"no parameters may precede a rest parameter in a service"
" constructor";
- case EIDL_REST_PARAMETER_NOT_LAST:
+ case ErrorCode::RestParameterNotLast:
return "no parameters may follow a rest parameter";
- case EIDL_REST_PARAMETER_NOT_ANY:
+ case ErrorCode::RestParameterNotAny:
return "a rest parameter must be of type any";
- case EIDL_METHOD_HAS_REST_PARAMETER:
+ case ErrorCode::MethodHasRestParameter:
return "a rest parameter may not be used on an interface method";
- case EIDL_READONLY_ATTRIBUTE_SET_EXCEPTIONS:
+ case ErrorCode::ReadOnlyAttributeSetExceptions:
return "a readonly attribute may not have a setter raises clause";
- case EIDL_UNSIGNED_TYPE_ARGUMENT:
+ case ErrorCode::UnsignedTypeArgument:
return "an unsigned type cannot be used as a type argument";
- case EIDL_WRONG_NUMBER_OF_TYPE_ARGUMENTS:
+ case ErrorCode::WrongNumberOfTypeArguments:
return
"the number of given type arguments does not match the expected"
" number of type parameters";
- case EIDL_INSTANTIATED_STRUCT_TYPE_TYPEDEF:
+ case ErrorCode::InstantiatedStructTypeTypedef:
return
"an instantiated polymorphic struct type cannot be used in a"
" typedef";
- case EIDL_IDENTICAL_TYPE_PARAMETERS:
+ case ErrorCode::IdenticalTypeParameters:
return "two type parameters have the same name";
- case EIDL_STRUCT_TYPE_TEMPLATE_WITH_BASE:
+ case ErrorCode::StructTypeTemplateWithBase:
return "a polymorphic struct type template may not have a base type";
- case EIDL_PUBLISHED_FORWARD:
+ case ErrorCode::PublishedForward:
return
"a published forward declaration of an interface type cannot be"
" followed by an unpublished declaration of that type";
- case EIDL_PUBLISHED_USES_UNPUBLISHED:
+ case ErrorCode::PublishedusesUnpublished:
return
"an unpublished entity cannot be used in the declaration of a"
" published entity: ";
- case EIDL_SIMILAR_CONSTRUCTORS:
+ case ErrorCode::SimilarConstructors:
return "two constructors have identical lists of parameter types";
}
return "unknown error";
@@ -487,14 +467,14 @@ void ErrorHandler::warning0(WarningCode w, const sal_Char* warningmsg)
void ErrorHandler::syntaxError(ParseState ps, sal_Int32 lineNumber, const sal_Char* errmsg)
{
- errorHeader(EIDL_SYNTAX_ERROR, lineNumber);
+ errorHeader(ErrorCode::SyntaxError, lineNumber);
fprintf(stderr, "%s: %s\n", parseStateToMessage(ps), errmsg);
idlc()->incErrorCount();
}
void ErrorHandler::coercionError(AstExpression *pExpr, ExprType et)
{
- errorHeader(EIDL_COERCION_FAILURE);
+ errorHeader(ErrorCode::CoercionFailure);
fprintf(stderr, "'%s' to '%s'\n", pExpr->toString().getStr(),
exprTypeToString(et));
idlc()->incErrorCount();
@@ -502,7 +482,7 @@ void ErrorHandler::coercionError(AstExpression *pExpr, ExprType et)
void ErrorHandler::lookupError(const OString& n)
{
- errorHeader(EIDL_LOOKUP_ERROR);
+ errorHeader(ErrorCode::IdentNotFound);
fprintf(stderr, "'%s'\n", n.getStr());
idlc()->incErrorCount();
}
@@ -523,7 +503,7 @@ void ErrorHandler::flagError(ErrorCode e, sal_uInt32 flag)
void ErrorHandler::noTypeError(AstDeclaration const * pDecl)
{
- errorHeader(EIDL_NOT_A_TYPE);
+ errorHeader(ErrorCode::NotAType);
fprintf(stderr, "'%s'\n", pDecl->getScopedName().getStr());
idlc()->incErrorCount();
}
@@ -554,12 +534,12 @@ void ErrorHandler::inheritanceError(NodeType nodeType, const OString* name, AstD
(pDecl->getNodeType() == NT_interface) &&
!(static_cast<AstInterface*>(pDecl)->isDefined()) )
{
- errorHeader(EIDL_INHERIT_FWD_ERROR);
+ errorHeader(ErrorCode::CannotInheritFromForward);
fprintf(stderr, "interface '%s' cannot inherit from forward declared interface '%s'\n",
name->getStr(), pDecl->getScopedName().getStr());
} else
{
- errorHeader(EIDL_CANT_INHERIT);
+ errorHeader(ErrorCode::CantInherit);
fprintf(stderr, "%s '%s' from '%s'\n",
nodeTypeName(nodeType), name->getStr(),
pDecl->getScopedName().getStr());
@@ -570,7 +550,7 @@ void ErrorHandler::inheritanceError(NodeType nodeType, const OString* name, AstD
void ErrorHandler::forwardLookupError(const AstDeclaration* pForward,
const OString& name)
{
- errorHeader(EIDL_FWD_DECL_LOOKUP);
+ errorHeader(ErrorCode::ForwardDeclLookup);
fprintf(stderr, "trying to look up '%s' in undefined forward declared interface '%s'\n",
pForward->getScopedName().getStr(), name.getStr());
idlc()->incErrorCount();
@@ -579,21 +559,21 @@ void ErrorHandler::forwardLookupError(const AstDeclaration* pForward,
void ErrorHandler::constantExpected(AstDeclaration* pDecl,
const OString& name)
{
- errorHeader(EIDL_CONSTANT_EXPECTED);
+ errorHeader(ErrorCode::ExpectedConstant);
fprintf(stderr, "'%s' is bound to '%s'\n", name.getStr(), pDecl->getScopedName().getStr());
idlc()->incErrorCount();
}
void ErrorHandler::evalError(AstExpression* pExpr)
{
- errorHeader(EIDL_EVAL_ERROR);
+ errorHeader(ErrorCode::Eval);
fprintf(stderr, "'%s'\n", pExpr->toString().getStr());
idlc()->incErrorCount();
}
bool ErrorHandler::checkPublished(AstDeclaration const * decl, bool bOptional) {
if (idlc()->isPublished() && !decl->isPublished() && !bOptional) {
- error1(EIDL_PUBLISHED_USES_UNPUBLISHED, decl);
+ error1(ErrorCode::PublishedusesUnpublished, decl);
return false;
} else {
return true;
diff --git a/idlc/source/parser.y b/idlc/source/parser.y
index f8b143be4434..3a12f4cef5fe 100644
--- a/idlc/source/parser.y
+++ b/idlc/source/parser.y
@@ -100,7 +100,7 @@ void reportDoubleMemberDeclarations(
doubleMembers.begin());
i != doubleMembers.end(); ++i)
{
- ErrorHandler::error2(EIDL_DOUBLE_MEMBER, i->first, i->second);
+ ErrorHandler::error2(ErrorCode::DoubleMember, i->first, i->second);
}
}
@@ -132,7 +132,7 @@ void addInheritedInterface(
i != doubleDecls.interfaces.end(); ++i)
{
ErrorHandler::error1(
- EIDL_DOUBLE_INHERITANCE, *i);
+ ErrorCode::DoubleInheritance, *i);
}
reportDoubleMemberDeclarations(doubleDecls.members);
}
@@ -140,7 +140,7 @@ void addInheritedInterface(
}
} else {
ErrorHandler::lookupError(
- EIDL_INTERFACEMEMBER_LOOKUP, name, scopeAsDecl(ifc));
+ ErrorCode::InterfaceMemberLookup, name, scopeAsDecl(ifc));
}
}
@@ -158,7 +158,7 @@ AstDeclaration const * createNamedType(
if (static_cast< AstStruct const * >(resolved)->getTypeParameterCount()
!= (typeArgs == nullptr ? 0 : typeArgs->size()))
{
- ErrorHandler::error0(EIDL_WRONG_NUMBER_OF_TYPE_ARGUMENTS);
+ ErrorHandler::error0(ErrorCode::WrongNumberOfTypeArguments);
decl = nullptr;
} else if (typeArgs != nullptr) {
AstScope * global = idlc()->scopes()->bottom();
@@ -171,7 +171,7 @@ AstDeclaration const * createNamedType(
}
} else if (decl->isType()) {
if (typeArgs != nullptr) {
- ErrorHandler::error0(EIDL_WRONG_NUMBER_OF_TYPE_ARGUMENTS);
+ ErrorHandler::error0(ErrorCode::WrongNumberOfTypeArguments);
decl = nullptr;
}
} else {
@@ -531,7 +531,7 @@ forward_dcl :
delete pForward;
} else
{
- ErrorHandler::error2(EIDL_REDEF_SCOPE, scopeAsDecl(pScope), pDecl);
+ ErrorHandler::error2(ErrorCode::RedefScope, scopeAsDecl(pScope), pDecl);
}
} else
{
@@ -579,14 +579,14 @@ interface_dcl :
{
if ( pForward->getScopedName() != pInterface->getScopedName() )
{
- ErrorHandler::error3(EIDL_SCOPE_CONFLICT,
+ ErrorHandler::error3(ErrorCode::ScopeConflict,
pInterface, pForward, scopeAsDecl(pScope));
}
}
else if ( !pInterface->isPublished()
&& pForward->isPublished() )
{
- ErrorHandler::error0(EIDL_PUBLISHED_FORWARD);
+ ErrorHandler::error0(ErrorCode::PublishedForward);
}
/*
* All OK, set full definition
@@ -724,7 +724,7 @@ attribute :
{
idlc()->setParseState(PS_AttrCompleted);
if (($1 & ~(AF_BOUND | AF_READONLY)) != AF_ATTRIBUTE) {
- ErrorHandler::flagError(EIDL_BAD_ATTRIBUTE_FLAGS, $1);
+ ErrorHandler::flagError(ErrorCode::BadAttributeFlags, $1);
}
AstInterface * scope = static_cast< AstInterface * >(
idlc()->scopes()->top());
@@ -765,7 +765,7 @@ opt_attrflags :
opt_attrflags ',' opt_attrflag
{
if ( ($1 & $3) == $3 )
- ErrorHandler::flagError(EIDL_DEFINED_ATTRIBUTEFLAG, $3);
+ ErrorHandler::flagError(ErrorCode::DefinedAttributeFlag, $3);
$$ = $1 | $3;
}
@@ -910,7 +910,7 @@ attribute_set_raises:
if (static_cast< AstAttribute * >(idlc()->scopes()->top())->
isReadonly())
{
- ErrorHandler::error0(EIDL_READONLY_ATTRIBUTE_SET_EXCEPTIONS);
+ ErrorHandler::error0(ErrorCode::ReadOnlyAttributeSetExceptions);
}
}
raises ';'
@@ -1053,10 +1053,10 @@ parameter :
if ( pType )
{
if (pScope->isConstructor() && $2 != DIR_IN) {
- ErrorHandler::error0(EIDL_CONSTRUCTOR_PARAMETER_NOT_IN);
+ ErrorHandler::error0(ErrorCode::ConstructorParameterNotIn);
}
if (pScope->isVariadic()) {
- ErrorHandler::error0(EIDL_REST_PARAMETER_NOT_LAST);
+ ErrorHandler::error0(ErrorCode::RestParameterNotLast);
}
if ($7) {
AstDeclaration const * type = resolveTypedefs(pType);
@@ -1064,17 +1064,17 @@ parameter :
|| (static_cast< AstBaseType const * >(type)->
getExprType() != ET_any))
{
- ErrorHandler::error0(EIDL_REST_PARAMETER_NOT_ANY);
+ ErrorHandler::error0(ErrorCode::RestParameterNotAny);
}
if (pScope->isConstructor()) {
if (pScope->getIteratorBegin()
!= pScope->getIteratorEnd())
{
ErrorHandler::error0(
- EIDL_CONSTRUCTOR_REST_PARAMETER_NOT_FIRST);
+ ErrorCode::ConstructorRestParameterNotFirst);
}
} else {
- ErrorHandler::error0(EIDL_METHOD_HAS_REST_PARAMETER);
+ ErrorHandler::error0(ErrorCode::MethodHasRestParameter);
}
}
@@ -1176,7 +1176,7 @@ exception_name:
} else if (!ErrorHandler::checkPublished(decl)) {
decl = nullptr;
} else if (decl->getNodeType() != NT_exception) {
- ErrorHandler::error1(EIDL_ILLEGAL_RAISES, decl);
+ ErrorHandler::error1(ErrorCode::IllegalRaises, decl);
decl = nullptr;
}
delete $1;
@@ -1195,7 +1195,7 @@ interface_inheritance_decl:
AstInterface * ifc = static_cast< AstInterface * >(
idlc()->scopes()->top());
if (ifc->usesSingleInheritance()) {
- ErrorHandler::error0(EIDL_MIXED_INHERITANCE);
+ ErrorHandler::error0(ErrorCode::MixedInheritance);
} else {
addInheritedInterface(
ifc, *$4, $1,
@@ -1538,14 +1538,14 @@ property :
if ( pScope->getScopeNodeType() == NT_singleton )
{
- ErrorHandler::error0(EIDL_ILLEGAL_ADD);
+ ErrorHandler::error0(ErrorCode::IllegalAdd);
} else
{
if ( ($1 & AF_ATTRIBUTE) == AF_ATTRIBUTE )
- ErrorHandler::flagError(EIDL_WRONGATTRIBUTEKEYWORD, AF_ATTRIBUTE);
+ ErrorHandler::flagError(ErrorCode::WrongAttributeKeyword, AF_ATTRIBUTE);
if ( ($1 & AF_PROPERTY) != AF_PROPERTY )
- ErrorHandler::flagError(EIDL_MISSINGATTRIBUTEKEYWORD, AF_PROPERTY);
+ ErrorHandler::flagError(ErrorCode::MissingAttributeKeyword, AF_PROPERTY);
/*
* Create nodes representing attributes and add them to the
@@ -1610,7 +1610,7 @@ service_export :
if ( pScope->getScopeNodeType() == NT_singleton )
{
- ErrorHandler::error0(EIDL_ILLEGAL_ADD);
+ ErrorHandler::error0(ErrorCode::IllegalAdd);
} else
{
/*
@@ -1639,7 +1639,7 @@ service_export :
}
} else
{
- ErrorHandler::lookupError(EIDL_INTERFACEMEMBER_LOOKUP, *iter, scopeAsDecl(pScope));
+ ErrorHandler::lookupError(ErrorCode::InterfaceMemberLookup, *iter, scopeAsDecl(pScope));
}
iter++;
}
@@ -1672,7 +1672,7 @@ service_export :
if ( pDecl && (pDecl->getNodeType() == NT_service) )
{
if ( static_cast< AstService * >(pDecl)->isSingleInterfaceBasedService() || (pScope->getScopeNodeType() == NT_singleton && pScope->nMembers() > 0) )
- ErrorHandler::error0(EIDL_ILLEGAL_ADD);
+ ErrorHandler::error0(ErrorCode::IllegalAdd);
else if ( ErrorHandler::checkPublished(pDecl) )
{
pSMember = new AstServiceMember(
@@ -1681,7 +1681,7 @@ service_export :
}
} else
{
- ErrorHandler::lookupError(EIDL_SERVICEMEMBER_LOOKUP, *iter, scopeAsDecl(pScope));
+ ErrorHandler::lookupError(ErrorCode::ServiceMemberLookup, *iter, scopeAsDecl(pScope));
}
iter++;
}
@@ -1700,7 +1700,7 @@ service_export :
if ( pScope->getScopeNodeType() == NT_singleton )
{
- ErrorHandler::error0(EIDL_ILLEGAL_ADD);
+ ErrorHandler::error0(ErrorCode::IllegalAdd);
} else
{
/*
@@ -1721,7 +1721,7 @@ service_export :
pScope->addDeclaration(pObserves);
} else
{
- ErrorHandler::lookupError(EIDL_INTERFACEMEMBER_LOOKUP, *iter, scopeAsDecl(pScope));
+ ErrorHandler::lookupError(ErrorCode::InterfaceMemberLookup, *iter, scopeAsDecl(pScope));
}
iter++;
}
@@ -1741,7 +1741,7 @@ service_export :
if ( pScope->getScopeNodeType() == NT_singleton )
{
- ErrorHandler::error0(EIDL_ILLEGAL_ADD);
+ ErrorHandler::error0(ErrorCode::IllegalAdd);
} else
{
/*
@@ -1762,7 +1762,7 @@ service_export :
pScope->addDeclaration(pNeeds);
} else
{
- ErrorHandler::lookupError(EIDL_SERVICEMEMBER_LOOKUP, *iter, scopeAsDecl(pScope));
+ ErrorHandler::lookupError(ErrorCode::ServiceMemberLookup, *iter, scopeAsDecl(pScope));
}
iter++;
}
@@ -1788,7 +1788,7 @@ service_interface_header :
{
idlc()->setParseState(PS_ServiceIFHeadSeen);
if ( (AF_OPTIONAL != $1) && ( AF_INVALID != $1) )
- ErrorHandler::flagError(EIDL_OPTIONALEXPECTED, $1);
+ ErrorHandler::flagError(ErrorCode::ExpectedOptional, $1);
$$ = $1;
}
;
@@ -1804,7 +1804,7 @@ service_service_header :
{
idlc()->setParseState(PS_ServiceSHeadSeen);
if ( (AF_OPTIONAL != $1) && ( AF_INVALID != $1) )
- ErrorHandler::flagError(EIDL_OPTIONALEXPECTED, $1);
+ ErrorHandler::flagError(ErrorCode::ExpectedOptional, $1);
$$ = $1;
}
;
@@ -1862,7 +1862,7 @@ service_interface_dfn:
}
} else {
ErrorHandler::lookupError(
- EIDL_INTERFACEMEMBER_LOOKUP, *$2, scopeAsDecl(scope));
+ ErrorCode::InterfaceMemberLookup, *$2, scopeAsDecl(scope));
}
delete $2;
}
@@ -1914,7 +1914,7 @@ constructor:
if (static_cast< AstService * >(idlc()->scopes()->top())->
checkLastConstructor())
{
- ErrorHandler::error0(EIDL_SIMILAR_CONSTRUCTORS);
+ ErrorHandler::error0(ErrorCode::SimilarConstructors);
}
}
';'
@@ -1973,7 +1973,7 @@ singleton_interface_dfn:
}
} else {
ErrorHandler::lookupError(
- EIDL_INTERFACEMEMBER_LOOKUP, *$2, scopeAsDecl(scope));
+ ErrorCode::InterfaceMemberLookup, *$2, scopeAsDecl(scope));
}
delete $2;
}
@@ -2015,7 +2015,7 @@ type_declarator :
{
idlc()->setParseState(PS_TypeSpecSeen);
if ($1 != nullptr && $1->getNodeType() == NT_instantiated_struct) {
- ErrorHandler::error0(EIDL_INSTANTIATED_STRUCT_TYPE_TYPEDEF);
+ ErrorHandler::error0(ErrorCode::InstantiatedStructTypeTypedef);
}
}
at_least_one_declarator
@@ -2247,7 +2247,7 @@ type_arg:
simple_type_spec
{
if ($1 != nullptr && static_cast< AstType const * >($1)->isUnsigned()) {
- ErrorHandler::error0(EIDL_UNSIGNED_TYPE_ARGUMENT);
+ ErrorHandler::error0(ErrorCode::UnsignedTypeArgument);
}
$$ = $1;
}
@@ -2482,7 +2482,7 @@ structure_header :
// type bases, which might also cause problems in language bindings, are
// already rejected on a syntactic level.)
if ($5 != nullptr && $6 != nullptr) {
- ErrorHandler::error0(EIDL_STRUCT_TYPE_TEMPLATE_WITH_BASE);
+ ErrorHandler::error0(ErrorCode::StructTypeTemplateWithBase);
}
$$ = new FeInheritanceHeader(NT_struct, $3, $6, $5);
@@ -2506,7 +2506,7 @@ type_params:
| type_params ',' identifier
{
if (std::find($1->begin(), $1->end(), *$3) != $1->end()) {
- ErrorHandler::error0(EIDL_IDENTICAL_TYPE_PARAMETERS);
+ ErrorHandler::error0(ErrorCode::IdenticalTypeParameters);
}
$1->push_back(*$3);
delete $3;
@@ -2600,7 +2600,7 @@ type_or_parameter:
decl = createNamedType($1, $2);
if (scope != nullptr && includes(decl, scopeAsDecl(scope))) {
ErrorHandler::error1(
- EIDL_RECURSIVE_TYPE, scopeAsDecl(scope));
+ ErrorCode::RecursiveType, scopeAsDecl(scope));
decl = nullptr;
}
}
@@ -2700,7 +2700,7 @@ enumerator :
pExpr, *$1, pScope);
}
if ( pEnum->checkValue(pEnumVal->getConstValue()) )
- ErrorHandler::error1(EIDL_EVAL_ERROR, pEnum);
+ ErrorHandler::error1(ErrorCode::Eval, pEnum);
pScope->addDeclaration(pEnumVal);
}
@@ -2728,7 +2728,7 @@ enumerator :
$3, *$1, pScope);
}
if ( pEnum->checkValue(pEnumVal->getConstValue()) )
- ErrorHandler::error1(EIDL_EVAL_ERROR, pEnum);
+ ErrorHandler::error1(ErrorCode::Eval, pEnum);
pScope->addDeclaration(pEnumVal);
} else