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 #include <precomp.h>
23 #include <semantic/parseenv.hxx>
24 
25 
26 // NOT FULLY DECLARED SERVICES
27 #include <ary/doc/d_oldcppdocu.hxx>
28 #include <x_parse.hxx>
29 
30 
31 void
Enter(E_EnvStackAction i_eWayOfEntering)32 ParseEnvironment::Enter( E_EnvStackAction	i_eWayOfEntering )
33 {
34 	switch (i_eWayOfEntering)
35 	{
36 		case push:
37 				InitData();
38 				if ( Parent() != 0 )
39 				{
40 					csv_assert( Parent()->CurSubPeUse() != 0 );
41 					Parent()->CurSubPeUse()->InitParse();
42 				}
43 				break;
44 		case pop_success:
45 				break;
46 		case pop_failure:
47 				break;
48 		default:
49 			csv_assert(false);
50 	}	// end switch
51 }
52 
53 void
Leave(E_EnvStackAction i_eWayOfLeaving)54 ParseEnvironment::Leave( E_EnvStackAction	i_eWayOfLeaving )
55 {
56 	switch (i_eWayOfLeaving)
57 	{
58 		case push:
59 				break;
60 		case pop_success:
61 				TransferData();
62 				if ( Parent() != 0 )
63 				{
64 					csv_assert( Parent()->CurSubPeUse() != 0 );
65 					Parent()->CurSubPeUse()->GetResults();
66 				}
67 				break;
68 		case pop_failure:
69 				break;
70 		default:
71 			csv_assert(false);
72 	}	// end switch
73 }
74 
ParseEnvironment(ParseEnvironment * i_pParent)75 ParseEnvironment::ParseEnvironment( ParseEnvironment *	i_pParent )
76 	:	pParent(i_pParent),
77 		// pDocu,
78 		pCurSubPe(0)
79 {
80 }
81