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"
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>
56 #define DF &PE_Typedef::On_Default
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
,
66 { DF
, DF
, &PE_Typedef::On_got_name_Punctuation
} // got_name
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()
86 pPE_Type
= new PE_Type(nType
);
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()
103 PE_Typedef::ProcessToken( const Token
& i_rToken
)
105 i_rToken
.Trigger(*this);
109 PE_Typedef::Process_Identifier( const TokIdentifier
& i_rToken
)
111 CallHandler(i_rToken
.Text(), tt_identifier
);
115 PE_Typedef::Process_Punctuation( const TokPunctuation
& i_rToken
)
117 CallHandler(i_rToken
.Text(), tt_punctuation
);
121 PE_Typedef::Process_Default()
123 CallHandler("", tt_any
);
127 PE_Typedef::On_expect_description_Any(SAL_UNUSED_PARAMETER
const char *)
129 SetResult(not_done
,push_sure
, pPE_Type
.Ptr());
133 PE_Typedef::On_expect_name_Identifier(const char * i_sText
)
136 SetResult(done
,stay
);
141 PE_Typedef::On_got_name_Punctuation(const char * i_sText
)
143 if ( i_sText
[0] == ';' )
145 SetResult(done
,pop_success
);
153 PE_Typedef::On_Default(SAL_UNUSED_PARAMETER
const char * )
155 SetResult(not_done
,pop_failure
);
159 PE_Typedef::InitData()
161 eState
= expect_description
;
167 PE_Typedef::ReceiveData()
169 eState
= expect_name
;
173 PE_Typedef::TransferData()
176 rCe
= Gate().Ces().Store_Typedef(CurNamespace().CeId(), sName
, nType
);
190 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */