Update ooo320-m1
[ooovba.git] / autodoc / source / parser_i / inc / s2_luidl / pe_struc.hxx
blobaaed8c3da53ee49983033e60017068255ffef650
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: pe_struc.hxx,v $
10 * $Revision: 1.7 $
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 LUIDL_PE_STRUC_HXX
32 #define LUIDL_PE_STRUC_HXX
36 // USED SERVICES
37 // BASE CLASSES
38 #include <s2_luidl/parsenv2.hxx>
39 #include <s2_luidl/pestate.hxx>
40 // COMPONENTS
41 #include <s2_luidl/semnode.hxx>
42 #include <ary/qualiname.hxx>
43 // PARAMETERS
47 namespace csi
49 namespace prl
51 class TNamespace;
57 namespace csi
59 namespace uidl
63 class Struct;
64 class StructElement;
65 class PE_StructElement;
66 class PE_Type;
69 class PE_Struct : public UnoIDL_PE
71 public:
72 PE_Struct();
73 virtual void EstablishContacts(
74 UnoIDL_PE * io_pParentPE,
75 ary::Repository & io_rRepository,
76 TokenProcessing_Result &
77 o_rResult );
78 ~PE_Struct();
79 virtual void ProcessToken(
80 const Token & i_rToken );
82 private:
83 struct S_Work
85 S_Work();
87 void InitData();
88 void Prepare_PE_QualifiedName();
89 void Prepare_PE_Element();
90 void Data_Set_Name(
91 const char * i_sName );
92 void Data_Set_TemplateParam(
93 const char * i_sTemplateParam );
95 String sData_Name;
96 String sData_TemplateParam;
97 bool bIsPreDeclaration;
98 ary::idl::Ce_id nCurStruct;
100 Dyn<PE_StructElement>
101 pPE_Element;
102 ary::idl::Ce_id nCurParsed_ElementRef;
103 Dyn<PE_Type> pPE_Type;
104 ary::idl::Type_id nCurParsed_Base;
107 struct S_Stati;
108 class PE_StructState;
109 friend struct S_Stati;
110 friend class PE_StructState;
113 class PE_StructState : public ParseEnvState
115 public:
117 protected:
118 PE_StructState(
119 PE_Struct & i_rStruct )
120 : rStruct(i_rStruct) {}
121 void MoveState(
122 ParseEnvState & i_rState ) const;
123 void SetResult(
124 E_TokenDone i_eDone,
125 E_EnvStackAction i_eWhat2DoWithEnvStack,
126 UnoIDL_PE * i_pParseEnv2Push = 0 ) const
127 { rStruct.SetResult(i_eDone, i_eWhat2DoWithEnvStack, i_pParseEnv2Push); }
129 S_Stati & Stati() const { return *rStruct.pStati; }
130 S_Work & Work() const { return rStruct.aWork; }
131 PE_Struct & PE() const { return rStruct; }
133 private:
134 virtual UnoIDL_PE & MyPE();
135 // DATA
136 PE_Struct & rStruct;
139 class State_None : public PE_StructState
141 public:
142 State_None(
143 PE_Struct & i_rStruct )
144 : PE_StructState(i_rStruct) {}
146 class State_WaitForName : public PE_StructState
147 { // -> Name
148 public:
149 State_WaitForName(
150 PE_Struct & i_rStruct )
151 : PE_StructState(i_rStruct) {}
152 virtual void Process_Identifier(
153 const TokIdentifier &
154 i_rToken );
156 class State_GotName : public PE_StructState
157 { // -> : { ; <
158 public:
159 State_GotName(
160 PE_Struct & i_rStruct )
161 : PE_StructState(i_rStruct) {}
162 virtual void Process_Punctuation(
163 const TokPunctuation &
164 i_rToken );
166 class State_WaitForTemplateParam : public PE_StructState
167 { // -> Template parameter identifier
168 public:
169 State_WaitForTemplateParam(
170 PE_Struct & i_rStruct )
171 : PE_StructState(i_rStruct) {}
172 virtual void Process_Identifier(
173 const TokIdentifier &
174 i_rToken );
176 class State_WaitForTemplateEnd : public PE_StructState
177 { // -> >
178 public:
179 State_WaitForTemplateEnd(
180 PE_Struct & i_rStruct )
181 : PE_StructState(i_rStruct) {}
182 virtual void Process_Punctuation(
183 const TokPunctuation &
184 i_rToken );
186 class State_WaitForBase : public PE_StructState
187 { // -> Base
188 public:
189 State_WaitForBase(
190 PE_Struct & i_rStruct )
191 : PE_StructState(i_rStruct) {}
192 virtual void On_SubPE_Left();
194 class State_GotBase : public PE_StructState
195 { // -> {
196 public:
197 State_GotBase(
198 PE_Struct & i_rStruct )
199 : PE_StructState(i_rStruct) {}
200 virtual void Process_Punctuation(
201 const TokPunctuation &
202 i_rToken );
204 class State_WaitForElement : public PE_StructState
205 { // -> Typ }
206 public:
207 State_WaitForElement(
208 PE_Struct & i_rStruct )
209 : PE_StructState(i_rStruct) {}
210 virtual void Process_Identifier(
211 const TokIdentifier &
212 i_rToken );
213 virtual void Process_NameSeparator();
214 virtual void Process_BuiltInType(
215 const TokBuiltInType &
216 i_rToken );
217 virtual void Process_TypeModifier(
218 const TokTypeModifier &
219 i_rToken );
220 virtual void Process_Punctuation(
221 const TokPunctuation &
222 i_rToken );
224 class State_WaitForFinish : public PE_StructState
225 { // -> ;
226 public:
227 State_WaitForFinish(
228 PE_Struct & i_rStruct )
229 : PE_StructState(i_rStruct) {}
230 virtual void Process_Punctuation(
231 const TokPunctuation &
232 i_rToken );
235 struct S_Stati
237 S_Stati(
238 PE_Struct & io_rStruct );
239 void SetState(
240 ParseEnvState & i_rNextState )
241 { pCurStatus = &i_rNextState; }
243 State_None aNone;
244 State_WaitForName aWaitForName;
245 State_GotName aGotName;
246 State_WaitForTemplateParam
247 aWaitForTemplateParam;
248 State_WaitForTemplateEnd
249 aWaitForTemplateEnd;
250 State_WaitForBase aWaitForBase;
251 State_GotBase aGotBase;
252 State_WaitForElement
253 aWaitForElement;
254 State_WaitForFinish aWaitForFinish;
256 ParseEnvState * pCurStatus;
259 virtual void InitData();
260 virtual void TransferData();
261 virtual void ReceiveData();
263 public:
265 void store_Struct();
267 private:
269 S_Stati & Stati() { return *pStati; }
270 S_Work & Work() { return aWork; }
272 // DATA
273 S_Work aWork;
274 Dyn<S_Stati> pStati;
278 inline void
279 PE_Struct::PE_StructState::MoveState(
280 ParseEnvState & i_rState ) const
281 { rStruct.Stati().SetState(i_rState); }
283 } // namespace uidl
284 } // namespace csi
287 #endif