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_NAMSP_HXX
25 #define ADC_CPP_PE_NAMSP_HXX
26 
27 
28 
29 // USED SERVICES
30 	// BASE CLASSES
31 #include "cpp_pe.hxx"
32 	// COMPONENTS
33 #include <semantic/callf.hxx>
34 #include <semantic/sub_pe.hxx>
35 	// PARAMETERS
36 
37 namespace ary
38 {
39 namespace cpp
40 {
41 class Namespace;
42 }
43 }
44 
45 
46 namespace cpp
47 {
48 
49 
50 class PE_Namespace : public Cpp_PE
51 {
52   public:
53 	enum E_State
54 	{
55 		start,
56 		gotName,
57 		expectSemicolon,		/// after namespace assignment
58 		size_of_states
59 	};
60 						PE_Namespace(
61 							Cpp_PE *			i_pParent );
62 						~PE_Namespace();
63 
64 	virtual void		Call_Handler(
65 							const cpp::Token &	i_rTok );
66 
67 	ary::cpp::Namespace *
68 						Result_OpenedNamespace() const;
69   private:
70 	void				Setup_StatusFunctions();
71 
72 	virtual void		InitData();
73 	virtual void		TransferData();
74 	void  				Hdl_SyntaxError( const char *);
75 
76 	void				On_start_Identifier(const char * i_sText);
77 	void				On_start_SwBracket_Left(const char * i_sText);
78 	void				On_gotName_SwBracket_Left(const char * i_sText);
79 	void				On_gotName_Assign(const char * i_sText);
80 	void				On_expectSemicolon_Semicolon(const char * i_sText);
81 
82 	// DATA
83 	Dyn< PeStatusArray<PE_Namespace> >
84 						pStati;
85 
86     String              sLocalName;
87 	bool				bPush;
88 };
89 
90 
91 
92 
93 }   // namespace cpp
94 #endif
95 
96