1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
12 #include <sal/config.h>
16 #include <rtl/ustring.hxx>
17 #include <sal/types.h>
21 typedef void * yyscan_t
;
23 namespace unoidl::detail
{
25 struct SourceProviderEntity
;
27 enum SourceProviderAccessDecls
{ ACCESS_DECL_GET
= 0x1, ACCESS_DECL_SET
= 0x2 };
29 enum SourceProviderFlags
{
30 FLAG_ATTRIBUTE
= 0x001, FLAG_BOUND
= 0x002, FLAG_CONSTRAINED
= 0x004,
31 FLAG_MAYBEAMBIGUOUS
= 0x008, FLAG_MAYBEDEFAULT
= 0x010,
32 FLAG_MAYBEVOID
= 0x020, FLAG_OPTIONAL
= 0x040, FLAG_PROPERTY
= 0x080,
33 FLAG_READONLY
= 0x100, FLAG_REMOVABLE
= 0x200, FLAG_TRANSIENT
= 0x400
36 struct SourceProviderExpr
{
37 static SourceProviderExpr
Bool(bool v
) {
44 static SourceProviderExpr
Int(sal_Int64 v
) {
51 static SourceProviderExpr
Uint(sal_uInt64 v
) {
58 static SourceProviderExpr
Float(double v
) {
65 enum Type
{ TYPE_BOOL
, TYPE_INT
, TYPE_UINT
, TYPE_FLOAT
};
76 struct SourceProviderType
{
78 TYPE_VOID
, TYPE_BOOLEAN
, TYPE_BYTE
, TYPE_SHORT
, TYPE_UNSIGNED_SHORT
,
79 TYPE_LONG
, TYPE_UNSIGNED_LONG
, TYPE_HYPER
, TYPE_UNSIGNED_HYPER
,
80 TYPE_FLOAT
, TYPE_DOUBLE
, TYPE_CHAR
, TYPE_STRING
, TYPE_TYPE
, TYPE_ANY
,
81 TYPE_SEQUENCE
, TYPE_ENUM
, TYPE_PLAIN_STRUCT
, TYPE_EXCEPTION
,
82 TYPE_INTERFACE
, TYPE_INSTANTIATED_POLYMORPHIC_STRUCT
, TYPE_PARAMETER
86 type(), entity() // avoid false warnings about uninitialized members
89 explicit SourceProviderType(Type theType
):
91 entity() // avoid false warnings about uninitialized member
92 { assert(theType
<= TYPE_ANY
); }
94 explicit SourceProviderType(SourceProviderType
const * componentType
):
96 entity() // avoid false warnings about uninitialized member
97 { assert(componentType
!= nullptr); subtypes
.push_back(*componentType
); }
100 Type theType
, OUString
const & theName
,
101 SourceProviderEntity
const * theEntity
):
102 type(theType
), name(theName
), entity(theEntity
)
104 assert(theType
>= TYPE_ENUM
&& theType
<= TYPE_INTERFACE
);
105 assert(theEntity
!= nullptr);
109 OUString
const & polymorphicStructTypeTemplateName
,
110 SourceProviderEntity
const * theEntity
,
111 std::vector
<SourceProviderType
>&& typeArguments
):
112 type(TYPE_INSTANTIATED_POLYMORPHIC_STRUCT
),
113 name(polymorphicStructTypeTemplateName
), entity(theEntity
),
114 subtypes(std::move(typeArguments
))
115 { assert(theEntity
!= nullptr); }
117 explicit SourceProviderType(OUString
const & identifier
):
118 type(TYPE_PARAMETER
), name(identifier
),
119 entity() // avoid false warnings about uninitialized member
122 OUString
getName() const;
124 bool equals(SourceProviderType
const & other
) const;
127 OUString name
; // TYPE_ENUM ... TYPE_PARAMETER
128 SourceProviderEntity
const * entity
;
129 // TYPE_ENUM ... TYPE_INSTANTIATED_POLYMOPRHIC_STRUCT
130 std::vector
<SourceProviderType
> subtypes
;
131 // TYPE_SEQUENCE, TYPE_INSTANTIATED_POLYMOPRHIC_STRUCT
132 OUString typedefName
;
137 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */