Update ooo320-m1
[ooovba.git] / autodoc / source / parser / cpp / cxt2ary.hxx
blob2fb3c5bbe86ee2957db76437bcec90a4c7d126f2
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: cxt2ary.hxx,v $
10 * $Revision: 1.5 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef ADC_CPP_CTX2ARY_HXX
32 #define ADC_CPP_CTX2ARY_HXX
36 // USED SERVICES
37 // BASE CLASSES
38 #include <ary/cpp/inpcontx.hxx>
39 #include <doc_deal.hxx>
40 #include "pev.hxx"
41 #include "fevnthdl.hxx"
42 // COMPONENTS
43 // PARAMETERS
45 namespace ary
47 namespace loc
49 class File;
55 namespace cpp
59 /** @descr
60 This class provides information about the context of an
61 CodeEntity, which is going to be stored in the repository.
62 The information is used mainly by class ary::cpp::Gate.
64 Also it provides information for the parser about actual
65 state of several public variables.
67 @todo
68 Include events, which allow correct storing of inline
69 documentation after enum values, parameters,
70 base classes.
72 class ContextForAry : public ary::cpp::InputContext,
73 public cpp::PeEnvironment,
74 public cpp::FileScope_EventHandler,
75 public DocuDealer
77 public:
78 // LIFECYCLE
79 ContextForAry(
80 ary::cpp::Gate & io_rAryGate );
81 virtual ~ContextForAry();
83 // OPERATIONS
84 void ResetResult() { aTokenResult.Reset(); }
86 // INQUIRY
87 const TokenProcessing_Result &
88 CurResult() const { return aTokenResult; }
89 // ACCESS
90 TokenProcessing_Result &
91 CurResult() { return aTokenResult; }
93 private:
94 // Interface ary::cpp::InputContext:
95 virtual ary::loc::File &
96 inq_CurFile() const;
97 virtual ary::cpp::Namespace &
98 inq_CurNamespace() const;
99 virtual ary::cpp::Class *
100 inq_CurClass() const;
101 virtual ary::cpp::Enum *
102 inq_CurEnum() const;
104 virtual Owner & inq_CurOwner() const;
105 virtual ary::cpp::E_Protection
106 inq_CurProtection() const;
108 // Interface PeEnvironment
109 virtual void do_SetTokenResult(
110 E_TokenDone i_eDone,
111 E_EnvStackAction i_eWhat2DoWithEnvStack,
112 ParseEnvironment * i_pParseEnv2Push );
113 virtual void do_OpenNamespace(
114 ary::cpp::Namespace &
115 io_rOpenedNamespace );
116 virtual void do_OpenExternC(
117 bool i_bOnlyForOneDeclaration );
118 virtual void do_OpenClass(
119 ary::cpp::Class & io_rOpenedClass );
120 virtual void do_OpenEnum(
121 ary::cpp::Enum & io_rOpenedEnum );
122 virtual void do_CloseBlock();
123 virtual void do_CloseClass();
124 virtual void do_CloseEnum();
125 virtual void do_SetCurProtection(
126 ary::cpp::E_Protection
127 i_eProtection );
128 virtual void do_OpenTemplate(
129 const StringVector &
130 i_rParameters );
131 virtual DYN StringVector *
132 do_Get_CurTemplateParameters();
133 virtual void do_Close_OpenTemplate();
134 virtual void do_Event_Class_FinishedBase(
135 const String & i_sBaseName );
137 virtual void do_Event_Store_Typedef(
138 ary::cpp::Typedef & io_rTypedef );
139 virtual void do_Event_Store_EnumValue(
140 ary::cpp::EnumValue &
141 io_rEnumValue );
142 virtual void do_Event_Store_CppDefinition(
143 ary::cpp::DefineEntity &
144 io_rDefinition );
145 virtual void do_Event_EnterFunction_ParameterList();
146 virtual void do_Event_Function_FinishedParameter(
147 const String & i_sParameterName );
148 virtual void do_Event_LeaveFunction_ParameterList();
149 virtual void do_Event_EnterFunction_Implementation();
150 virtual void do_Event_LeaveFunction_Implementation();
151 virtual void do_Event_Store_Function(
152 ary::cpp::Function &
153 io_rFunction );
154 virtual void do_Event_Store_Variable(
155 ary::cpp::Variable &
156 io_rVariable );
157 virtual void do_TakeDocu(
158 DYN ary::doc::OldCppDocu &
159 let_drInfo );
160 virtual void do_StartWaitingFor_Recovery();
161 virtual ary::cpp::Gate &
162 inq_AryGate() const;
163 virtual const ary::cpp::InputContext &
164 inq_Context() const;
165 virtual String inq_CurFileName() const;
166 virtual uintt inq_LineCount() const;
167 virtual bool inq_IsWaitingFor_Recovery() const;
168 virtual bool inq_IsExternC() const;
170 // Interface FileScope_EventHandler
171 virtual void do_SetCurFile(
172 ary::loc::File & io_rCurFile );
173 virtual void do_Event_IncrLineCount();
174 virtual void do_Event_SwBracketOpen();
175 virtual void do_Event_SwBracketClose();
176 virtual void do_Event_Semicolon();
178 // Local types
179 struct S_FileScopeInfo;
180 struct S_OwnerStack;
181 struct S_DocuDistributor;
182 struct S_RecoveryGuard;
184 // DATA
185 ary::cpp::Gate * pGate;
186 TokenProcessing_Result
187 aTokenResult;
188 Dyn<S_FileScopeInfo>
189 pFileScopeInfo;
190 Dyn<S_OwnerStack> pOwnerStack;
191 Dyn<S_DocuDistributor>
192 pDocuDistributor;
193 Dyn<S_RecoveryGuard>
194 pRecoveryGuard;
200 } // namespace cpp
201 #endif