1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: pe_excp.hxx,v $
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
38 #include <s2_luidl/parsenv2.hxx>
39 #include <s2_luidl/pestate.hxx>
41 #include <s2_luidl/semnode.hxx>
42 #include <ary/qualiname.hxx>
65 class PE_StructElement
;
69 class PE_Exception
: public UnoIDL_PE
73 virtual void EstablishContacts(
74 UnoIDL_PE
* io_pParentPE
,
75 ary::Repository
& io_rRepository
,
76 TokenProcessing_Result
&
79 virtual void ProcessToken(
80 const Token
& i_rToken
);
88 void Prepare_PE_QualifiedName();
89 void Prepare_PE_Element();
91 const char * i_sName
);
94 bool bIsPreDeclaration
;
95 ary::idl::Ce_id nCurStruct
;
99 ary::idl::Ce_id nCurParsed_ElementRef
;
100 Dyn
<PE_Type
> pPE_Type
;
101 ary::idl::Type_id nCurParsed_Base
;
105 class PE_StructState
;
106 friend struct S_Stati
;
107 friend class PE_StructState
;
110 class PE_StructState
: public ParseEnvState
116 PE_Exception
& i_rStruct
)
117 : rStruct(i_rStruct
) {}
119 ParseEnvState
& i_rState
) const;
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
; }
131 virtual UnoIDL_PE
& MyPE();
133 PE_Exception
& rStruct
;
136 class State_None
: public PE_StructState
140 PE_Exception
& i_rStruct
)
141 : PE_StructState(i_rStruct
) {}
143 class State_WaitForName
: public PE_StructState
147 PE_Exception
& i_rStruct
)
148 : PE_StructState(i_rStruct
) {}
149 virtual void Process_Identifier(
150 const TokIdentifier
&
153 class State_GotName
: public PE_StructState
157 PE_Exception
& i_rStruct
)
158 : PE_StructState(i_rStruct
) {}
159 virtual void Process_Punctuation(
160 const TokPunctuation
&
163 class State_WaitForBase
: public PE_StructState
167 PE_Exception
& i_rStruct
)
168 : PE_StructState(i_rStruct
) {}
169 virtual void On_SubPE_Left();
171 class State_GotBase
: public PE_StructState
175 PE_Exception
& i_rStruct
)
176 : PE_StructState(i_rStruct
) {}
177 virtual void Process_Punctuation(
178 const TokPunctuation
&
181 class State_WaitForElement
: public PE_StructState
184 State_WaitForElement(
185 PE_Exception
& i_rStruct
)
186 : PE_StructState(i_rStruct
) {}
187 virtual void Process_Identifier(
188 const TokIdentifier
&
190 virtual void Process_NameSeparator();
191 virtual void Process_BuiltInType(
192 const TokBuiltInType
&
194 virtual void Process_TypeModifier(
195 const TokTypeModifier
&
197 virtual void Process_Punctuation(
198 const TokPunctuation
&
200 // virtual void On_SubPE_Left();
202 class State_WaitForFinish
: public PE_StructState
206 PE_Exception
& i_rStruct
)
207 : PE_StructState(i_rStruct
) {}
208 virtual void Process_Punctuation(
209 const TokPunctuation
&
216 PE_Exception
& io_rStruct
);
218 ParseEnvState
& i_rNextState
)
219 { pCurStatus
= &i_rNextState
; }
222 State_WaitForName aWaitForName
;
223 State_GotName aGotName
;
224 State_WaitForBase aWaitForBase
;
225 State_GotBase aGotBase
;
228 State_WaitForFinish aWaitForFinish
;
230 ParseEnvState
* pCurStatus
;
233 virtual void InitData();
234 virtual void TransferData();
235 virtual void ReceiveData();
239 void store_Exception();
243 S_Stati
& Stati() { return *pStati
; }
244 S_Work
& Work() { return aWork
; }
253 PE_Exception::PE_StructState::MoveState(
254 ParseEnvState
& i_rState
) const
255 { rStruct
.Stati().SetState(i_rState
); }