Bump for 3.6-28
[LibreOffice.git] / autodoc / source / parser_i / idl / pe_vari2.cxx
blob8491d831c9b8f1c59b97eaf5982d90f87b5b978b
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 ************************************************************************/
29 #include <precomp.h>
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>
44 namespace csi
46 namespace uidl
50 PE_Variable::PE_Variable( ary::idl::Type_id & i_rResult_Type,
51 String & i_rResult_Name )
52 : eState(e_none),
53 pResult_Type(&i_rResult_Type),
54 pResult_Name(&i_rResult_Name),
55 pPE_Type(0)
57 pPE_Type = new PE_Type(i_rResult_Type);
60 void
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()
73 void
74 PE_Variable::ProcessToken( const Token & i_rToken )
76 i_rToken.Trigger(*this);
80 void
81 PE_Variable::Process_Default()
83 if (eState == expect_type)
85 SetResult( not_done, push_sure, pPE_Type.Ptr() );
87 else{
88 csv_assert(false);
92 void
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;
105 else {
106 csv_assert(false);
110 void
111 PE_Variable::Process_Punctuation( const TokPunctuation & )
113 if (eState == expect_finish)
115 SetResult( not_done, pop_success );
116 eState = e_none;
118 else if (eState == expect_name)
120 SetResult( not_done, pop_success );
121 eState = e_none;
123 else {
124 csv_assert(false);
128 void
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 );
138 eState = e_none;
140 else {
141 csv_assert(false);
145 void
146 PE_Variable::InitData()
148 eState = expect_type;
150 *pResult_Type = 0;
151 *pResult_Name = "";
154 void
155 PE_Variable::ReceiveData()
157 eState = expect_name;
160 void
161 PE_Variable::TransferData()
163 eState = e_none;
166 UnoIDL_PE &
167 PE_Variable::MyPE()
169 return *this;
172 } // namespace uidl
173 } // namespace csi
175 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */