xref: /trunk/main/autodoc/source/parser/inc/semantic/parseenv.hxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
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_PARSEENV_HXX
29 #define ADC_PARSEENV_HXX
30 
31 
32 
33 // USED SERVICES
34     // BASE CLASSES
35 #include <tokens/tokproct.hxx>
36     // COMPONENTS
37     // PARAMETERS
38 
39 
40 namespace ary
41 {
42 namespace info
43 {
44 class CodeInfo;
45 }   // namespace info
46 }   // namespace ary)
47 
48 
49 
50 class SubPeUseIfc;
51 
52 
53 class ParseEnvironment : protected TokenProcessing_Types
54 {
55   public:
56     virtual             ~ParseEnvironment() {}
57 
58     // Parsing
59     void                Enter(
60                             E_EnvStackAction    i_eWayOfEntering );
61     void                Leave(
62                             E_EnvStackAction    i_eWayOfLeaving );
63     void                SetCurSPU(
64                             const SubPeUseIfc * i_pCurSPU );
65 
66     ParseEnvironment *  Parent() const;
67 
68 
69     // ACCESS
70   protected:
71                         ParseEnvironment(
72                             ParseEnvironment *  i_pParent );
73     const SubPeUseIfc * CurSubPeUse() const;
74   private:
75     virtual void        InitData() = 0;
76     virtual void        TransferData() = 0;
77 
78     ParseEnvironment *  pParent;
79     const SubPeUseIfc * pCurSubPe;
80 };
81 
82 class SubPeUseIfc
83 {
84   public:
85     virtual             ~SubPeUseIfc() {}
86 
87     virtual void        InitParse() const = 0;
88     virtual void        GetResults() const = 0;
89 };
90 
91 
92 
93 // IMPLEMENTATION
94 
95 inline void
96 ParseEnvironment::SetCurSPU( const SubPeUseIfc * i_pCurSPU )
97     { pCurSubPe = i_pCurSPU; }
98 
99 inline ParseEnvironment *
100 ParseEnvironment::Parent() const
101     { return pParent; }
102 
103 inline const SubPeUseIfc *
104 ParseEnvironment::CurSubPeUse() const
105     { return pCurSubPe; }
106 
107 
108 
109 #endif
110 
111