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