Simplify a bit
[LibreOffice.git] / idlc / inc / idlctypes.hxx
bloba2dadfee178ad1e9dbcebcc67d91cd3c8d94f582
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #pragma once
21 #include <stdio.h>
23 #include <list>
24 #include <set>
25 #include <string>
26 #include <unordered_map>
27 #include <vector>
29 #include <sal/types.h>
30 #include <rtl/ustring.hxx>
33 class AstDeclaration;
35 typedef std::list< AstDeclaration* > DeclList;
37 class AstScope;
38 AstDeclaration* scopeAsDecl(AstScope* pScope);
39 AstScope* declAsScope(AstDeclaration* pDecl);
41 // flags used for attributes, properties and services
42 #define AF_INVALID 0x0000
43 #define AF_READONLY 0x0001
44 #define AF_OPTIONAL 0x0002
45 #define AF_MAYBEVOID 0x0004
46 #define AF_BOUND 0x0008
47 #define AF_CONSTRAINED 0x0010
48 #define AF_TRANSIENT 0x0020
49 #define AF_MAYBEAMBIGUOUS 0x0040
50 #define AF_MAYBEDEFAULT 0x0080
51 #define AF_REMOVABLE 0x0100
52 #define AF_ATTRIBUTE 0x0200
53 #define AF_PROPERTY 0x0400
55 enum ParseState
57 PS_NoState,
58 PS_TypeDeclSeen, // Seen complete typedef declaration
59 PS_ConstantDeclSeen, // Seen complete const declaration
60 PS_ExceptionDeclSeen, // Seen complete exception declaration
61 PS_InterfaceDeclSeen, // Seen complete interface declaration
62 PS_ServiceDeclSeen, // Seen complete service declaration
63 PS_SingletonDeclSeen, // Seen complete singleton declaration
64 PS_ModuleDeclSeen, // Seen complete module declaration
65 PS_AttributeDeclSeen, // Seen complete attribute declaration
66 PS_PropertyDeclSeen, // Seen complete property declaration
67 PS_OperationDeclSeen, // Seen complete operation declaration
68 PS_InterfaceInheritanceDeclSeen, // Seen complete interface inheritance decl
69 PS_ConstantsDeclSeen, // Seen complete constants declaration
71 PS_ServiceSeen, // Seen a SERVICE keyword
72 PS_ServiceIDSeen, // Seen the service ID
73 PS_ServiceSqSeen, // '{' seen for service
74 PS_ServiceQsSeen, // '}' seen for service
75 PS_ServiceBodySeen, // Seen complete service body
76 PS_ServiceMemberSeen, // Seen a service member
77 PS_ServiceIFHeadSeen, // Seen an interface member header
78 PS_ServiceSHeadSeen, // Seen a service member header
80 PS_SingletonSeen, // Seen a SINGLETON keyword
81 PS_SingletonIDSeen, // Seen the singleton ID
82 PS_SingletonSqSeen, // '{' seen for singleton
83 PS_SingletonQsSeen, // '}' seen for singleton
84 PS_SingletonBodySeen, // Seen complete singleton body
86 PS_ModuleSeen, // Seen a MODULE keyword
87 PS_ModuleIDSeen, // Seen the module ID
88 PS_ModuleSqSeen, // '{' seen for module
89 PS_ModuleQsSeen, // '}' seen for module
90 PS_ModuleBodySeen, // Seen complete module body
92 PS_ConstantsSeen, // Seen a CONSTANTS keyword
93 PS_ConstantsIDSeen, // Seen the constants ID
94 PS_ConstantsSqSeen, // '{' seen for constants
95 PS_ConstantsQsSeen, // '}' seen for constants
96 PS_ConstantsBodySeen, // Seen complete constants body
98 PS_InterfaceSeen, // Seen an INTERFACE keyword
99 PS_InterfaceIDSeen, // Seen the interface ID
100 PS_InterfaceHeadSeen, // Seen the interface head
101 PS_InheritSpecSeen, // Seen a complete inheritance spec
102 PS_ForwardDeclSeen, // Forward interface decl seen
103 PS_InterfaceSqSeen, // '{' seen for interface
104 PS_InterfaceQsSeen, // '}' seen for interface
105 PS_InterfaceBodySeen, // Seen an interface body
106 PS_InheritColonSeen, // Seen ':' in inheritance list
108 PS_SNListCommaSeen, // Seen ',' in list of scoped names
109 PS_ScopedNameSeen, // Seen a complete scoped name
110 PS_SN_IDSeen, // Seen an identifier as part of a scoped name
111 PS_ScopeDelimSeen, // Seen a scope delim as party of a scoped name
113 PS_ConstSeen, // Seen a CONST keyword
114 PS_ConstTypeSeen, // Parsed the type of a constant
115 PS_ConstIDSeen, // Seen the constant ID
116 PS_ConstAssignSeen, // Seen the '='
117 PS_ConstExprSeen, // Seen the constant value expression
119 PS_TypedefSeen, // Seen a TYPEDEF keyword
120 PS_TypeSpecSeen, // Seen a complete type specification
121 PS_DeclaratorsSeen, // Seen a complete list of declarators
123 PS_StructSeen, // Seen a STRUCT keyword
124 PS_StructHeaderSeen, // Seen struct header
125 PS_StructIDSeen, // Seen the struct ID
126 PS_StructSqSeen, // '{' seen for struct
127 PS_StructQsSeen, // '}' seen for struct
128 PS_StructBodySeen, // Seen complete body of struct decl
130 PS_MemberTypeSeen, // Seen type of struct or except member
131 PS_MemberDeclsSeen, // Seen decls of struct or except members
132 PS_MemberDeclsCompleted,// Completed one struct or except member to ';'
134 PS_EnumSeen, // Seen an ENUM keyword
135 PS_EnumIDSeen, // Seen the enum ID
136 PS_EnumSqSeen, // Seen '{' for enum
137 PS_EnumQsSeen, // Seen '}' for enum
138 PS_EnumBodySeen, // Seen complete enum body
139 PS_EnumCommaSeen, // Seen ',' in list of enumerators
141 PS_SequenceSeen, // Seen a SEQUENCE keyword
142 PS_SequenceSqSeen, // Seen '<' for sequence
143 PS_SequenceQsSeen, // Seen '>' for sequence
144 PS_SequenceTypeSeen, // Seen type decl for sequence
146 PS_FlagHeaderSeen, // Seen the attribute|property|interface member head
147 PS_AttrSeen, // Seen ATTRIBUTE keyword
148 PS_AttrTypeSeen, // Seen type decl for attribute
149 PS_AttrCompleted, // Seen complete attribute declaration
150 PS_ReadOnlySeen, // Seen READONLY keyword
151 PS_OptionalSeen, // Seen OPTIONAL keyword
152 PS_MayBeVoidSeen, // Seen MAYBEVOID yword
153 PS_BoundSeen, // Seen BOUND keyword
154 PS_ConstrainedSeen, // Seen CONSTRAINED keyword
155 PS_TransientSeen, // Seen TRANSIENT keyword
156 PS_MayBeAmbiguousSeen, // Seen MAYBEAMBIGUOUS keyword
157 PS_MayBeDefaultSeen, // Seen MAYBEDEFAULT keyword
158 PS_RemoveableSeen, // Seen REMOVABLE keyword
160 PS_PropertySeen, // Seen PROPERTY keyword
161 PS_PropertyTypeSeen, // Seen type decl for property
162 PS_PropertyCompleted, // Seen complete property declaration
164 PS_ExceptSeen, // Seen EXCEPTION keyword
165 PS_ExceptHeaderSeen, // Seen exception header keyword
166 PS_ExceptIDSeen, // Seen exception identifier
167 PS_ExceptSqSeen, // Seen '{' for exception
168 PS_ExceptQsSeen, // Seen '}' for exception
169 PS_ExceptBodySeen, // Seen complete exception body
171 PS_OpTypeSeen, // Seen operation return type
172 PS_OpIDSeen, // Seen operation ID
173 PS_OpParsCompleted, // Completed operation param list
174 PS_OpSqSeen, // Seen '(' for operation
175 PS_OpQsSeen, // Seen ')' for operation
176 PS_OpParCommaSeen, // Seen ',' in list of op params
177 PS_OpParDirSeen, // Seen parameter direction
178 PS_OpParTypeSeen, // Seen parameter type
179 PS_OpParDeclSeen, // Seen parameter declaration
181 PS_RaiseSeen, // Seen RAISES keyword
182 PS_RaiseSqSeen, // Seen '(' for RAISES
183 PS_RaiseQsSeen, // Seen ')' for RAISES
185 PS_DeclsCommaSeen, // Seen ',' in declarators list
186 PS_DeclsDeclSeen // Seen complete decl in decls list
189 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */