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_PARSEENV_HXX
25 #define ADC_PARSEENV_HXX
26 
27 
28 
29 // USED SERVICES
30 	// BASE CLASSES
31 #include <tokens/tokproct.hxx>
32 	// COMPONENTS
33 	// PARAMETERS
34 
35 
36 namespace ary
37 {
38 namespace info
39 {
40 class CodeInfo;
41 }   // namespace info
42 }   // namespace ary)
43 
44 
45 
46 class SubPeUseIfc;
47 
48 
49 class ParseEnvironment : protected TokenProcessing_Types
50 {
51   public:
~ParseEnvironment()52 	virtual				~ParseEnvironment() {}
53 
54 	// Parsing
55 	void				Enter(
56 							E_EnvStackAction	i_eWayOfEntering );
57 	void				Leave(
58 							E_EnvStackAction	i_eWayOfLeaving );
59 	void				SetCurSPU(
60 							const SubPeUseIfc *	i_pCurSPU );
61 
62 	ParseEnvironment * 	Parent() const;
63 
64 
65 	// ACCESS
66   protected:
67 						ParseEnvironment(
68 							ParseEnvironment *	i_pParent );
69 	const SubPeUseIfc *	CurSubPeUse() const;
70   private:
71 	virtual void		InitData() = 0;
72 	virtual void		TransferData() = 0;
73 
74 	ParseEnvironment *	pParent;
75 	const SubPeUseIfc * pCurSubPe;
76 };
77 
78 class SubPeUseIfc
79 {
80   public:
~SubPeUseIfc()81 	virtual				~SubPeUseIfc() {}
82 
83 	virtual void		InitParse() const = 0;
84 	virtual void		GetResults() const = 0;
85 };
86 
87 
88 
89 // IMPLEMENTATION
90 
91 inline void
SetCurSPU(const SubPeUseIfc * i_pCurSPU)92 ParseEnvironment::SetCurSPU( const SubPeUseIfc * i_pCurSPU )
93 	{ pCurSubPe = i_pCurSPU; }
94 
95 inline ParseEnvironment *
Parent() const96 ParseEnvironment::Parent() const
97 	{ return pParent; }
98 
99 inline const SubPeUseIfc *
CurSubPeUse() const100 ParseEnvironment::CurSubPeUse() const
101 	{ return pCurSubPe; }
102 
103 
104 
105 #endif
106 
107