Update ooo320-m1
[ooovba.git] / autodoc / source / parser_i / inc / s2_luidl / pe_excp.hxx
blob8e0573ae82ddf70c24c85b187650d99378b9ac4a
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_excp.hxx,v $
10 * $Revision: 1.6 $
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_EXCP_HXX
32 #define LUIDL_PE_EXCP_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 Exception;
64 class StructElement;
65 class PE_StructElement;
66 class PE_Type;
69 class PE_Exception : public UnoIDL_PE
71 public:
72 PE_Exception();
73 virtual void EstablishContacts(
74 UnoIDL_PE * io_pParentPE,
75 ary::Repository & io_rRepository,
76 TokenProcessing_Result &
77 o_rResult );
78 ~PE_Exception();
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 // DATA
93 String sData_Name;
94 bool bIsPreDeclaration;
95 ary::idl::Ce_id nCurStruct;
97 Dyn<PE_StructElement>
98 pPE_Element;
99 ary::idl::Ce_id nCurParsed_ElementRef;
100 Dyn<PE_Type> pPE_Type;
101 ary::idl::Type_id nCurParsed_Base;
104 struct S_Stati;
105 class PE_StructState;
106 friend struct S_Stati;
107 friend class PE_StructState;
110 class PE_StructState : public ParseEnvState
112 public:
114 protected:
115 PE_StructState(
116 PE_Exception & i_rStruct )
117 : rStruct(i_rStruct) {}
118 void MoveState(
119 ParseEnvState & i_rState ) const;
120 void SetResult(
121 E_TokenDone i_eDone,
122 E_EnvStackAction i_eWhat2DoWithEnvStack,
123 UnoIDL_PE * i_pParseEnv2Push = 0 ) const
124 { rStruct.SetResult(i_eDone, i_eWhat2DoWithEnvStack, i_pParseEnv2Push); }
126 S_Stati & Stati() const { return *rStruct.pStati; }
127 S_Work & Work() const { return rStruct.aWork; }
128 PE_Exception & PE() const { return rStruct; }
130 private:
131 virtual UnoIDL_PE & MyPE();
132 // DATA
133 PE_Exception & rStruct;
136 class State_None : public PE_StructState
138 public:
139 State_None(
140 PE_Exception & i_rStruct )
141 : PE_StructState(i_rStruct) {}
143 class State_WaitForName : public PE_StructState
144 { // -> Name
145 public:
146 State_WaitForName(
147 PE_Exception & i_rStruct )
148 : PE_StructState(i_rStruct) {}
149 virtual void Process_Identifier(
150 const TokIdentifier &
151 i_rToken );
153 class State_GotName : public PE_StructState
154 { // -> : { ;
155 public:
156 State_GotName(
157 PE_Exception & i_rStruct )
158 : PE_StructState(i_rStruct) {}
159 virtual void Process_Punctuation(
160 const TokPunctuation &
161 i_rToken );
163 class State_WaitForBase : public PE_StructState
164 { // -> Base
165 public:
166 State_WaitForBase(
167 PE_Exception & i_rStruct )
168 : PE_StructState(i_rStruct) {}
169 virtual void On_SubPE_Left();
171 class State_GotBase : public PE_StructState
172 { // -> {
173 public:
174 State_GotBase(
175 PE_Exception & i_rStruct )
176 : PE_StructState(i_rStruct) {}
177 virtual void Process_Punctuation(
178 const TokPunctuation &
179 i_rToken );
181 class State_WaitForElement : public PE_StructState
182 { // -> Typ }
183 public:
184 State_WaitForElement(
185 PE_Exception & i_rStruct )
186 : PE_StructState(i_rStruct) {}
187 virtual void Process_Identifier(
188 const TokIdentifier &
189 i_rToken );
190 virtual void Process_NameSeparator();
191 virtual void Process_BuiltInType(
192 const TokBuiltInType &
193 i_rToken );
194 virtual void Process_TypeModifier(
195 const TokTypeModifier &
196 i_rToken );
197 virtual void Process_Punctuation(
198 const TokPunctuation &
199 i_rToken );
200 // virtual void On_SubPE_Left();
202 class State_WaitForFinish : public PE_StructState
203 { // -> ;
204 public:
205 State_WaitForFinish(
206 PE_Exception & i_rStruct )
207 : PE_StructState(i_rStruct) {}
208 virtual void Process_Punctuation(
209 const TokPunctuation &
210 i_rToken );
213 struct S_Stati
215 S_Stati(
216 PE_Exception & io_rStruct );
217 void SetState(
218 ParseEnvState & i_rNextState )
219 { pCurStatus = &i_rNextState; }
221 State_None aNone;
222 State_WaitForName aWaitForName;
223 State_GotName aGotName;
224 State_WaitForBase aWaitForBase;
225 State_GotBase aGotBase;
226 State_WaitForElement
227 aWaitForElement;
228 State_WaitForFinish aWaitForFinish;
230 ParseEnvState * pCurStatus;
233 virtual void InitData();
234 virtual void TransferData();
235 virtual void ReceiveData();
237 public:
239 void store_Exception();
241 private:
243 S_Stati & Stati() { return *pStati; }
244 S_Work & Work() { return aWork; }
246 // DATA
247 S_Work aWork;
248 Dyn<S_Stati> pStati;
252 inline void
253 PE_Exception::PE_StructState::MoveState(
254 ParseEnvState & i_rState ) const
255 { rStruct.Stati().SetState(i_rState); }
257 } // namespace uidl
258 } // namespace csi
261 #endif