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_FILE2_HXX
25 #define LUIDL_PE_FILE2_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 ary
38 {
39 namespace idl
40 {
41 class Module;
42 }   // namespace idl
43 }   // namespace ary
44 
45 
46 namespace csi
47 {
48 namespace uidl
49 {
50 
51 class TokenDistributor;
52 class PE_Service;
53 class PE_Singleton;
54 class PE_Interface;
55 class PE_Struct;
56 class PE_Exception;
57 class PE_Constant;
58 class PE_Enum;
59 class PE_Typedef;
60 
61 
62 class PE_File : public UnoIDL_PE,
63 				public ParseEnvState
64 {
65   public:
66 						PE_File(
67 							TokenDistributor &	i_rTokenAdmin,
68 							const ParserInfo &  i_parseInfo );
69 	virtual void	 	EstablishContacts(
70 							UnoIDL_PE *			io_pParentPE,
71 							ary::Repository &	io_rRepository,
72 							TokenProcessing_Result &
73 												o_rResult );
74 						~PE_File();
75 
76 	virtual void	  	ProcessToken(
77 							const Token &		i_rToken );
78 
79 	virtual void		Process_Identifier(
80 							const TokIdentifier &
81 												i_rToken );
82 	virtual void		Process_Punctuation(
83 							const TokPunctuation &
84 												i_rToken );
85 	virtual void		Process_MetaType(
86 							const TokMetaType &	i_rToken );
87 	virtual void		Process_Stereotype(
88 							const TokStereotype &
89 												i_rToken );
90 	virtual void		Process_Default();
91 
92   private:
93 	enum E_State
94 	{
95 		e_none,
96 		e_std,
97 		wait_for_module,
98 		wait_for_module_bracket,
99 		wait_for_module_semicolon,
100 		in_sub_pe,
101 		on_default
102 	};
103 
104 	virtual void		InitData();
105 	virtual void		TransferData();
106 	virtual void		ReceiveData();
107 	virtual UnoIDL_PE &	MyPE();
108 	virtual const ary::idl::Module &
109 						CurNamespace() const;
110 	virtual const ParserInfo &
111 						ParseInfo() const;
112 	// DATA
113     TokenDistributor *	pTokenAdmin;
114 	Dyn<PE_Service>	    pPE_Service;
115 	Dyn<PE_Singleton>	pPE_Singleton;
116 	Dyn<PE_Interface>	pPE_Interface;
117 	Dyn<PE_Struct>		pPE_Struct;
118 	Dyn<PE_Exception>	pPE_Exception;
119 	Dyn<PE_Constant>	pPE_Constant;
120 	Dyn<PE_Enum>		pPE_Enum;
121 	Dyn<PE_Typedef>		pPE_Typedef;
122 
123 	const ary::idl::Module *
124                         pCurNamespace;
125     const ParserInfo *  pParseInfo;
126 
127 	E_State 			eState;
128 	uintt				nBracketCount_inDefMode;
129 };
130 
131 
132 }   // namespace uidl
133 }   // namespace csi
134 
135 #endif
136 
137