1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef LUIDL_PE_CONST_HXX
29 #define LUIDL_PE_CONST_HXX
30 
31 
32 // USED SERVICES
33 	// BASE CLASSES
34 #include <s2_luidl/parsenv2.hxx>
35 #include <s2_luidl/pestate.hxx>
36 	// COMPONENTS
37 	// PARAMETERS
38 
39 
40 namespace udm {
41 class Agent_Struct;
42 }   // namespace udm
43 
44 
45 namespace csi
46 {
47 namespace uidl
48 {
49 
50 class ConstantsGroup;
51 
52 class PE_Type;
53 class PE_Value;
54 
55 class PE_Constant : public UnoIDL_PE,
56 					public ParseEnvState
57 {
58   public:
59 						PE_Constant();
60 	virtual void	 	EstablishContacts(
61 							UnoIDL_PE *			io_pParentPE,
62 							ary::Repository &
63                                                 io_rRepository,
64 							TokenProcessing_Result &
65 												o_rResult );
66 						~PE_Constant();
67 
68 	virtual void	  	ProcessToken(
69 							const Token &		i_rToken );
70 
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_Stereotype(
78 							const TokStereotype &
79 												i_rToken );
80 
81   private:
82 	enum E_State
83 	{
84 		e_none,
85 		expect_name,
86 		expect_curl_bracket_open,
87 		expect_const,
88 		expect_value,
89 		expect_finish,
90 		e_STATES_MAX
91 	};
92 	enum E_TokenType
93 	{
94 		tt_stereotype,
95 		tt_identifier,
96 		tt_punctuation,
97 		tt_MAX
98 	};
99 	typedef void (PE_Constant::*F_TOK)(const char *);
100 
101 
102 	void				CallHandler(
103 							const char *		i_sTokenText,
104 							E_TokenType			i_eTokenType );
105 
106 	void				On_expect_name_Identifier(const char * i_sText);
107 	void				On_expect_curl_bracket_open_Punctuation(const char * i_sText);
108 	void				On_expect_const_Stereotype(const char * i_sText);
109 	void				On_expect_const_Punctuation(const char * i_sText);
110 	void				On_expect_value_Identifier(const char * i_sText);
111 	void                On_expect_finish_Punctuation(const char * i_sText);
112 	void				On_Default(const char * );
113 
114 	void				EmptySingleConstData();
115 	void				CreateSingleConstant();
116 
117 	virtual void		InitData();
118 	virtual void		ReceiveData();
119 	virtual void		TransferData();
120 	virtual UnoIDL_PE &	MyPE();
121 
122   // DATA
123 	static F_TOK		aDispatcher[e_STATES_MAX][tt_MAX];
124 
125 	E_State             eState;
126 
127 	String              sData_Name;
128     ary::idl::Ce_id		nDataId;
129 
130 	Dyn<PE_Type>		pPE_Type;
131 	ary::idl::Type_id	nType;
132 
133 	Dyn<PE_Value>		pPE_Value;
134 	String				sName;
135 	String				sAssignment;
136 };
137 
138 
139 
140 }   // namespace uidl
141 }   // namespace csi
142 
143 
144 #endif
145 
146