1*78bc99aaSAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
3*78bc99aaSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*78bc99aaSAndrew Rist * or more contributor license agreements. See the NOTICE file
5*78bc99aaSAndrew Rist * distributed with this work for additional information
6*78bc99aaSAndrew Rist * regarding copyright ownership. The ASF licenses this file
7*78bc99aaSAndrew Rist * to you under the Apache License, Version 2.0 (the
8*78bc99aaSAndrew Rist * "License"); you may not use this file except in compliance
9*78bc99aaSAndrew Rist * with the License. You may obtain a copy of the License at
10*78bc99aaSAndrew Rist *
11*78bc99aaSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
12*78bc99aaSAndrew Rist *
13*78bc99aaSAndrew Rist * Unless required by applicable law or agreed to in writing,
14*78bc99aaSAndrew Rist * software distributed under the License is distributed on an
15*78bc99aaSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*78bc99aaSAndrew Rist * KIND, either express or implied. See the License for the
17*78bc99aaSAndrew Rist * specific language governing permissions and limitations
18*78bc99aaSAndrew Rist * under the License.
19*78bc99aaSAndrew Rist *
20*78bc99aaSAndrew Rist *************************************************************/
21cdf0e10cSrcweir
22cdf0e10cSrcweir #include <precomp.h>
23cdf0e10cSrcweir #include <s2_luidl/parsenv2.hxx>
24cdf0e10cSrcweir
25cdf0e10cSrcweir
26cdf0e10cSrcweir // NOT FULLY DEFINED SERVICES
27cdf0e10cSrcweir #include <ary/ary.hxx>
28cdf0e10cSrcweir #include <ary/getncast.hxx>
29cdf0e10cSrcweir #include <ary/qualiname.hxx>
30cdf0e10cSrcweir #include <ary/doc/d_oldidldocu.hxx>
31cdf0e10cSrcweir #include <ary/idl/i_gate.hxx>
32cdf0e10cSrcweir #include <ary/idl/i_ce.hxx>
33cdf0e10cSrcweir #include <ary/idl/i_enum.hxx>
34cdf0e10cSrcweir #include <ary/idl/i_enumvalue.hxx>
35cdf0e10cSrcweir #include <ary/idl/i_module.hxx>
36cdf0e10cSrcweir #include <ary/idl/ip_ce.hxx>
37cdf0e10cSrcweir #include <parser/parserinfo.hxx>
38cdf0e10cSrcweir #include <adc_msg.hxx>
39cdf0e10cSrcweir #include <s2_luidl/uidl_tok.hxx>
40cdf0e10cSrcweir #include <x_parse2.hxx>
41cdf0e10cSrcweir
42cdf0e10cSrcweir
43cdf0e10cSrcweir
44cdf0e10cSrcweir
45cdf0e10cSrcweir namespace csi
46cdf0e10cSrcweir {
47cdf0e10cSrcweir namespace uidl
48cdf0e10cSrcweir {
49cdf0e10cSrcweir
50cdf0e10cSrcweir
~UnoIDL_PE()51cdf0e10cSrcweir UnoIDL_PE::~UnoIDL_PE()
52cdf0e10cSrcweir {
53cdf0e10cSrcweir }
54cdf0e10cSrcweir
55cdf0e10cSrcweir void
EstablishContacts(UnoIDL_PE * io_pParentPE,ary::Repository & io_rRepository,TokenProcessing_Result & o_rResult)56cdf0e10cSrcweir UnoIDL_PE::EstablishContacts( UnoIDL_PE * io_pParentPE,
57cdf0e10cSrcweir ary::Repository & io_rRepository,
58cdf0e10cSrcweir TokenProcessing_Result & o_rResult )
59cdf0e10cSrcweir {
60cdf0e10cSrcweir pRepository = &io_rRepository;
61cdf0e10cSrcweir aMyNode.EstablishContacts(io_pParentPE, io_rRepository.Gate_Idl(), o_rResult);
62cdf0e10cSrcweir }
63cdf0e10cSrcweir
64cdf0e10cSrcweir //void
65cdf0e10cSrcweir //UnoIDL_PE::EstablishContacts( UnoIDL_PE * io_pParentPE,
66cdf0e10cSrcweir // ary::idl::Gate & io_rGate,
67cdf0e10cSrcweir // TokenProcessing_Result & o_rResult )
68cdf0e10cSrcweir //{
69cdf0e10cSrcweir // aMyNode.EstablishContacts(io_pParentPE, io_rGate, o_rResult);
70cdf0e10cSrcweir //}
71cdf0e10cSrcweir
72cdf0e10cSrcweir void
Enter(E_EnvStackAction i_eWayOfEntering)73cdf0e10cSrcweir UnoIDL_PE::Enter( E_EnvStackAction i_eWayOfEntering )
74cdf0e10cSrcweir {
75cdf0e10cSrcweir switch (i_eWayOfEntering)
76cdf0e10cSrcweir {
77cdf0e10cSrcweir case push_sure:
78cdf0e10cSrcweir InitData();
79cdf0e10cSrcweir break;
80cdf0e10cSrcweir case push_try:
81cdf0e10cSrcweir csv_assert(false);
82cdf0e10cSrcweir break;
83cdf0e10cSrcweir case pop_success:
84cdf0e10cSrcweir ReceiveData();
85cdf0e10cSrcweir break;
86cdf0e10cSrcweir case pop_failure:
87cdf0e10cSrcweir throw X_AutodocParser(X_AutodocParser::x_Any);
88cdf0e10cSrcweir // no break because of throw
89cdf0e10cSrcweir default:
90cdf0e10cSrcweir csv_assert(false);
91cdf0e10cSrcweir } // end switch
92cdf0e10cSrcweir }
93cdf0e10cSrcweir
94cdf0e10cSrcweir void
Leave(E_EnvStackAction i_eWayOfLeaving)95cdf0e10cSrcweir UnoIDL_PE::Leave( E_EnvStackAction i_eWayOfLeaving )
96cdf0e10cSrcweir {
97cdf0e10cSrcweir switch (i_eWayOfLeaving)
98cdf0e10cSrcweir {
99cdf0e10cSrcweir case push_sure:
100cdf0e10cSrcweir break;
101cdf0e10cSrcweir case push_try:
102cdf0e10cSrcweir csv_assert(false);
103cdf0e10cSrcweir break;
104cdf0e10cSrcweir case pop_success:
105cdf0e10cSrcweir TransferData();
106cdf0e10cSrcweir break;
107cdf0e10cSrcweir case pop_failure:
108cdf0e10cSrcweir throw X_AutodocParser(X_AutodocParser::x_Any);
109cdf0e10cSrcweir // no break because of throw
110cdf0e10cSrcweir default:
111cdf0e10cSrcweir csv_assert(false);
112cdf0e10cSrcweir } // end switch
113cdf0e10cSrcweir }
114cdf0e10cSrcweir
115cdf0e10cSrcweir void
SetDocu(DYN ary::doc::OldIdlDocu * let_dpDocu)116cdf0e10cSrcweir UnoIDL_PE::SetDocu( DYN ary::doc::OldIdlDocu * let_dpDocu )
117cdf0e10cSrcweir {
118cdf0e10cSrcweir pDocu = let_dpDocu;
119cdf0e10cSrcweir }
120cdf0e10cSrcweir
121cdf0e10cSrcweir void
SetPublished()122cdf0e10cSrcweir UnoIDL_PE::SetPublished()
123cdf0e10cSrcweir {
124cdf0e10cSrcweir if (NOT pDocu)
125cdf0e10cSrcweir {
126cdf0e10cSrcweir pDocu = new ary::doc::OldIdlDocu;
127cdf0e10cSrcweir }
128cdf0e10cSrcweir pDocu->SetPublished();
129cdf0e10cSrcweir }
130cdf0e10cSrcweir
131cdf0e10cSrcweir void
SetOptional()132cdf0e10cSrcweir UnoIDL_PE::SetOptional()
133cdf0e10cSrcweir {
134cdf0e10cSrcweir if (NOT pDocu)
135cdf0e10cSrcweir {
136cdf0e10cSrcweir pDocu = new ary::doc::OldIdlDocu;
137cdf0e10cSrcweir }
138cdf0e10cSrcweir pDocu->SetOptional();
139cdf0e10cSrcweir }
140cdf0e10cSrcweir
141cdf0e10cSrcweir void
PassDocuAt(ary::idl::CodeEntity & io_rCe)142cdf0e10cSrcweir UnoIDL_PE::PassDocuAt( ary::idl::CodeEntity & io_rCe )
143cdf0e10cSrcweir {
144cdf0e10cSrcweir if (pDocu)
145cdf0e10cSrcweir {
146cdf0e10cSrcweir io_rCe.Set_Docu(*pDocu.Release());
147cdf0e10cSrcweir }
148cdf0e10cSrcweir else if // KORR_FUTURE
149cdf0e10cSrcweir // Re-enable doc-warning for Enum Values, as soon as there is a
150cdf0e10cSrcweir // @option -no-doc-for-enumvalues.
151cdf0e10cSrcweir ( NOT ary::is_type<ary::idl::Module>(io_rCe)
152cdf0e10cSrcweir AND NOT ary::is_type<ary::idl::Enum>(io_rCe) )
153cdf0e10cSrcweir {
154cdf0e10cSrcweir TheMessages().Out_MissingDoc(
155cdf0e10cSrcweir io_rCe.LocalName(),
156cdf0e10cSrcweir ParseInfo().CurFile(),
157cdf0e10cSrcweir ParseInfo().CurLine() );
158cdf0e10cSrcweir }
159cdf0e10cSrcweir }
160cdf0e10cSrcweir
161cdf0e10cSrcweir void
InitData()162cdf0e10cSrcweir UnoIDL_PE::InitData()
163cdf0e10cSrcweir {
164cdf0e10cSrcweir // Needs not anything to do.
165cdf0e10cSrcweir }
166cdf0e10cSrcweir
167cdf0e10cSrcweir void
ReceiveData()168cdf0e10cSrcweir UnoIDL_PE::ReceiveData()
169cdf0e10cSrcweir {
170cdf0e10cSrcweir // Needs not anything to do.
171cdf0e10cSrcweir }
172cdf0e10cSrcweir
173cdf0e10cSrcweir const ary::idl::Module &
CurNamespace() const174cdf0e10cSrcweir UnoIDL_PE::CurNamespace() const
175cdf0e10cSrcweir {
176cdf0e10cSrcweir if ( Parent() != 0 )
177cdf0e10cSrcweir return Parent()->CurNamespace();
178cdf0e10cSrcweir else
179cdf0e10cSrcweir {
180cdf0e10cSrcweir csv_assert(false);
181cdf0e10cSrcweir return *(const ary::idl::Module*)0;
182cdf0e10cSrcweir }
183cdf0e10cSrcweir }
184cdf0e10cSrcweir
185cdf0e10cSrcweir const ParserInfo &
ParseInfo() const186cdf0e10cSrcweir UnoIDL_PE::ParseInfo() const
187cdf0e10cSrcweir {
188cdf0e10cSrcweir if ( Parent() != 0 )
189cdf0e10cSrcweir return Parent()->ParseInfo();
190cdf0e10cSrcweir else
191cdf0e10cSrcweir {
192cdf0e10cSrcweir csv_assert(false);
193cdf0e10cSrcweir return *(const ParserInfo*)0;
194cdf0e10cSrcweir }
195cdf0e10cSrcweir }
196cdf0e10cSrcweir
UnoIDL_PE()197cdf0e10cSrcweir UnoIDL_PE::UnoIDL_PE()
198cdf0e10cSrcweir : aMyNode(),
199cdf0e10cSrcweir pDocu(),
200cdf0e10cSrcweir pRepository(0)
201cdf0e10cSrcweir {
202cdf0e10cSrcweir }
203cdf0e10cSrcweir
204cdf0e10cSrcweir
205cdf0e10cSrcweir } // namespace uidl
206cdf0e10cSrcweir } // namespace csi
207