summaryrefslogtreecommitdiff
path: root/idlc/source/parser.y
diff options
context:
space:
mode:
Diffstat (limited to 'idlc/source/parser.y')
-rw-r--r--idlc/source/parser.y82
1 files changed, 41 insertions, 41 deletions
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