merge the formfield patch from ooo-build
[ooovba.git] / autodoc / source / parser / cpp / pe_vafu.hxx
blob9cd28d4a76607fe0e4562ac54d80e4c9410577de
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: pe_vafu.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 ************************************************************************/
32 #ifndef ADC_CPP_PE_VAFU_HXX
33 #define ADC_CPP_PE_VAFU_HXX
35 // BASE CLASSES
36 #include "cpp_pe.hxx"
37 // USED SERVICES
38 #include <semantic/callf.hxx>
39 #include <semantic/sub_peu.hxx>
40 #include <ary/cpp/c_types4cpp.hxx>
41 #include <ary/cpp/c_vfflag.hxx>
45 namespace cpp
48 class PE_Type;
49 class PE_Variable;
50 class PE_Function;
51 class PE_Ignore;
56 class PE_VarFunc : public Cpp_PE
58 public:
59 enum E_State
61 start,
62 expectCtor,
63 afterClassDecl, // Also used for after enum declaration.
64 expectName,
65 afterName,
66 afterName_inErraneousTemplate,
67 finished,
68 finishedIncludingFunctionImplementation,
69 size_of_states
71 enum E_ResultType
73 result_unknown = 0,
74 result_ignore, /// Used for class and enum declarations and predeclarations and for extern variables and functions.
75 result_variable,
76 result_function
79 typedef ary::cpp::E_Protection E_Protection;
82 PE_VarFunc(
83 Cpp_PE * i_pParent );
84 ~PE_VarFunc();
86 virtual void Call_Handler(
87 const cpp::Token & i_rTok );
89 const std::vector<ary::cpp::Ce_id> &
90 Result_Ids() const;
91 ary::cpp::Type_id Result_FrontType() const;
92 const StringVector &
93 Result_Names() const;
94 E_ResultType Result_CeType() const;
96 private:
97 typedef SubPe< PE_VarFunc, PE_Type > SP_Type;
98 typedef SubPeUse< PE_VarFunc, PE_Type > SPU_Type;
99 typedef SubPe< PE_VarFunc, PE_Variable > SP_Variable;
100 typedef SubPeUse< PE_VarFunc, PE_Variable > SPU_Variable;
101 typedef SubPe< PE_VarFunc, PE_Function > SP_Function;
102 typedef SubPeUse< PE_VarFunc, PE_Function > SPU_Function;
103 typedef SubPe< PE_VarFunc, PE_Ignore > SP_Ignore;
104 typedef SubPeUse< PE_VarFunc, PE_Ignore > SPU_Ignore;
106 void Setup_StatusFunctions();
107 virtual void InitData();
108 virtual void TransferData();
109 void Hdl_UnknownToken( const char *);
111 void SpInit_FunctionStd();
112 void SpInit_FunctionCtor();
113 void SpInit_FunctionDtor();
114 void SpInit_FunctionCastOperator();
115 void SpInit_FunctionNormalOperator();
116 void SpReturn_Type();
117 void SpReturn_Variable();
118 void SpReturn_FunctionStd();
119 void SpReturn_Ignore();
121 void On_start_Identifier(const char * i_sText);
122 void On_start_operator(const char * i_sText);
123 void On_start_TypeKey(const char * i_sText);
124 void On_start_virtual(const char * i_sText);
125 void On_start_Tilde(const char * i_sText);
126 void On_start_const(const char * i_sText);
127 void On_start_volatile(const char * i_sText);
128 void On_start_extern(const char * i_sText);
129 void On_start_static(const char * i_sText);
130 void On_start_mutable(const char * i_sText);
131 void On_start_register(const char * i_sText);
132 void On_start_inline(const char * i_sText);
133 void On_start_explicit(const char * i_sText);
134 void On_start_Bracket_Right(const char * i_sText);
135 void On_start_typename(const char * i_sText);
137 void On_expectCtor_Bracket_Left(const char * i_sText);
139 void On_afterClassDecl_Semicolon(const char * i_sText);
141 void On_expectName_Identifier(const char * i_sText);
142 void On_expectName_operator(const char * i_sText);
143 void On_expectName_Bracket_Left(const char * i_sText);
145 void On_afterName_ArrayBracket_Left(const char * i_sText);
146 void On_afterName_Bracket_Left(const char * i_sText);
147 void On_afterName_DoubleColon(const char * i_sText);
148 void On_afterName_Semicolon(const char * i_sText);
149 void On_afterName_Comma(const char * i_sText);
150 void On_afterName_Assign(const char * i_sText);
151 void On_afterName_Less(const char * i_sText);
153 void On_afterName_inErraneousTemplate_Less(const char * i_sText);
154 void On_afterName_inErraneousTemplate_Greater(const char * i_sText);
155 void On_afterName_inErraneousTemplate_Default(const char * i_sText);
157 void On_finished_Semicolon(const char * i_sText);
158 void On_finished_Comma(const char * i_sText);
159 void On_finished_Default(const char * i_sText);
161 void On_finishedIncludingFunctionImplementation_Default(const char * i_sText);
163 ary::cpp::FunctionFlags
164 CreateFunctionFlags();
166 // DATA
167 Dyn< PeStatusArray<PE_VarFunc> >
168 pStati;
170 Dyn<SP_Type> pSpType;
171 Dyn<SPU_Type> pSpuType;
172 Dyn<SP_Variable> pSpVariable;
173 Dyn<SPU_Variable> pSpuVariable;
174 Dyn<SP_Function> pSpFunction;
175 Dyn<SPU_Function> pSpuFunctionStd;
176 Dyn<SPU_Function> pSpuFunctionCtor;
177 Dyn<SPU_Function> pSpuFunctionDtor;
178 Dyn<SPU_Function> pSpuFunctionCastOperator;
179 Dyn<SPU_Function> pSpuFunctionNormalOperator;
180 Dyn<SP_Ignore> pSpIgnore;
181 Dyn<SPU_Ignore> pSpuIgnore;
183 intt nCounter_TemplateBrackets;
184 bool bInDestructor;
186 std::vector<ary::cpp::Ce_id>
187 aResultIds;
188 ary::cpp::Type_id nResultFrontType;
189 E_ResultType eResultType;
191 // Pre-Results
192 String sName;
194 bool bVirtual;
195 bool bStatic;
196 bool bExtern;
197 bool bExternC;
198 bool bMutable;
199 bool bInline;
200 bool bRegister;
201 bool bExplicit;
206 // IMPLEMENTATION
208 inline const std::vector<ary::cpp::Ce_id> &
209 PE_VarFunc::Result_Ids() const
210 { return aResultIds; }
211 inline ary::cpp::Type_id
212 PE_VarFunc::Result_FrontType() const
213 { return nResultFrontType; }
214 inline PE_VarFunc::E_ResultType
215 PE_VarFunc::Result_CeType() const
216 { return eResultType; }
220 } // namespace cpp
225 #endif
228 /* // Overview of Stati
230 Undecided
231 ---------
233 start // vor und während storage class specifiern
234 any ->stay
235 operaator ->goto Function
237 ->Typ
239 expectName
240 Identifier ->stay
241 operator ->goto Function
243 afterName ->goto Variable or Function
248 Variable
249 --------
251 start // vor und während storage class specifiern
253 ->Typ
255 expectName // Typ ist da -> im Falle von '(': notyetimplemented
256 afterName
258 expectSize // after [
259 expectFinish
260 // vor ; oder ,
261 expectNextVarName // anders als bei expectName kann hier auch * oder & kommen
267 Function
268 --------
270 start // vor und während storage class specifiern
272 ->Typ
274 expectName // Typ ist da
275 expectBracket // Nach Name
276 expectParameter // nach ( oder ,
277 -> Parameter
278 after Parameters // before const, volatile throw or = 0.
279 after throw // expect (
280 expectException // after (
281 after exceptions // = 0 oder ; oder ,
284 expectNextVarName // anders als bei expectName kann hier auch * oder & kommen