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_CPP_PE_TYDEF_HXX
25 #define ADC_CPP_PE_TYDEF_HXX
26 
27 // BASE CLASSES
28 #include "cpp_pe.hxx"
29 // USED SERVICES
30 #include <semantic/callf.hxx>
31 #include <semantic/sub_peu.hxx>
32 
33 
34 namespace cpp
35 {
36     class PE_Type;
37 
38 
39 
40 
41 class PE_Typedef : public cpp::Cpp_PE
42 {
43   public:
44 	enum E_State
45 	{
46 		start,
47 		expectName,
48 		afterName,
49 		size_of_states
50 	};
51 						PE_Typedef(
52 							Cpp_PE *		i_pParent );
53 						~PE_Typedef();
54 
55 	virtual void		Call_Handler(
56 							const cpp::Token &	i_rTok );
57   private:
58 	typedef SubPe< PE_Typedef, PE_Type >		SP_Type;
59 	typedef SubPeUse< PE_Typedef, PE_Type> 	    SPU_Type;
60 
61 	void				Setup_StatusFunctions();
62 	virtual void		InitData();
63 	virtual void		TransferData();
64 	void  				Hdl_SyntaxError( const char *);
65 
66 	void				SpReturn_Type();
67 
68 	void				On_start_typedef( const char * );
69 	void				On_expectName_Identifier( const char * );
70 	void				On_afterName_Semicolon( const char * );
71 
72 	// DATA
73 	Dyn< PeStatusArray<PE_Typedef> >
74 						pStati;
75 	Dyn<SP_Type>		pSpType;
76 	Dyn<SPU_Type>		pSpuType;
77 
78 	String              sName;
79 	ary::cpp::Type_id	nType;
80 };
81 
82 
83 
84 
85 }   // namespace cpp
86 #endif
87