1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
30 #include <s2_luidl/pe_vari2.hxx>
33 // NOT FULLY DECLARED SERVICES
34 #include <ary/idl/i_gate.hxx>
35 #include <ary/idl/i_property.hxx>
36 #include <ary/idl/ip_ce.hxx>
37 #include <ary/doc/d_oldidldocu.hxx>
38 #include <s2_luidl/pe_type2.hxx>
39 #include <s2_luidl/tk_keyw.hxx>
40 #include <s2_luidl/tk_ident.hxx>
41 #include <s2_luidl/tk_punct.hxx>
50 PE_Variable::PE_Variable( ary::idl::Type_id
& i_rResult_Type
,
51 String
& i_rResult_Name
)
53 pResult_Type(&i_rResult_Type
),
54 pResult_Name(&i_rResult_Name
),
57 pPE_Type
= new PE_Type(i_rResult_Type
);
61 PE_Variable::EstablishContacts( UnoIDL_PE
* io_pParentPE
,
62 ary::Repository
& io_rRepository
,
63 TokenProcessing_Result
& o_rResult
)
65 UnoIDL_PE::EstablishContacts(io_pParentPE
,io_rRepository
,o_rResult
);
66 pPE_Type
->EstablishContacts(this,io_rRepository
,o_rResult
);
69 PE_Variable::~PE_Variable()
74 PE_Variable::ProcessToken( const Token
& i_rToken
)
76 i_rToken
.Trigger(*this);
81 PE_Variable::Process_Default()
83 if (eState
== expect_type
)
85 SetResult( not_done
, push_sure
, pPE_Type
.Ptr() );
93 PE_Variable::Process_Identifier( const TokIdentifier
& i_rToken
)
95 if (eState
== expect_type
)
97 SetResult( not_done
, push_sure
, pPE_Type
.Ptr() );
99 else if (eState
== expect_name
)
101 *pResult_Name
= i_rToken
.Text();
102 SetResult( done
, stay
);
103 eState
= expect_finish
;
111 PE_Variable::Process_Punctuation( const TokPunctuation
& )
113 if (eState
== expect_finish
)
115 SetResult( not_done
, pop_success
);
118 else if (eState
== expect_name
)
120 SetResult( not_done
, pop_success
);
129 PE_Variable::Process_BuiltInType( const TokBuiltInType
& i_rToken
)
131 if (eState
== expect_type
)
133 SetResult( not_done
, push_sure
, pPE_Type
.Ptr() );
135 else if (eState
== expect_name AND i_rToken
.Id() == TokBuiltInType::bty_ellipse
)
137 SetResult( not_done
, pop_success
);
146 PE_Variable::InitData()
148 eState
= expect_type
;
155 PE_Variable::ReceiveData()
157 eState
= expect_name
;
161 PE_Variable::TransferData()
175 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */