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/.
10 #ifndef INCLUDED_UNOIDL_SOURCE_SOURCEPROVIDER_PARSER_REQUIRES_HXX
11 #define INCLUDED_UNOIDL_SOURCE_SOURCEPROVIDER_PARSER_REQUIRES_HXX
13 #include "sal/config.h"
17 #include "rtl/string.hxx"
18 #include "rtl/ustring.hxx"
19 #include "sal/types.h"
20 #include "unoidl/unoidl.hxx"
24 typedef void * yyscan_t
;
26 namespace unoidl
{ namespace detail
{
28 struct SourceProviderEntity
;
30 enum SourceProviderAccessDecls
{ ACCESS_DECL_GET
= 0x1, ACCESS_DECL_SET
= 0x2 };
32 enum SourceProviderFlags
{
33 FLAG_ATTRIBUTE
= 0x001, FLAG_BOUND
= 0x002, FLAG_CONSTRAINED
= 0x004,
34 FLAG_MAYBEAMBIGUOUS
= 0x008, FLAG_MAYBEDEFAULT
= 0x010,
35 FLAG_MAYBEVOID
= 0x020, FLAG_OPTIONAL
= 0x040, FLAG_PROPERTY
= 0x080,
36 FLAG_READONLY
= 0x100, FLAG_REMOVABLE
= 0x200, FLAG_TRANSIENT
= 0x400
39 struct SourceProviderExpr
{
40 static SourceProviderExpr
Bool(bool v
) {
47 static SourceProviderExpr
Int(sal_Int64 v
) {
54 static SourceProviderExpr
Uint(sal_uInt64 v
) {
61 static SourceProviderExpr
Float(double v
) {
68 enum Type
{ TYPE_BOOL
, TYPE_INT
, TYPE_UINT
, TYPE_FLOAT
};
79 struct SourceProviderType
{
81 TYPE_VOID
, TYPE_BOOLEAN
, TYPE_BYTE
, TYPE_SHORT
, TYPE_UNSIGNED_SHORT
,
82 TYPE_LONG
, TYPE_UNSIGNED_LONG
, TYPE_HYPER
, TYPE_UNSIGNED_HYPER
,
83 TYPE_FLOAT
, TYPE_DOUBLE
, TYPE_CHAR
, TYPE_STRING
, TYPE_TYPE
, TYPE_ANY
,
84 TYPE_SEQUENCE
, TYPE_ENUM
, TYPE_PLAIN_STRUCT
, TYPE_EXCEPTION
,
85 TYPE_INTERFACE
, TYPE_INSTANTIATED_POLYMORPHIC_STRUCT
, TYPE_PARAMETER
89 type(), entity() // avoid false warnings about uninitialized members
92 explicit SourceProviderType(Type theType
):
94 entity() // avoid false warnings about uninitialized member
95 { assert(theType
<= TYPE_ANY
); }
97 explicit SourceProviderType(SourceProviderType
const * componentType
):
99 entity() // avoid false warnings about uninitialized member
100 { assert(componentType
!= 0); subtypes
.push_back(*componentType
); }
103 Type theType
, OUString
const & theName
,
104 SourceProviderEntity
const * theEntity
):
105 type(theType
), name(theName
), entity(theEntity
)
107 assert(theType
>= TYPE_ENUM
&& theType
<= TYPE_INTERFACE
);
108 assert(theEntity
!= 0);
112 OUString
const & polymorphicStructTypeTemplateName
,
113 SourceProviderEntity
const * theEntity
,
114 std::vector
<SourceProviderType
> const & typeArguments
):
115 type(TYPE_INSTANTIATED_POLYMORPHIC_STRUCT
),
116 name(polymorphicStructTypeTemplateName
), entity(theEntity
),
117 subtypes(typeArguments
)
118 { assert(theEntity
!= 0); }
120 explicit SourceProviderType(OUString
const & identifier
):
121 type(TYPE_PARAMETER
), name(identifier
),
122 entity() // avoid false warnings about uninitialized member
125 OUString
getName() const;
127 bool equals(SourceProviderType
const & other
) const;
130 OUString name
; // TYPE_ENUM ... TYPE_PARAMETER
131 SourceProviderEntity
const * entity
;
132 // TYPE_ENUM ... TYPE_INSTANTIATED_POLYMOPRHIC_STRUCT
133 std::vector
<SourceProviderType
> subtypes
;
134 // TYPE_SEQUENCE, TYPE_INSTANTIATED_POLYMOPRHIC_STRUCT
135 OUString typedefName
;
142 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */