1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: cxt2ary.hxx,v $
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
38 #include <ary/cpp/inpcontx.hxx>
39 #include <doc_deal.hxx>
41 #include "fevnthdl.hxx"
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.
68 Include events, which allow correct storing of inline
69 documentation after enum values, parameters,
72 class ContextForAry
: public ary::cpp::InputContext
,
73 public cpp::PeEnvironment
,
74 public cpp::FileScope_EventHandler
,
80 ary::cpp::Gate
& io_rAryGate
);
81 virtual ~ContextForAry();
84 void ResetResult() { aTokenResult
.Reset(); }
87 const TokenProcessing_Result
&
88 CurResult() const { return aTokenResult
; }
90 TokenProcessing_Result
&
91 CurResult() { return aTokenResult
; }
94 // Interface ary::cpp::InputContext:
95 virtual ary::loc::File
&
97 virtual ary::cpp::Namespace
&
98 inq_CurNamespace() const;
99 virtual ary::cpp::Class
*
100 inq_CurClass() const;
101 virtual ary::cpp::Enum
*
104 virtual Owner
& inq_CurOwner() const;
105 virtual ary::cpp::E_Protection
106 inq_CurProtection() const;
108 // Interface PeEnvironment
109 virtual void do_SetTokenResult(
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
128 virtual void do_OpenTemplate(
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
&
142 virtual void do_Event_Store_CppDefinition(
143 ary::cpp::DefineEntity
&
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(
154 virtual void do_Event_Store_Variable(
157 virtual void do_TakeDocu(
158 DYN
ary::doc::OldCppDocu
&
160 virtual void do_StartWaitingFor_Recovery();
161 virtual ary::cpp::Gate
&
163 virtual const ary::cpp::InputContext
&
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();
179 struct S_FileScopeInfo
;
181 struct S_DocuDistributor
;
182 struct S_RecoveryGuard
;
185 ary::cpp::Gate
* pGate
;
186 TokenProcessing_Result
190 Dyn
<S_OwnerStack
> pOwnerStack
;
191 Dyn
<S_DocuDistributor
>