Kaydet (Commit) 8e71d940 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Remove UNOIDL "array" and "union" vaporware from idlc

Change-Id: Iccd5a78b54620796cfde672388b70ad97d17b7a5
üst a0bd814f
......@@ -58,8 +58,6 @@ $(eval $(call gb_Executable_add_exception_objects,idlc,\
idlc/source/astoperation \
idlc/source/astconstant \
idlc/source/astenum \
idlc/source/astarray \
idlc/source/astunion \
idlc/source/astexpression \
idlc/source/astservice \
))
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef _IDLC_ASTARRAY_HXX_
#define _IDLC_ASTARRAY_HXX_
#include <idlc/asttype.hxx>
#include <idlc/astscope.hxx>
class AstArray : public AstType
{
public:
AstArray(const OString& name, AstType* pType, const ExprList& rDimExpr, AstScope* pScope);
AstArray(AstType* pType, const ExprList& rDimExpr, AstScope* pScope);
virtual ~AstArray() {}
AstType* getType()
{ return m_pType; }
void setType(AstType* pType)
{
m_pType = pType;
setName(makeName());
}
ExprList* getDimExpressions()
{ return &m_dimExpressions; }
sal_uInt32 getDimension()
{ return m_dimension; }
private:
OString makeName();
AstType* m_pType;
sal_uInt32 m_dimension;
ExprList m_dimExpressions;
};
#endif // _IDLC_ASTARRAY_HXX_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -43,8 +43,6 @@ enum NodeType
NT_property, // Denotes an property
NT_operation, // Denotes an operation
NT_parameter, // Denotes an op. parameter
NT_union, // Denotes a union
NT_union_branch, // Denotes a union branch
NT_struct, // Denotes either a plain struct type, or a
// polymorphic struct type template
NT_type_parameter, // Denotes a type parameter of a polymorphic struct
......@@ -53,7 +51,6 @@ enum NodeType
NT_member, // Denotes a member in structure, exception
NT_enum, // Denotes an enumeration
NT_enum_val, // Denotes an enum. value
NT_array, // Denotes an IDL array
NT_sequence, // Denotes an IDL sequence
NT_typedef, // Denotes a typedef
NT_predefined, // Denotes a predefined type
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef _IDLC_ASTUNION_HXX_
#define _IDLC_ASTUNION_HXX_
#include <idlc/aststruct.hxx>
#include <idlc/astunionbranch.hxx>
class AstUnion : public AstStruct
{
public:
AstUnion(const OString& name, AstType* pDiscType, AstScope* pScope);
virtual ~AstUnion();
AstType* getDiscrimantType()
{ return m_pDiscriminantType; }
ExprType getDiscrimantExprType()
{ return m_discExprType; }
virtual sal_Bool dump(RegistryKey& rKey);
virtual AstDeclaration* addDeclaration(AstDeclaration* pDecl);
protected:
// Look up a branch by node pointer
AstUnionBranch* lookupBranch(AstUnionBranch* pBranch);
// Look up the branch with the "default" label
AstUnionBranch* lookupDefault(sal_Bool bReportError = sal_True );
// Look up a branch given a branch with a label. This is used to
// check for duplicate labels
AstUnionBranch* lookupLabel(AstUnionBranch* pBranch);
// Look up a union branch given an enumerator. This is used to
// check for duplicate enum labels
AstUnionBranch* lookupEnum(AstUnionBranch* pBranch);
private:
AstType* m_pDiscriminantType;
ExprType m_discExprType;
};
#endif // _IDLC_ASTUNION_HXX_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef _IDLC_ASTUNIONBRANCH_HXX_
#define _IDLC_ASTUNIONBRANCH_HXX_
#include <idlc/astmember.hxx>
#include <idlc/astunionlabel.hxx>
class AstUnionBranch : public AstMember
{
public:
AstUnionBranch(AstUnionLabel* pLabel, AstType const * pType, const OString& name, AstScope* pScope);
virtual ~AstUnionBranch();
AstUnionLabel* getLabel()
{ return m_pLabel; }
private:
AstUnionLabel* m_pLabel;
};
#endif // _IDLC_ASTUNIONBRANCH_HXX_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef _IDLC_ASTUNIONLABEL_HXX_
#define _IDLC_ASTUNIONLABEL_HXX_
enum UnionLabel
{
UL_default, // Label is "default"
UL_label // Regular label
};
class AstUnionLabel
{
public:
AstUnionLabel(UnionLabel labelKind, AstExpression* pExpr);
virtual ~AstUnionLabel();
UnionLabel getLabelKind()
{ return m_label; }
AstExpression* getLabelValue()
{ return m_pLabelValue; }
private:
UnionLabel m_label;
AstExpression* m_pLabelValue;
};
#endif // _IDLC_ASTUNIONLABEL_HXX_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -21,7 +21,6 @@
#include <idlc/astdeclaration.hxx>
#include <idlc/astexpression.hxx>
#include <idlc/astunion.hxx>
#include <idlc/astenum.hxx>
enum ErrorCode
......@@ -33,11 +32,8 @@ enum ErrorCode
EIDL_REDEF, // Redefinition
EIDL_REDEF_SCOPE, // Redefinition inside defining scope
EIDL_DEF_USE, // Definition after use
EIDL_MULTIPLE_BRANCH, // More than one union branch with this label
EIDL_COERCION_FAILURE, // Coercion failure
EIDL_SCOPE_CONFLICT, // Between fwd declare and full declare
EIDL_DISC_TYPE, // Illegal discriminator type in union
EIDL_LABEL_TYPE, // Mismatch with discriminator type in union
EIDL_ILLEGAL_ADD, // Illegal add action
EIDL_ILLEGAL_USE, // Illegal type used in expression
EIDL_ILLEGAL_RAISES, // Error in "raises" clause
......@@ -46,8 +42,6 @@ enum ErrorCode
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_ENUM_VAL_EXPECTED, // Expected an enumerator
EIDL_ENUM_VAL_NOT_FOUND, // Didnt find an enumerator with that name
EIDL_EVAL_ERROR, // Error in evaluating expression
EIDL_AMBIGUOUS, // Ambiguous name definition
EIDL_DECL_NOT_DEFINED, // Forward declared but never defined
......@@ -130,15 +124,6 @@ public:
void evalError(AstExpression* pExpr);
// Report a situation where an enumerator was expected but we got
// something else instead. This occurs when a union with an enum
// discriminator is being parsed and one of the branch labels is
// not an enumerator in that enum
void enumValExpected(AstUnion* pUnion);
// Report a failed enumerator lookup in an enum
void enumValLookupFailure(AstUnion* pUnion, AstEnum* pEnum, const OString& name);
bool checkPublished(AstDeclaration const * decl, bool bOptiional=false);
};
......
......@@ -58,12 +58,6 @@ typedef ::std::list< OString > StringList;
typedef ::std::vector< OString > StringVector;
typedef ::std::set< OString, LessString > StringSet;
class AstExpression;
typedef ::std::list< AstExpression* > ExprList;
class AstUnionLabel;
typedef ::std::list< AstUnionLabel* > LabelList;
class AstDeclaration;
typedef ::boost::unordered_map< OString, AstDeclaration*, HashString, EqualString > DeclMap;
......@@ -171,25 +165,6 @@ enum ParseState
PS_MemberDeclsSeen, // Seen decls of struct or except members
PS_MemberDeclsCompleted,// Completed one struct or except member to ';'
PS_UnionSeen, // Seen a UNION keyword
PS_UnionIDSeen, // Seen the union ID
PS_SwitchSeen, // Seen the SWITCH keyword
PS_SwitchOpenParSeen, // Seen the switch open par.
PS_SwitchTypeSeen, // Seen the switch type spec
PS_SwitchCloseParSeen, // Seen the switch close par.
PS_UnionSqSeen, // '{' seen for union
PS_UnionQsSeen, // '}' seen for union
PS_DefaultSeen, // Seen DEFAULT keyword
PS_UnionLabelSeen, // Seen label of union element
PS_LabelColonSeen, // Seen ':' of union branch label
PS_LabelExprSeen, // Seen expression of union branch label
PS_UnionElemSeen, // Seen a union element
PS_UnionElemCompleted, // Completed one union member up to ';'
PS_CaseSeen, // Seen a CASE keyword
PS_UnionElemTypeSeen, // Seen type spec for union element
PS_UnionElemDeclSeen, // Seen declarator for union element
PS_UnionBodySeen, // Seen completed union body
PS_EnumSeen, // Seen an ENUM keyword
PS_EnumIDSeen, // Seen the enum ID
PS_EnumSqSeen, // Seen '{' for enum
......@@ -202,14 +177,6 @@ enum ParseState
PS_SequenceQsSeen, // Seen '>' for sequence
PS_SequenceTypeSeen, // Seen type decl for sequence
PS_ArrayIDSeen, // Seen array ID
PS_ArrayTypeSeen, // Seen array type
PS_ArrayCompleted, // Seen completed array declaration
PS_DimSqSeen, // Seen '[' for array dimension
PS_DimQsSeen, // Seen ']' for array dimension
PS_DimExprSeen, // Seen size expression for array dimension
PS_FlagHeaderSeen, // Seen the attribute|property|interface member head
PS_AttrSeen, // Seen ATTRIBUTE keyword
PS_AttrTypeSeen, // Seen type decl for attribute
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <idlc/astarray.hxx>
using namespace ::rtl;
AstArray::AstArray(const OString& name, AstType* pType, const ExprList& rDimExpr, AstScope* pScope)
: AstType(NT_array, name, pScope)
, m_pType(pType)
, m_dimension((sal_uInt32)(rDimExpr.size()))
, m_dimExpressions(rDimExpr)
{
if ( m_pType )
setName(makeName());
}
AstArray::AstArray(AstType* pType, const ExprList& rDimExpr, AstScope* pScope)
: AstType(NT_array, OString("arrary_"), pScope)
, m_pType(pType)
, m_dimension((sal_uInt32)(rDimExpr.size()))
, m_dimExpressions(rDimExpr)
{
if ( m_pType )
setName(makeName());
}
OString AstArray::makeName()
{
if ( m_pType )
{
OString name(m_pType->getScopedName());
OString openBracket("[");
OString closeBracket("]");
ExprList::iterator iter = m_dimExpressions.begin();
ExprList::iterator end = m_dimExpressions.end();
while ( iter != end )
{
name += openBracket;
name += (*iter)->toString();
name += closeBracket;
++iter;
}
return name;
}
return OString();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -134,10 +134,8 @@ bool AstDeclaration::isType() const {
switch (m_nodeType) {
case NT_interface:
case NT_instantiated_struct:
case NT_union:
case NT_enum:
case NT_sequence:
case NT_array:
case NT_typedef:
case NT_predefined:
case NT_type_parameter:
......@@ -181,7 +179,6 @@ sal_Bool AstDeclaration::dump(RegistryKey& rKey)
case NT_struct:
case NT_exception:
case NT_enum:
case NT_union:
case NT_typedef:
case NT_service:
case NT_singleton:
......
......@@ -47,11 +47,6 @@ AstDeclaration* AstScope::addDeclaration(AstDeclaration* pDecl)
if ((pDeclaration = lookupForAdd(pDecl)) != NULL)
{
if (pDecl->getNodeType() == NT_union_branch )
{
m_declarations.push_back(pDecl);
return pDecl;
}
if ( pDecl->hasAncestor(pDeclaration) )
{
idlc()->error()->error2(EIDL_REDEF_SCOPE, pDecl, pDeclaration);
......@@ -59,7 +54,6 @@ AstDeclaration* AstScope::addDeclaration(AstDeclaration* pDecl)
}
if ( (pDecl->getNodeType() == pDeclaration->getNodeType()) &&
(pDecl->getNodeType() == NT_sequence
|| pDecl->getNodeType() == NT_array
|| pDecl->getNodeType() == NT_instantiated_struct) )
{
return pDeclaration;
......
This diff is collapsed.
......@@ -36,16 +36,10 @@ static const sal_Char* errorCodeToMessage(ErrorCode eCode)
return "illegal redefinition in scope ";
case EIDL_DEF_USE:
return "redefinition after use, ";
case EIDL_MULTIPLE_BRANCH:
return "union with duplicate branch label ";
case EIDL_COERCION_FAILURE:
return "coercion failure ";
case EIDL_SCOPE_CONFLICT:
return "definition scope is different than fwd declare scope, ";
case EIDL_DISC_TYPE:
return "union with illegal discriminator type, ";
case EIDL_LABEL_TYPE:
return "label type incompatible with union discriminator type, ";
case EIDL_ILLEGAL_ADD:
return "illegal add operation, ";
case EIDL_ILLEGAL_USE:
......@@ -62,10 +56,6 @@ static const sal_Char* errorCodeToMessage(ErrorCode eCode)
return "constant expected: ";
case EIDL_NAME_CASE_ERROR:
return "identifier used with two differing spellings: ";
case EIDL_ENUM_VAL_EXPECTED:
return "enumerator expected: ";
case EIDL_ENUM_VAL_NOT_FOUND:
return "enumerator by this name not defined: ";
case EIDL_EVAL_ERROR:
return "expression evaluation error: ";
case EIDL_AMBIGUOUS:
......@@ -293,41 +283,6 @@ static const sal_Char* parseStateToMessage(ParseState state)
return "Illegal syntax following member declarator(s)";
case PS_MemberDeclsCompleted:
return "Missing ',' between member decls of same type(?)";
case PS_UnionSeen:
return "Missing identifier following UNION keyword";
case PS_UnionIDSeen:
return "Illegal syntax following union identifier";
case PS_SwitchSeen:
return "Illegal syntax following SWITCH keyword";
case PS_SwitchOpenParSeen:
return "Illegal syntax following '(' in switch in union";
case PS_SwitchTypeSeen:
return "Illegal syntax following type decl in switch in union";
case PS_SwitchCloseParSeen:
return "Missing union '{' opener";
case PS_UnionSqSeen:
return "Illegal syntax following union '{' opener";
case PS_UnionQsSeen:
return "Illegal syntax following union '}' closer";
case PS_DefaultSeen:
return "Illegal syntax or missing ':' following DEFAULT keyword";
case PS_UnionLabelSeen:
return "Illegal syntax following branch label in union";
case PS_LabelColonSeen:
return "Illegal syntax following ':' in branch label in union";
case PS_LabelExprSeen:
return "Illegal syntax following label expression in union";
case PS_UnionElemSeen:
case PS_UnionElemCompleted:
return "Illegal syntax following union element";
case PS_CaseSeen:
return "Illegal syntax following CASE keyword in union";
case PS_UnionElemTypeSeen:
return "Illegal syntax following type decl in union element";
case PS_UnionElemDeclSeen:
return "Illegal syntax following declarator in union element";
case PS_UnionBodySeen:
return "Illegal syntax following union body statement(s)";
case PS_EnumSeen:
return "Illegal syntax or missing identifier following ENUM keyword";
case PS_EnumIDSeen:
......@@ -348,16 +303,6 @@ static const sal_Char* parseStateToMessage(ParseState state)
return "Illegal syntax following '>' in sequence";
case PS_SequenceTypeSeen:
return "Illegal syntax following sequence type declaration";
case PS_ArrayIDSeen:
return "Illegal syntax or missing dimensions after array identifier";
case PS_ArrayCompleted:
return "Illegal syntax after array declaration";
case PS_DimSqSeen:
return "Illegal syntax or missing size expr after '[' in array declaration";
case PS_DimQsSeen:
return "Illegal syntax after ']' in array declaration";
case PS_DimExprSeen:
return "Illegal syntax or missing ']' after size expr in array declaration";
case PS_FlagHeaderSeen:
return "Illegal syntax after flags";
case PS_AttrSeen:
......@@ -658,22 +603,6 @@ void ErrorHandler::evalError(AstExpression* pExpr)
idlc()->incErrorCount();
}
void ErrorHandler::enumValExpected(AstUnion* pUnion)
{
errorHeader(EIDL_ENUM_VAL_EXPECTED);
fprintf(stderr, " union %s\n", pUnion->getLocalName().getStr());
idlc()->incErrorCount();
}
void ErrorHandler::enumValLookupFailure(AstUnion* pUnion, AstEnum* pEnum, const OString& name)
{
errorHeader(EIDL_ENUM_VAL_NOT_FOUND);
fprintf(stderr, " union %s, enum %s, enumerator %s\n",
pUnion->getLocalName().getStr(),
pEnum->getLocalName().getStr(), name.getStr());
idlc()->incErrorCount();
}
bool ErrorHandler::checkPublished(AstDeclaration const * decl, bool bOptional) {
if (idlc()->isPublished() && !decl->isPublished() && !bOptional) {
error1(EIDL_PUBLISHED_USES_UNPUBLISHED, decl);
......
......@@ -19,7 +19,6 @@
#include <idlc/fehelper.hxx>
#include <idlc/errorhandler.hxx>
#include <idlc/astarray.hxx>
#include "idlc/idlc.hxx"
using namespace ::rtl;
......@@ -65,26 +64,6 @@ AstType const * FeDeclarator::compose(AstDeclaration const * pDecl)
if (m_declType == FD_simple || m_pComplexPart == NULL)
return pType;
if (m_pComplexPart->getNodeType() == NT_array)
{
AstArray* pArray = (AstArray*)m_pComplexPart;
pArray->setType(pType);
// insert array type in global scope
AstScope* pScope = idlc()->scopes()->bottom();
if ( pScope )
{
AstDeclaration* pDecl2 = pScope->addDeclaration(pArray);
if ( (AstDeclaration*)pArray != pDecl2 )
{
delete m_pComplexPart;
m_pComplexPart = pDecl2;
return (AstType*)pDecl2;
}
}
return pArray;
}
return NULL; // return through this statement should not happen
}
......
......@@ -24,7 +24,6 @@
#include <idlc/astservice.hxx>
#include <idlc/astconstants.hxx>
#include <idlc/astexception.hxx>
#include <idlc/astunion.hxx>
#include <idlc/astenum.hxx>
#include <idlc/astinterface.hxx>
#include <idlc/astoperation.hxx>
......@@ -61,8 +60,6 @@ AstDeclaration* SAL_CALL scopeAsDecl(AstScope* pScope)
return (AstOperation*)(pScope);
case NT_exception:
return (AstException*)(pScope);
case NT_union:
return (AstUnion*)(pScope);
case NT_struct:
return (AstStruct*)(pScope);
case NT_enum:
......@@ -90,8 +87,6 @@ AstScope* SAL_CALL declAsScope(AstDeclaration* pDecl)
return (AstConstants*)(pDecl);
case NT_exception:
return (AstException*)(pDecl);
case NT_union:
return (AstUnion*)(pDecl);
case NT_struct:
return (AstStruct*)(pDecl);
case NT_enum:
......
This diff is collapsed.
......@@ -37,7 +37,6 @@
class AstExpression;
class AstArray;
class AstMember;
#include <parser.hxx>
......@@ -283,11 +282,9 @@ IDENTIFIER ("_"?({ALPHA}|{DIGIT})+)*
attribute return IDL_ATTRIBUTE;
bound return IDL_BOUND;
case return IDL_CASE;
const return IDL_CONST;
constants return IDL_CONSTANTS;
constrained return IDL_CONSTRAINED;
default return IDL_DEFAULT;
enum return IDL_ENUM;
exception return IDL_EXCEPTION;
interface return IDL_INTERFACE;
......@@ -306,10 +303,8 @@ service return IDL_SERVICE;
sequence return IDL_SEQUENCE;
singleton return IDL_SINGLETON;
struct return IDL_STRUCT;
switch return IDL_SWITCH;
transient return IDL_TRANSIENT;
typedef return IDL_TYPEDEF;
union return IDL_UNION;
any return IDL_ANY;
boolean return IDL_BOOLEAN;
......
......@@ -102,12 +102,6 @@ struct TestStruct : BaseStruct
/// a sequence< sequence< long > > member
sequence< sequence< long > > ms2;
/// a long array member with dimesion 5,10
// long ms3[5][10];
/// a string array member with dimension 4,8
// long[5][10] ms4;
/// an interface member
XTestBaseTypes ms5;
......
......@@ -71,10 +71,6 @@ struct TestStruct : BaseStruct
hyper ms2;
/// a sequence<long> member
sequence< long > ms3;
/// a long array member with dimesion 5,10
long ms4[5][10];
/// a string array member with dimension 4,8
long[5][10] ms5;
};
}; // test
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
module idlc
{
module test
{
union UnionTest switch (long) {
case 1: long x;
case 2: byte y;
case 3: string z;
case 4:
case 5: short w;
case 6: long array[ 10 ][ 20 ];
case 7: sequence<long> seq;
default: any a;
};
typedef enum E {
A,
B
} EAlias;
// Union with no default label
union U2 switch(EAlias) {
case E::A : long x;
case E::B : short y;
};
union U3 switch(char) {
case 2 : long x;
case 4 : short y;
};
};
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment