xref: /AOO41X/main/autodoc/source/parser/cpp/tkp_cpp.hxx (revision 1c78a5d6c0093dece4c096ba53051800fbad6e33)
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_TKP_CPP_HXX
25 #define ADC_TKP_CPP_HXX
26 
27 // USED SERVICES
28     // BASE CLASSES
29 #include <tokens/tkp.hxx>
30     // COMPONENTS
31     // PARAMETRS
32 
33 namespace autodoc
34 {
35     class TkpDocuContext;
36 }
37 
38 namespace csv
39 {
40     namespace ploc
41     {
42         class Path;
43         class DirectoryChain;
44     }
45 }
46 
47 
48 namespace cpp {
49 
50 class Context_CppStd;
51 class DefineDescription;
52 class Distributor;
53 
54 
55 /** This is a TokenParser which is able to parse tokens from
56     C++ source code.
57 */
58 class TokenParser_Cpp : public TokenParser
59 {
60   public:
61     typedef std::map< String, DefineDescription* >     MacroMap;
62 
63     // LIFECYCLE
64                         TokenParser_Cpp(
65                             DYN autodoc::TkpDocuContext &
66                                                 let_drDocuContext );
67     virtual             ~TokenParser_Cpp();
68 
69     // OPERATIONS
70     void                AssignPartners(
71                             CharacterSource &   io_rCharacterSource,
72                             cpp::Distributor &  o_rDealer );
73     void                StartNewFile(
74                             const csv::ploc::Path &
75                                                 i_file );
76   private:
77     virtual void        SetStartContext();
78     virtual void        SetCurrentContext(
79                             TkpContext &        io_rContext );
80     virtual TkpContext &
81                         CurrentContext();
82     // DATA
83     Dyn<Context_CppStd> pBaseContext;
84     TkpContext *        pCurContext;
85     Distributor *       pDealer;
86     CharacterSource *   pCharacterSource;
87 };
88 
89 
90 }   // namespace cpp
91 
92 
93 #endif
94 
95 
96