update dev300-m58
[ooovba.git] / autodoc / source / parser_i / idl / pe_vari2.cxx
blob5c2ec3b48ee60e9fda29f2660eb5fc7d7bff3061
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_vari2.cxx,v $
10 * $Revision: 1.11 $
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/pe_vari2.hxx>
35 // NOT FULLY DECLARED SERVICES
36 #include <ary/idl/i_gate.hxx>
37 #include <ary/idl/i_property.hxx>
38 #include <ary/idl/ip_ce.hxx>
39 #include <ary/doc/d_oldidldocu.hxx>
40 #include <s2_luidl/pe_type2.hxx>
41 #include <s2_luidl/tk_keyw.hxx>
42 #include <s2_luidl/tk_ident.hxx>
43 #include <s2_luidl/tk_punct.hxx>
46 namespace csi
48 namespace uidl
52 PE_Variable::PE_Variable( ary::idl::Type_id & i_rResult_Type,
53 String & i_rResult_Name )
54 : eState(e_none),
55 pResult_Type(&i_rResult_Type),
56 pResult_Name(&i_rResult_Name),
57 pPE_Type(0)
59 pPE_Type = new PE_Type(i_rResult_Type);
62 void
63 PE_Variable::EstablishContacts( UnoIDL_PE * io_pParentPE,
64 ary::Repository & io_rRepository,
65 TokenProcessing_Result & o_rResult )
67 UnoIDL_PE::EstablishContacts(io_pParentPE,io_rRepository,o_rResult);
68 pPE_Type->EstablishContacts(this,io_rRepository,o_rResult);
71 PE_Variable::~PE_Variable()
75 void
76 PE_Variable::ProcessToken( const Token & i_rToken )
78 i_rToken.Trigger(*this);
82 void
83 PE_Variable::Process_Default()
85 if (eState == expect_type)
87 SetResult( not_done, push_sure, pPE_Type.Ptr() );
89 else{
90 csv_assert(false);
94 void
95 PE_Variable::Process_Identifier( const TokIdentifier & i_rToken )
97 if (eState == expect_type)
99 SetResult( not_done, push_sure, pPE_Type.Ptr() );
101 else if (eState == expect_name)
103 *pResult_Name = i_rToken.Text();
104 SetResult( done, stay );
105 eState = expect_finish;
107 else {
108 csv_assert(false);
112 void
113 PE_Variable::Process_Punctuation( const TokPunctuation & )
115 if (eState == expect_finish)
117 SetResult( not_done, pop_success );
118 eState = e_none;
120 else if (eState == expect_name)
122 SetResult( not_done, pop_success );
123 eState = e_none;
125 else {
126 csv_assert(false);
130 void
131 PE_Variable::Process_BuiltInType( const TokBuiltInType & i_rToken )
133 if (eState == expect_type)
135 SetResult( not_done, push_sure, pPE_Type.Ptr() );
137 else if (eState == expect_name AND i_rToken.Id() == TokBuiltInType::bty_ellipse)
139 SetResult( not_done, pop_success );
140 eState = e_none;
142 else {
143 csv_assert(false);
147 void
148 PE_Variable::InitData()
150 eState = expect_type;
152 *pResult_Type = 0;
153 *pResult_Name = "";
156 void
157 PE_Variable::ReceiveData()
159 eState = expect_name;
162 void
163 PE_Variable::TransferData()
165 eState = e_none;
168 UnoIDL_PE &
169 PE_Variable::MyPE()
171 return *this;
174 } // namespace uidl
175 } // namespace csi