merge the formfield patch from ooo-build
[ooovba.git] / autodoc / source / parser / cpp / pev.hxx
blobb297e2f1b07c02bb607c16b175d5366757e2f683
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: pev.hxx,v $
10 * $Revision: 1.5 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef ADC_CPP_PEV_HXX
32 #define ADC_CPP_PEV_HXX
36 // USED SERVICES
37 // BASE CLASSES
38 #include <tokens/tokproct.hxx>
39 // COMPONENTS
40 // PARAMETERS
41 #include <ary/cpp/c_types4cpp.hxx>
43 namespace ary
45 namespace cpp
47 class Gate;
48 class InputContext;
50 class Namespace;
51 class Class;
52 class Enum;
53 class Typedef;
54 class Function;
55 class Variable;
56 class EnumValue;
58 class DefineEntity;
61 class Documentation;
65 namespace cpp
69 class PeEnvironment : protected TokenProcessing_Types
71 public:
72 // INQUIRY
73 virtual ~PeEnvironment() {}
75 // OPERATIONS
76 // Token results
77 void SetTokenResult(
78 E_TokenDone i_eDone,
79 E_EnvStackAction i_eWhat2DoWithEnvStack,
80 ParseEnvironment * i_pParseEnv2Push = 0 );
82 // Owner stack
83 void OpenNamespace(
84 ary::cpp::Namespace &
85 io_rOpenedNamespace );
86 void OpenExternC(
87 bool i_bOnlyForOneDeclaration = false );
88 void OpenClass(
89 ary::cpp::Class & io_rOpenedClass );
90 void OpenEnum(
91 ary::cpp::Enum & io_rOpenedEnum );
92 void CloseBlock(); /// Handles a '}' on file scope.
93 void CloseClass();
94 void CloseEnum();
95 void SetCurProtection( /// Handles 'public:', 'protected:' and 'private:' on class scope.
96 ary::cpp::E_Protection
97 i_eProtection );
98 void OpenTemplate(
99 const StringVector &
100 i_rParameters );
101 /// Removes parameters from this object.
102 DYN StringVector * Get_CurTemplateParameters();
103 /// Checks, if a template is still open, and if yes, closes it.
104 void Close_OpenTemplate();
106 // Special events
107 void Event_Class_FinishedBase(
108 const String & i_sParameterName );
110 void Event_Store_Typedef(
111 ary::cpp::Typedef & io_rTypedef );
112 void Event_Store_EnumValue(
113 ary::cpp::EnumValue &
114 io_rEnumValue );
115 void Event_Store_CppDefinition(
116 ary::cpp::DefineEntity &
117 io_rDefinition );
119 void Event_EnterFunction_ParameterList();
120 void Event_Function_FinishedParameter(
121 const String & i_sParameterName );
122 void Event_LeaveFunction_ParameterList();
123 void Event_EnterFunction_Implementation();
124 void Event_LeaveFunction_Implementation();
126 void Event_Store_Function(
127 ary::cpp::Function &
128 io_rFunction );
129 void Event_Store_Variable(
130 ary::cpp::Variable &
131 io_rVariable );
132 // Error recovery
133 void StartWaitingFor_Recovery();
135 // INQUIRY
136 ary::cpp::Gate & AryGate() const;
137 const ary::cpp::InputContext &
138 Context() const;
139 String CurFileName() const;
140 uintt LineCount() const;
141 bool IsWaitingFor_Recovery() const;
142 bool IsExternC() const;
144 private:
145 virtual void do_SetTokenResult(
146 E_TokenDone i_eDone,
147 E_EnvStackAction i_eWhat2DoWithEnvStack,
148 ParseEnvironment * i_pParseEnv2Push ) = 0;
149 virtual void do_OpenNamespace(
150 ary::cpp::Namespace &
151 io_rOpenedNamespace ) = 0;
152 virtual void do_OpenExternC(
153 bool i_bOnlyForOneDeclaration ) = 0;
154 virtual void do_OpenClass(
155 ary::cpp::Class & io_rOpenedClass ) = 0;
156 virtual void do_OpenEnum(
157 ary::cpp::Enum & io_rOpenedEnum ) = 0;
158 virtual void do_CloseBlock() = 0;
159 virtual void do_CloseClass() = 0;
160 virtual void do_CloseEnum() = 0;
161 virtual void do_SetCurProtection(
162 ary::cpp::E_Protection
163 i_eProtection ) = 0;
164 virtual void do_OpenTemplate(
165 const StringVector &
166 i_rParameters ) = 0;
167 virtual DYN StringVector *
168 do_Get_CurTemplateParameters() = 0;
169 virtual void do_Close_OpenTemplate() = 0;
170 virtual void do_Event_Class_FinishedBase(
171 const String & i_sBaseName ) = 0;
173 virtual void do_Event_Store_Typedef(
174 ary::cpp::Typedef & io_rTypedef ) = 0;
175 virtual void do_Event_Store_EnumValue(
176 ary::cpp::EnumValue &
177 io_rEnumValue ) = 0;
178 virtual void do_Event_Store_CppDefinition(
179 ary::cpp::DefineEntity &
180 io_rDefinition ) = 0;
181 virtual void do_Event_EnterFunction_ParameterList() = 0;
182 virtual void do_Event_Function_FinishedParameter(
183 const String & i_sParameterName ) = 0;
184 virtual void do_Event_LeaveFunction_ParameterList() = 0;
185 virtual void do_Event_EnterFunction_Implementation() = 0;
186 virtual void do_Event_LeaveFunction_Implementation() = 0;
187 virtual void do_Event_Store_Function(
188 ary::cpp::Function &
189 io_rFunction ) = 0;
190 virtual void do_Event_Store_Variable(
191 ary::cpp::Variable &
192 io_rVariable ) = 0;
193 virtual void do_StartWaitingFor_Recovery() = 0;
194 virtual ary::cpp::Gate &
195 inq_AryGate() const = 0;
196 virtual const ary::cpp::InputContext &
197 inq_Context() const = 0;
198 virtual String inq_CurFileName() const = 0;
199 virtual uintt inq_LineCount() const = 0;
200 virtual bool inq_IsWaitingFor_Recovery() const = 0;
201 virtual bool inq_IsExternC() const = 0;
206 // IMPLEMENTATION
208 inline void
209 PeEnvironment::SetTokenResult( E_TokenDone i_eDone,
210 E_EnvStackAction i_eWhat2DoWithEnvStack,
211 ParseEnvironment * i_pParseEnv2Push )
212 { do_SetTokenResult(i_eDone, i_eWhat2DoWithEnvStack, i_pParseEnv2Push); }
213 inline void
214 PeEnvironment::OpenNamespace( ary::cpp::Namespace & io_rOpenedNamespace )
215 { do_OpenNamespace(io_rOpenedNamespace); }
216 inline void
217 PeEnvironment::OpenExternC( bool i_bOnlyForOneDeclaration )
218 { do_OpenExternC(i_bOnlyForOneDeclaration); }
219 inline void
220 PeEnvironment::OpenClass( ary::cpp::Class & io_rOpenedClass )
221 { do_OpenClass(io_rOpenedClass); }
222 inline void
223 PeEnvironment::OpenEnum( ary::cpp::Enum & io_rOpenedEnum )
224 { do_OpenEnum(io_rOpenedEnum); }
225 inline void
226 PeEnvironment::CloseBlock()
227 { do_CloseBlock(); }
228 inline void
229 PeEnvironment::CloseClass()
230 { do_CloseClass(); }
231 inline void
232 PeEnvironment::CloseEnum()
233 { do_CloseEnum(); }
234 inline void
235 PeEnvironment::SetCurProtection( ary::cpp::E_Protection i_eProtection )
236 { do_SetCurProtection(i_eProtection); }
237 inline void
238 PeEnvironment::OpenTemplate( const StringVector & i_rParameters )
239 { do_OpenTemplate(i_rParameters); }
240 inline DYN StringVector *
241 PeEnvironment::Get_CurTemplateParameters()
242 { return do_Get_CurTemplateParameters(); }
243 inline void
244 PeEnvironment::Close_OpenTemplate()
245 { do_Close_OpenTemplate(); }
246 inline void
247 PeEnvironment::Event_Class_FinishedBase( const String & i_sBaseName )
248 { do_Event_Class_FinishedBase(i_sBaseName); }
249 inline void
250 PeEnvironment::Event_Store_Typedef( ary::cpp::Typedef & io_rTypedef )
251 { do_Event_Store_Typedef(io_rTypedef); }
252 inline void
253 PeEnvironment::Event_Store_EnumValue( ary::cpp::EnumValue & io_rEnumValue )
254 { do_Event_Store_EnumValue(io_rEnumValue); }
255 inline void
256 PeEnvironment::Event_Store_CppDefinition( ary::cpp::DefineEntity & io_rDefinition )
257 { do_Event_Store_CppDefinition(io_rDefinition); }
258 inline void
259 PeEnvironment::Event_EnterFunction_ParameterList()
260 { do_Event_EnterFunction_ParameterList(); }
261 inline void
262 PeEnvironment::Event_Function_FinishedParameter( const String & i_sParameterName )
263 { do_Event_Function_FinishedParameter(i_sParameterName); }
264 inline void
265 PeEnvironment::Event_LeaveFunction_ParameterList()
266 { do_Event_LeaveFunction_ParameterList(); }
267 inline void
268 PeEnvironment::Event_EnterFunction_Implementation()
269 { do_Event_EnterFunction_Implementation(); }
270 inline void
271 PeEnvironment::Event_LeaveFunction_Implementation()
272 { do_Event_LeaveFunction_Implementation(); }
273 inline void
274 PeEnvironment::Event_Store_Function( ary::cpp::Function & io_rFunction )
275 { do_Event_Store_Function(io_rFunction); }
276 inline void
277 PeEnvironment::Event_Store_Variable( ary::cpp::Variable & io_rVariable )
278 { do_Event_Store_Variable(io_rVariable); }
279 inline void
280 PeEnvironment::StartWaitingFor_Recovery()
281 { do_StartWaitingFor_Recovery(); }
282 inline ary::cpp::Gate &
283 PeEnvironment::AryGate() const
284 { return inq_AryGate(); }
285 inline const ary::cpp::InputContext &
286 PeEnvironment::Context() const
287 { return inq_Context(); }
288 inline String
289 PeEnvironment::CurFileName() const
290 { return inq_CurFileName(); }
291 inline uintt
292 PeEnvironment::LineCount() const
293 { return inq_LineCount(); }
294 inline bool
295 PeEnvironment::IsWaitingFor_Recovery() const
296 { return inq_IsWaitingFor_Recovery(); }
297 inline bool
298 PeEnvironment::IsExternC() const
299 { return inq_IsExternC(); }
303 } // namespace cpp
306 #endif