diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2004-02-03 11:00:25 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2004-02-03 11:00:25 +0000 |
commit | 35a3552dfb1338fecebdca79f51dbcbd2e035571 (patch) | |
tree | abdc8f84b9d089ec2f6fc2d7cc4273e7d20937b3 /idlc/source/errorhandler.cxx | |
parent | 35f5a869cac3c5f4c5fb20cd59d569e72045e41b (diff) |
INTEGRATION: CWS sb10 (1.4.2); FILE MERGED
2003/12/10 09:12:20 sb 1.4.2.1: #114000# Adapted to multiple-inheritance interface types.
Diffstat (limited to 'idlc/source/errorhandler.cxx')
-rw-r--r-- | idlc/source/errorhandler.cxx | 45 |
1 files changed, 36 insertions, 9 deletions
diff --git a/idlc/source/errorhandler.cxx b/idlc/source/errorhandler.cxx index 263a7833534c..65db47712705 100644 --- a/idlc/source/errorhandler.cxx +++ b/idlc/source/errorhandler.cxx @@ -2,9 +2,9 @@ * * $RCSfile: errorhandler.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: obo $ $Date: 2003-10-20 13:07:22 $ + * last change: $Author: hr $ $Date: 2004-02-03 11:59:20 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -100,7 +100,7 @@ static sal_Char* errorCodeToMessage(ErrorCode eCode) case EIDL_ILLEGAL_RAISES: return "error in raises(..) clause, "; case EIDL_CANT_INHERIT: - return "cannot inherit from "; + return "cannot inherit "; case EIDL_LOOKUP_ERROR: return "error in lookup of symbol: "; case EIDL_INHERIT_FWD_ERROR: @@ -133,8 +133,6 @@ static sal_Char* errorCodeToMessage(ErrorCode eCode) return "error in lookup of symbol, expected interface is not defined and no forward exists: "; case EIDL_SERVICEMEMBER_LOOKUP: return "error in lookup of symbol, expected service is not defined: "; - case EIDL_MULTIBLE_INHERITANCE: - return "multiple inheritance is not allowed, in inheritance tree: "; case EIDL_TYPE_IDENT_CONFLICT: return "type and parameter/member name are equal: "; case EIDL_ONEWAY_RAISE_CONFLICT: @@ -151,6 +149,11 @@ static sal_Char* errorCodeToMessage(ErrorCode eCode) return "only the 'attribute'|'readonly' flag is accepted: "; case EIDL_OPTIONALEXPECTED: return "only the 'optional' flag is accepted: "; + case EIDL_MIXED_INHERITANCE: + return "interface inheritance declarations cannot appear in both an" + " interface's header and its body"; + case EIDL_DOUBLE_INHERITANCE: + return "interface is inherited more than once: "; } return "unknown errror"; } @@ -197,6 +200,8 @@ static sal_Char* parseStateToMessage(ParseState state) return "Malformed property declaration"; case PS_OperationDeclSeen: return "Malformed operation declaration"; + case PS_InterfaceInheritanceDeclSeen: + return "Malformed interface inheritance declaration"; case PS_ConstantsDeclSeen: return "Malformed constants declaration"; case PS_ServiceSeen: @@ -620,9 +625,30 @@ void ErrorHandler::noTypeError(AstDeclaration* pDecl) idlc()->incErrorCount(); } -void ErrorHandler::inheritanceError(OString* name, AstDeclaration* pDecl) +namespace { + +char const * nodeTypeName(NodeType nodeType) { + switch (nodeType) { + case NT_interface: + return "interface"; + + case NT_exception: + return "exception"; + + case NT_struct: + return "struct"; + + default: + return ""; + } +} + +} + +void ErrorHandler::inheritanceError(NodeType nodeType, const OString* name, AstDeclaration* pDecl) { - if ( (pDecl->getNodeType() == NT_interface) && + if ( nodeType == NT_interface && + (pDecl->getNodeType() == NT_interface) && !((AstInterface*)pDecl)->isDefined() ) { errorHeader(EIDL_INHERIT_FWD_ERROR); @@ -631,8 +657,9 @@ void ErrorHandler::inheritanceError(OString* name, AstDeclaration* pDecl) } else { errorHeader(EIDL_CANT_INHERIT); - fprintf(stderr, "interface '%s' attempts to inherit from '%s'\n", - name->getStr(), pDecl->getScopedName().getStr()); + fprintf(stderr, "%s '%s' from '%s'\n", + nodeTypeName(nodeType), name->getStr(), + pDecl->getScopedName().getStr()); } idlc()->incErrorCount(); } |