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_DEFS_HXX
25 #define ADC_CPP_PE_DEFS_HXX
26 
27 
28 
29 
30 // USED SERVICES
31 	// BASE CLASSES
32 #include "cpp_pe.hxx"
33 	// COMPONENTS
34 #include <semantic/callf.hxx>
35 #include <semantic/sub_peu.hxx>
36 	// PARAMETERS
37 
38 
39 namespace cpp
40 {
41 
42 
43 
44 class PE_Defines : public cpp::Cpp_PE
45 {
46   public:
47 	enum E_State
48 	{
49 		expectName,
50 		gotDefineName,
51 		expectMacroParameters,
52 		size_of_states
53 	};
54 
55 						PE_Defines(
56 							Cpp_PE *			i_pParent );
57 						~PE_Defines();
58 
59 	virtual void		Call_Handler(
60 							const cpp::Token &	i_rTok );
61 
62   private:
63 	void				Setup_StatusFunctions();
64 	virtual void		InitData();
65 	virtual void		TransferData();
66 	void  				Hdl_SyntaxError( const char *);
67 
68 	void				On_expectName_DefineName( const char * );
69 	void				On_expectName_MacroName( const char * );
70 
71 	void				On_gotDefineName_PreProDefinition( const char * );
72 
73 	void                On_expectMacroParameters_MacroParameter( const char * );
74 	void                On_expectMacroParameters_PreProDefinition( const char * );
75 
76 	// DATA
77 	Dyn< PeStatusArray<PE_Defines> >
78 						pStati;
79 
80 	String              sName;
81     StringVector        aParameters;
82     StringVector        aDefinition;
83     bool                bIsMacro;
84 };
85 
86 
87 
88 }   //namespace cpp
89 #endif
90 
91