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 
25 #ifndef ADC_CPP_PE_PARAM_HXX
26 #define ADC_CPP_PE_PARAM_HXX
27 
28 // BASE CLASSES
29 #include "cpp_pe.hxx"
30 // USED SERVICES
31 #include <semantic/callf.hxx>
32 #include <semantic/sub_peu.hxx>
33 #include <ary/cpp/c_vfflag.hxx>
34 
35 
36 
37 
38 namespace cpp
39 {
40     class PE_Type;
41     class PE_Variable;
42 
43 
44 
45 
46 class PE_Parameter : public Cpp_PE
47 {
48   public:
49 	enum E_State
50 	{
51 		start,
52 		expectName,
53 		afterName,
54         finished,
55 		size_of_states
56 	};
57     typedef ary::cpp::S_Parameter       S_ParamInfo;
58 
59 	explicit			PE_Parameter(
60 							Cpp_PE *			i_pParent );
61 						~PE_Parameter();
62 
63 	virtual void		Call_Handler(
64 							const cpp::Token &	i_rTok );
65 
66 	ary::cpp::Type_id   Result_FrontType() const;
67 	const S_ParamInfo & Result_ParamInfo() const;
68 
69   private:
70 	typedef SubPe< PE_Parameter, PE_Type >		    SP_Type;
71 	typedef SubPeUse< PE_Parameter, PE_Type >		SPU_Type;
72 	typedef SubPe< PE_Parameter, PE_Variable >	    SP_Variable;
73 	typedef SubPeUse< PE_Parameter, PE_Variable >	SPU_Variable;
74 
75 	void				Setup_StatusFunctions();
76 	virtual void		InitData();
77 	virtual void		TransferData();
78 	void  				Hdl_SyntaxError( const char *);
79 
80 	void				SpInit_Type();       // Type and Ignore.
81 	void				SpInit_Variable();
82 	void				SpReturn_Type();
83 	void				SpReturn_Variable();
84 
85 	void				On_start_Type(const char * i_sText);
86 	void				On_start_Bracket_Right(const char * i_sText);
87     void                On_start_Ellipse(const char * i_sText);
88 
89 	void				On_expectName_Identifier(const char * i_sText);
90 	void				On_expectName_ArrayBracket_Left(const char * i_sText);
91 	void				On_expectName_Bracket_Right(const char * i_sText);
92 	void				On_expectName_Comma(const char * i_sText);
93 
94 	void				On_afterName_ArrayBracket_Left(const char * i_sText);
95 	void				On_afterName_Bracket_Right(const char * i_sText);
96 	void				On_afterName_Comma(const char * i_sText);
97 	void				On_afterName_Assign(const char * i_sText);
98 
99 	void				On_finished_Bracket_Right(const char * i_sText);
100 	void				On_finished_Comma(const char * i_sText);
101 
102     // DATA
103 	Dyn< PeStatusArray<PE_Parameter> >
104 						pStati;
105 
106 	Dyn<SP_Type>	    pSpType;
107 	Dyn<SPU_Type>	 	pSpuType;
108 	Dyn<SP_Variable>	pSpVariable;
109 	Dyn<SPU_Variable>	pSpuVariable;
110 
111 	S_ParamInfo         aResultParamInfo;
112 };
113 
114 
115 
116 
117 // IMPLEMENTATION
118 inline ary::cpp::Type_id
Result_FrontType() const119 PE_Parameter::Result_FrontType() const
120 {
121     return aResultParamInfo.nType;
122 }
123 
124 inline const PE_Parameter::S_ParamInfo &
Result_ParamInfo() const125 PE_Parameter::Result_ParamInfo() const
126 {
127     return aResultParamInfo;
128 }
129 
130 
131 
132 
133 }   // namespace cpp
134 #endif
135