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_C_RCODE_HXX
25 #define ADC_CPP_C_RCODE_HXX
26 
27 // BASE CLASSES
28 #include <tokens/tokproct.hxx>
29 // USED SERVICES
30 #include <cosv/ploc.hxx>
31 #include "cxt2ary.hxx"
32 #include <ary/cpp/c_types4cpp.hxx>
33 #include <ary/loc/loc_types4loc.hxx>
34 
35 
36 
37 namespace ary
38 {
39 namespace cpp
40 {
41     class Gate;
42 }
43 namespace doc
44 {
45     class OldCppDocu;
46 }
47 }
48 
49 namespace cpp
50 {
51     class PE_File;
52     class Token;
53     class Cpp_PE;
54 
55 
56 
57 
58 class CodeExplorer : private TokenProcessing_Types
59 
60 {
61   public:
62 						CodeExplorer(
63                             ary::cpp::Gate &    io_rAryGate );
64 						~CodeExplorer();
65 
66     void                StartNewFile();
67 	void				Process_Token(
68 							DYN cpp::Token &	let_drToken );
69     // ACCESS
70     FileScope_EventHandler &
FileEventHandler()71                         FileEventHandler()      { return aGlobalParseContext; }
DocuDistributor()72     DocuDealer &        DocuDistributor()       { return aGlobalParseContext; }
73 
74   private:
75 	typedef std::vector< cpp::Cpp_PE* >      EnvironmentStack;
76 
77 	void				AcknowledgeResult();
78 	const Token &		CurToken() const;
79 	Cpp_PE &	        CurEnv() const;
80 	Cpp_PE &			PushEnv() const;
81     TokenProcessing_Result &
CurResult()82                         CurResult()             { return aGlobalParseContext.CurResult(); }
83 
84 	// DATA
85     ContextForAry       aGlobalParseContext;
86 
87 	EnvironmentStack	aEnvironments;
88     Dyn<PE_File>        pPE_File;
89 
90 	ary::cpp::Gate *	pGate;
91 	cpp::Token *		dpCurToken;
92 };
93 
94 
95 
96 }   // namespace cpp
97 
98 
99 #endif
100 
101