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_DEALER_HXX
25 #define ADC_CPP_C_DEALER_HXX
26 
27 
28 
29 // USED SERVICES
30 	// BASE CLASSES
31 #include <cpp/ctokdeal.hxx>
32 #include <adoc/atokdeal.hxx>
33 #include <ary/info/docstore.hxx>
34 	// COMPONENTS
35 #include "preproc.hxx"
36 #include "c_rcode.hxx"
37 #include <adoc/a_rdocu.hxx>
38 	// PARAMETERS
39 
40 namespace csv
41 {
42     namespace ploc
43     {
44         class Path;
45         class DirectoryChain;
46     }
47 }
48 
49 
50 class TokenParser;
51 
52 
53 namespace cpp
54 {
55 
56 class PE_File;
57 class DefineDescription;
58 
59 
60 class Distributor : public cpp::TokenDealer,        /// Handle C++ code tokens.
61                     public adoc::TokenDealer        /// Handle Autodoc documentation tokens.
62 {
63   public:
64     typedef std::map< String, DefineDescription* >     MacroMap;
65 
66     // LIFECYCLE
67 						Distributor(
68                             ary::cpp::Gate & 	io_rGate );
69 						~Distributor();
70     // OPERATIONS
71 	void				AssignPartners(
72                             CharacterSource &   io_rSourceText,
73                             const MacroMap &    i_rValidMacros );
74     void                StartNewFile(
75                             const csv::ploc::Path &
76                                                 i_file );
77 	virtual void		Deal_Eol();
78 	virtual void		Deal_Eof();
79 
80 	virtual void		Deal_CppCode(
81 							cpp::Token & 		let_drToken );
82     virtual void        Deal_Cpp_UnblockMacro(
83 							Tok_UnblockMacro & 	let_drToken );
84 
85 	virtual void		Deal_AdcDocu(
86 							adoc::Token & 		let_drToken );
87     virtual Distributor *
88                         AsDistributor();
89   private:
90 	// DATA
91     PreProcessor        aCppPreProcessor;
92 	CodeExplorer	    aCodeExplorer;
93 	adoc::DocuExplorer	aDocuExplorer;
94     ary::cpp::Gate *    pGate;
95     FileScope_EventHandler *
96                         pFileEventHandler;
97     DocuDealer *        pDocuDistributor;
98 };
99 
100 
101 
102 }   // namespace cpp
103 #endif
104 
105