Bump for 3.6-28
[LibreOffice.git] / autodoc / source / parser_i / idl / pe_tydf2.cxx
blob0f5d1df0a99954a382796d9ef798973b6993d797
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 "sal/config.h"
31 #include "sal/types.h"
33 #include <precomp.h>
34 #include <s2_luidl/pe_tydf2.hxx>
36 // NOT FULLY DECLARED SERVICES
37 #include <ary/idl/i_gate.hxx>
38 #include <ary/idl/i_typedef.hxx>
39 #include <ary/idl/ip_ce.hxx>
40 #include <ary/doc/d_oldidldocu.hxx>
41 #include <s2_luidl/pe_type2.hxx>
42 #include <s2_luidl/tk_ident.hxx>
43 #include <s2_luidl/tk_punct.hxx>
44 #include <s2_luidl/tk_const.hxx>
47 namespace csi
49 namespace uidl
53 #ifdef DF
54 #undef DF
55 #endif
56 #define DF &PE_Typedef::On_Default
58 PE_Typedef::F_TOK
59 PE_Typedef::aDispatcher[PE_Typedef::e_STATES_MAX][PE_Typedef::tt_MAX] =
60 { { DF, DF, DF }, // e_none
61 { &PE_Typedef::On_expect_description_Any,
62 &PE_Typedef::On_expect_description_Any,
63 DF }, // expect_description
64 { DF, &PE_Typedef::On_expect_name_Identifier,
65 DF }, // expect_name
66 { DF, DF, &PE_Typedef::On_got_name_Punctuation } // got_name
71 inline void
72 PE_Typedef::CallHandler( const char * i_sTokenText,
73 E_TokenType i_eTokenType )
74 { (this->*aDispatcher[eState][i_eTokenType])(i_sTokenText); }
80 PE_Typedef::PE_Typedef()
81 : eState(e_none),
82 pPE_Type(0),
83 nType(0),
84 sName()
86 pPE_Type = new PE_Type(nType);
89 void
90 PE_Typedef::EstablishContacts( UnoIDL_PE * io_pParentPE,
91 ary::Repository & io_rRepository,
92 TokenProcessing_Result & o_rResult )
94 UnoIDL_PE::EstablishContacts(io_pParentPE,io_rRepository,o_rResult);
95 pPE_Type->EstablishContacts(this,io_rRepository,o_rResult);
98 PE_Typedef::~PE_Typedef()
102 void
103 PE_Typedef::ProcessToken( const Token & i_rToken )
105 i_rToken.Trigger(*this);
108 void
109 PE_Typedef::Process_Identifier( const TokIdentifier & i_rToken )
111 CallHandler(i_rToken.Text(), tt_identifier);
114 void
115 PE_Typedef::Process_Punctuation( const TokPunctuation & i_rToken )
117 CallHandler(i_rToken.Text(), tt_punctuation);
120 void
121 PE_Typedef::Process_Default()
123 CallHandler("", tt_any);
126 void
127 PE_Typedef::On_expect_description_Any(SAL_UNUSED_PARAMETER const char *)
129 SetResult(not_done,push_sure, pPE_Type.Ptr());
132 void
133 PE_Typedef::On_expect_name_Identifier(const char * i_sText)
135 sName = i_sText;
136 SetResult(done,stay);
137 eState = got_name;
140 void
141 PE_Typedef::On_got_name_Punctuation(const char * i_sText)
143 if ( i_sText[0] == ';' )
145 SetResult(done,pop_success);
146 eState = e_none;
148 else
149 On_Default(i_sText);
152 void
153 PE_Typedef::On_Default(SAL_UNUSED_PARAMETER const char * )
155 SetResult(not_done,pop_failure);
158 void
159 PE_Typedef::InitData()
161 eState = expect_description;
162 nType = 0;
163 sName = "";
166 void
167 PE_Typedef::ReceiveData()
169 eState = expect_name;
172 void
173 PE_Typedef::TransferData()
175 ary::idl::Typedef &
176 rCe = Gate().Ces().Store_Typedef(CurNamespace().CeId(), sName, nType);
177 PassDocuAt(rCe);
178 eState = e_none;
181 UnoIDL_PE &
182 PE_Typedef::MyPE()
184 return *this;
187 } // namespace uidl
188 } // namespace csi
190 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */