merge the formfield patch from ooo-build
[ooovba.git] / autodoc / source / parser_i / idl / parsenv2.cxx
blob86e97d480f6421d293471d0c3013841265944167
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: parsenv2.cxx,v $
10 * $Revision: 1.14 $
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 #include <precomp.h>
32 #include <s2_luidl/parsenv2.hxx>
35 // NOT FULLY DEFINED SERVICES
36 #include <ary/ary.hxx>
37 #include <ary/getncast.hxx>
38 #include <ary/qualiname.hxx>
39 #include <ary/doc/d_oldidldocu.hxx>
40 #include <ary/idl/i_gate.hxx>
41 #include <ary/idl/i_ce.hxx>
42 #include <ary/idl/i_enum.hxx>
43 #include <ary/idl/i_enumvalue.hxx>
44 #include <ary/idl/i_module.hxx>
45 #include <ary/idl/ip_ce.hxx>
46 #include <parser/parserinfo.hxx>
47 #include <adc_msg.hxx>
48 #include <s2_luidl/uidl_tok.hxx>
49 #include <x_parse2.hxx>
54 namespace csi
56 namespace uidl
60 UnoIDL_PE::~UnoIDL_PE()
64 void
65 UnoIDL_PE::EstablishContacts( UnoIDL_PE * io_pParentPE,
66 ary::Repository & io_rRepository,
67 TokenProcessing_Result & o_rResult )
69 pRepository = &io_rRepository;
70 aMyNode.EstablishContacts(io_pParentPE, io_rRepository.Gate_Idl(), o_rResult);
73 //void
74 //UnoIDL_PE::EstablishContacts( UnoIDL_PE * io_pParentPE,
75 // ary::idl::Gate & io_rGate,
76 // TokenProcessing_Result & o_rResult )
77 //{
78 // aMyNode.EstablishContacts(io_pParentPE, io_rGate, o_rResult);
79 //}
81 void
82 UnoIDL_PE::Enter( E_EnvStackAction i_eWayOfEntering )
84 switch (i_eWayOfEntering)
86 case push_sure:
87 InitData();
88 break;
89 case push_try:
90 csv_assert(false);
91 break;
92 case pop_success:
93 ReceiveData();
94 break;
95 case pop_failure:
96 throw X_AutodocParser(X_AutodocParser::x_Any);
97 // no break because of throw
98 default:
99 csv_assert(false);
100 } // end switch
103 void
104 UnoIDL_PE::Leave( E_EnvStackAction i_eWayOfLeaving )
106 switch (i_eWayOfLeaving)
108 case push_sure:
109 break;
110 case push_try:
111 csv_assert(false);
112 break;
113 case pop_success:
114 TransferData();
115 break;
116 case pop_failure:
117 throw X_AutodocParser(X_AutodocParser::x_Any);
118 // no break because of throw
119 default:
120 csv_assert(false);
121 } // end switch
124 void
125 UnoIDL_PE::SetDocu( DYN ary::doc::OldIdlDocu * let_dpDocu )
127 pDocu = let_dpDocu;
130 void
131 UnoIDL_PE::SetPublished()
133 if (NOT pDocu)
135 pDocu = new ary::doc::OldIdlDocu;
137 pDocu->SetPublished();
140 void
141 UnoIDL_PE::SetOptional()
143 if (NOT pDocu)
145 pDocu = new ary::doc::OldIdlDocu;
147 pDocu->SetOptional();
150 void
151 UnoIDL_PE::PassDocuAt( ary::idl::CodeEntity & io_rCe )
153 if (pDocu)
155 io_rCe.Set_Docu(*pDocu.Release());
157 else if // KORR_FUTURE
158 // Re-enable doc-warning for Enum Values, as soon as there is a
159 // @option -no-doc-for-enumvalues.
160 ( NOT ary::is_type<ary::idl::Module>(io_rCe)
161 AND NOT ary::is_type<ary::idl::Enum>(io_rCe) )
163 TheMessages().Out_MissingDoc(
164 io_rCe.LocalName(),
165 ParseInfo().CurFile(),
166 ParseInfo().CurLine() );
170 void
171 UnoIDL_PE::InitData()
173 // Needs not anything to do.
176 void
177 UnoIDL_PE::ReceiveData()
179 // Needs not anything to do.
182 const ary::idl::Module &
183 UnoIDL_PE::CurNamespace() const
185 if ( Parent() != 0 )
186 return Parent()->CurNamespace();
187 else
189 csv_assert(false);
190 return *(const ary::idl::Module*)0;
194 const ParserInfo &
195 UnoIDL_PE::ParseInfo() const
197 if ( Parent() != 0 )
198 return Parent()->ParseInfo();
199 else
201 csv_assert(false);
202 return *(const ParserInfo*)0;
206 UnoIDL_PE::UnoIDL_PE()
207 : aMyNode(),
208 pDocu(),
209 pRepository(0)
214 } // namespace uidl
215 } // namespace csi