xref: /trunk/main/autodoc/source/parser/cpp/c_rcode.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef ADC_CPP_C_RCODE_HXX
29 #define ADC_CPP_C_RCODE_HXX
30 
31 // BASE CLASSES
32 #include <tokens/tokproct.hxx>
33 // USED SERVICES
34 #include <cosv/ploc.hxx>
35 #include "cxt2ary.hxx"
36 #include <ary/cpp/c_types4cpp.hxx>
37 #include <ary/loc/loc_types4loc.hxx>
38 
39 
40 
41 namespace ary
42 {
43 namespace cpp
44 {
45     class Gate;
46 }
47 namespace doc
48 {
49     class OldCppDocu;
50 }
51 }
52 
53 namespace cpp
54 {
55     class PE_File;
56     class Token;
57     class Cpp_PE;
58 
59 
60 
61 
62 class CodeExplorer : private TokenProcessing_Types
63 
64 {
65   public:
66 						CodeExplorer(
67                             ary::cpp::Gate &    io_rAryGate );
68 						~CodeExplorer();
69 
70     void                StartNewFile();
71 	void				Process_Token(
72 							DYN cpp::Token &	let_drToken );
73     // ACCESS
74     FileScope_EventHandler &
75                         FileEventHandler()      { return aGlobalParseContext; }
76     DocuDealer &        DocuDistributor()       { return aGlobalParseContext; }
77 
78   private:
79 	typedef std::vector< cpp::Cpp_PE* >      EnvironmentStack;
80 
81 	void				AcknowledgeResult();
82 	const Token &		CurToken() const;
83 	Cpp_PE &	        CurEnv() const;
84 	Cpp_PE &			PushEnv() const;
85     TokenProcessing_Result &
86                         CurResult()             { return aGlobalParseContext.CurResult(); }
87 
88 	// DATA
89     ContextForAry       aGlobalParseContext;
90 
91 	EnvironmentStack	aEnvironments;
92     Dyn<PE_File>        pPE_File;
93 
94 	ary::cpp::Gate *	pGate;
95 	cpp::Token *		dpCurToken;
96 };
97 
98 
99 
100 }   // namespace cpp
101 
102 
103 #endif
104 
105