1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef LUIDL_PE_SINGL_HXX 25 #define LUIDL_PE_SINGL_HXX 26 27 28 29 // USED SERVICES 30 // BASE CLASSES 31 #include <s2_luidl/parsenv2.hxx> 32 #include <s2_luidl/pestate.hxx> 33 // COMPONENTS 34 // PARAMETERS 35 36 namespace ary 37 { 38 namespace idl 39 { 40 class Singleton; 41 class SglIfcSingleton; 42 } 43 } 44 45 46 namespace csi 47 { 48 namespace uidl 49 { 50 51 class PE_Type; 52 53 54 class PE_Singleton : public UnoIDL_PE, 55 public ParseEnvState 56 { 57 public: 58 PE_Singleton(); 59 virtual ~PE_Singleton(); 60 61 virtual void EstablishContacts( 62 UnoIDL_PE * io_pParentPE, 63 ary::Repository & io_rRepository, 64 TokenProcessing_Result & 65 o_rResult ); 66 virtual void ProcessToken( 67 const Token & i_rToken ); 68 69 virtual void Process_MetaType( 70 const TokMetaType & i_rToken ); 71 virtual void Process_Identifier( 72 const TokIdentifier & 73 i_rToken ); 74 virtual void Process_Punctuation( 75 const TokPunctuation & 76 i_rToken ); 77 virtual void Process_Default(); 78 79 private: 80 enum E_State 81 { 82 e_none = 0, 83 need_name, 84 need_curlbr_open, 85 e_std, 86 in_service, 87 need_finish, 88 in_base_interface, 89 e_STATES_MAX 90 }; 91 92 93 #if 0 94 enum E_TokenType /// @ATTENTION Do not change existing values (except of tt_MAX) !!! Else array-indices will break. 95 { 96 tt_metatype = 0, 97 tt_identifier = 1, 98 tt_punctuation = 2, 99 tt_startoftype = 3, 100 tt_MAX 101 }; 102 typedef void (PE_Singleton::*F_TOK)(const char *); 103 104 105 void On_need_singleton_MetaType(const char * i_sText); 106 void On_need_name_Identifer(const char * i_sText); 107 void On_need_curlbr_open_Punctuation(const char * i_sText); 108 void On_std_GotoService(const char * i_sText); 109 void On_std_Punctuation(const char * i_sText); 110 void On_need_finish_Punctuation(const char * i_sText); 111 112 void CallHandler( 113 const char * i_sTokenText, 114 E_TokenType i_eTokenType ); 115 #endif // 0 116 117 void On_Default(); 118 119 virtual void InitData(); 120 virtual void TransferData(); 121 virtual void ReceiveData(); 122 virtual UnoIDL_PE & MyPE(); 123 124 // DATA 125 // static F_TOK aDispatcher[e_STATES_MAX][tt_MAX]; 126 127 E_State eState; 128 String sData_Name; 129 bool bIsPreDeclaration; 130 ary::idl::Singleton * 131 pCurSingleton; 132 ary::idl::SglIfcSingleton * 133 pCurSiSingleton; 134 135 Dyn<PE_Type> pPE_Type; 136 ary::idl::Type_id nCurParsed_Type; 137 }; 138 139 140 } // namespace uidl 141 } // namespace csi 142 143 144 145 #endif 146 147