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 ADC_UIDL_PE_SERVI_HXX
25 #define ADC_UIDL_PE_SERVI_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 Service;
41      	class SglIfcService;
42     }
43 }
44 
45 namespace csi
46 {
47 namespace uidl
48 {
49 
50 class PE_Property;
51 class PE_Type;
52 class PE_Function;
53 
54 
55 class PE_Service : public UnoIDL_PE,
56 				   public ParseEnvState
57 {
58   public:
59 						PE_Service();
60 	virtual				~PE_Service();
61 
62 	virtual void	 	EstablishContacts(
63 							UnoIDL_PE *			io_pParentPE,
64 							ary::Repository &	io_rRepository,
65 							TokenProcessing_Result &
66 												o_rResult );
67 	virtual void	  	ProcessToken(
68 							const Token &		i_rToken );
69 
70 	virtual void		Process_MetaType(
71 							const TokMetaType &	i_rToken );
72 	virtual void		Process_Identifier(
73 							const TokIdentifier &
74 												i_rToken );
75 	virtual void		Process_Punctuation(
76 							const TokPunctuation &
77 												i_rToken );
78 	virtual void		Process_Stereotype(
79 							const TokStereotype &
80 												i_rToken );
81 	virtual void		Process_Needs();
82 	virtual void		Process_Observes();
83 	virtual void		Process_Default();
84 
85   private:
86 	void				On_Default();
87 
88 	enum E_State
89 	{
90 		e_none = 0,
91 		need_name,
92 		need_curlbr_open,
93 		e_std,
94 		in_property,
95 		in_ifc_type,
96 		in_service_type,
97 		expect_ifc_separator,
98 		expect_service_separator,
99 		at_ignore,
100 		need_finish,
101 		need_base_interface,    /// After ":".
102 		need_curlbr_open_sib,   /// After base interface in single interface based service.
103 		e_std_sib,              /// Standard in single interface based service.
104 		e_STATES_MAX
105 	};
106 
107 	virtual void		InitData();
108 	virtual void		TransferData();
109 	virtual void		ReceiveData();
110 	virtual UnoIDL_PE &	MyPE();
111 
112 	void				StartProperty();
113 
114 
115 	// DATA
116 	E_State				eState;
117 	String              sData_Name;
118 	bool				bIsPreDeclaration;
119 	ary::idl::Service * pCurService;
120 	ary::idl::SglIfcService *
121 	                    pCurSiService;
122 	ary::idl::Ce_id     nCurService;  // Needed for PE_Attribute.
123 
124 	Dyn<PE_Property>	pPE_Property;
125 	ary::idl::Ce_id		nCurParsed_Property;
126 
127 	Dyn<PE_Type>		pPE_Type;
128 	ary::idl::Type_id	nCurParsed_Type;
129 
130 	Dyn<PE_Function>	pPE_Constructor;
131 
132 	bool				bOptionalMember;
133 };
134 
135 
136 
137 // IMPLEMENTATION
138 
139 
140 }   // namespace uidl
141 }   // namespace csi
142 
143 
144 #endif
145 
146