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_CONST_HXX
25 #define LUIDL_PE_CONST_HXX
26 
27 
28 // USED SERVICES
29 	// BASE CLASSES
30 #include <s2_luidl/parsenv2.hxx>
31 #include <s2_luidl/pestate.hxx>
32 	// COMPONENTS
33 	// PARAMETERS
34 
35 
36 namespace udm {
37 class Agent_Struct;
38 }   // namespace udm
39 
40 
41 namespace csi
42 {
43 namespace uidl
44 {
45 
46 class ConstantsGroup;
47 
48 class PE_Type;
49 class PE_Value;
50 
51 class PE_Constant : public UnoIDL_PE,
52 					public ParseEnvState
53 {
54   public:
55 						PE_Constant();
56 	virtual void	 	EstablishContacts(
57 							UnoIDL_PE *			io_pParentPE,
58 							ary::Repository &
59                                                 io_rRepository,
60 							TokenProcessing_Result &
61 												o_rResult );
62 						~PE_Constant();
63 
64 	virtual void	  	ProcessToken(
65 							const Token &		i_rToken );
66 
67 	virtual void		Process_Identifier(
68 							const TokIdentifier &
69 												i_rToken );
70 	virtual void		Process_Punctuation(
71 							const TokPunctuation &
72 												i_rToken );
73 	virtual void		Process_Stereotype(
74 							const TokStereotype &
75 												i_rToken );
76 
77   private:
78 	enum E_State
79 	{
80 		e_none,
81 		expect_name,
82 		expect_curl_bracket_open,
83 		expect_const,
84 		expect_value,
85 		expect_finish,
86 		e_STATES_MAX
87 	};
88 	enum E_TokenType
89 	{
90 		tt_stereotype,
91 		tt_identifier,
92 		tt_punctuation,
93 		tt_MAX
94 	};
95 	typedef void (PE_Constant::*F_TOK)(const char *);
96 
97 
98 	void				CallHandler(
99 							const char *		i_sTokenText,
100 							E_TokenType			i_eTokenType );
101 
102 	void				On_expect_name_Identifier(const char * i_sText);
103 	void				On_expect_curl_bracket_open_Punctuation(const char * i_sText);
104 	void				On_expect_const_Stereotype(const char * i_sText);
105 	void				On_expect_const_Punctuation(const char * i_sText);
106 	void				On_expect_value_Identifier(const char * i_sText);
107 	void                On_expect_finish_Punctuation(const char * i_sText);
108 	void				On_Default(const char * );
109 
110 	void				EmptySingleConstData();
111 	void				CreateSingleConstant();
112 
113 	virtual void		InitData();
114 	virtual void		ReceiveData();
115 	virtual void		TransferData();
116 	virtual UnoIDL_PE &	MyPE();
117 
118   // DATA
119 	static F_TOK		aDispatcher[e_STATES_MAX][tt_MAX];
120 
121 	E_State             eState;
122 
123 	String              sData_Name;
124     ary::idl::Ce_id		nDataId;
125 
126 	Dyn<PE_Type>		pPE_Type;
127 	ary::idl::Type_id	nType;
128 
129 	Dyn<PE_Value>		pPE_Value;
130 	String				sName;
131 	String				sAssignment;
132 };
133 
134 
135 
136 }   // namespace uidl
137 }   // namespace csi
138 
139 
140 #endif
141 
142