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_vari2.cxx,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 ************************************************************************/
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>
52 PE_Variable::PE_Variable( ary::idl::Type_id
& i_rResult_Type
,
53 String
& i_rResult_Name
)
55 pResult_Type(&i_rResult_Type
),
56 pResult_Name(&i_rResult_Name
),
59 pPE_Type
= new PE_Type(i_rResult_Type
);
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()
76 PE_Variable::ProcessToken( const Token
& i_rToken
)
78 i_rToken
.Trigger(*this);
83 PE_Variable::Process_Default()
85 if (eState
== expect_type
)
87 SetResult( not_done
, push_sure
, pPE_Type
.Ptr() );
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
;
113 PE_Variable::Process_Punctuation( const TokPunctuation
& )
115 if (eState
== expect_finish
)
117 SetResult( not_done
, pop_success
);
120 else if (eState
== expect_name
)
122 SetResult( not_done
, pop_success
);
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
);
148 PE_Variable::InitData()
150 eState
= expect_type
;
157 PE_Variable::ReceiveData()
159 eState
= expect_name
;
163 PE_Variable::TransferData()