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_EVALU_HXX
25 #define LUIDL_PE_EVALU_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 
37 namespace udm {
38 class Agent_Struct;
39 }   // namespace udm
40 
41 
42 namespace csi
43 {
44 namespace uidl
45 {
46 
47 class PE_Value : public UnoIDL_PE,
48 				 public ParseEnvState
49 {
50   public:
51 						PE_Value(
52 							String &			o_rName,
53 							String &			o_rAssignment,
54 							bool				i_bIsConst );
55 	virtual void	 	EstablishContacts(
56 							UnoIDL_PE *			io_pParentPE,
57 							ary::Repository &
58                                                 io_rRepository,
59 							TokenProcessing_Result &
60 												o_rResult );
61 						~PE_Value();
62 
63 	virtual void	  	ProcessToken(
64 							const Token &		i_rToken );
65 
66 	virtual void		Process_Identifier(
67 							const TokIdentifier &
68 												i_rToken );
69 	virtual void		Process_Punctuation(
70 							const TokPunctuation &
71 												i_rToken );
72 	virtual void		Process_Assignment(
73 							const TokAssignment &
74 												i_rToken );
75   private:
76 	enum E_State
77 	{
78 		e_none = 0,
79 		expect_name,
80 		got_name,
81 		e_STATES_MAX
82 	};
83 	enum E_TokenType	/// @ATTENTION  Do not change existing values (except of tt_MAX) !!! Else array-indices will break.
84 	{
85 		tt_identifier = 0,
86 		tt_punctuation = 1,
87 		tt_assignment = 2,
88 		tt_MAX
89 	};
90 	typedef void (PE_Value::*F_TOK)(const char *);
91 
92 
93 	void				CallHandler(
94 							const char *		i_sTokenText,
95 							E_TokenType			i_eTokenType );
96 
97 	void				On_expect_name_Identifier(const char * i_sText);
98 	void				On_got_name_Punctuation(const char * i_sText);
99 	void				On_got_name_Assignment(const char * i_sText);
100 	void				On_Default(const char * );
101 
102 	virtual void		InitData();
103 	virtual void		TransferData();
104 	virtual UnoIDL_PE &	MyPE();
105 
IsConst() const106 	bool				IsConst() const			{ return bIsConst; }
107 
108 	static F_TOK		aDispatcher[e_STATES_MAX][tt_MAX];
109 
110 	E_State             eState;
111 	String  *			pName;
112 	String  *			pAssignment;
113 	bool				bIsConst;
114 };
115 
116 
117 
118 }   // namespace uidl
119 }   // namespace csi
120 
121 
122 #endif
123 
124