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: pe_vafu.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 ************************************************************************/
32 #ifndef ADC_CPP_PE_VAFU_HXX
33 #define ADC_CPP_PE_VAFU_HXX
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>
56 class PE_VarFunc
: public Cpp_PE
63 afterClassDecl
, // Also used for after enum declaration.
66 afterName_inErraneousTemplate
,
68 finishedIncludingFunctionImplementation
,
74 result_ignore
, /// Used for class and enum declarations and predeclarations and for extern variables and functions.
79 typedef ary::cpp::E_Protection E_Protection
;
86 virtual void Call_Handler(
87 const cpp::Token
& i_rTok
);
89 const std::vector
<ary::cpp::Ce_id
> &
91 ary::cpp::Type_id
Result_FrontType() const;
94 E_ResultType
Result_CeType() const;
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();
167 Dyn
< PeStatusArray
<PE_VarFunc
> >
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
;
186 std::vector
<ary::cpp::Ce_id
>
188 ary::cpp::Type_id nResultFrontType
;
189 E_ResultType eResultType
;
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
; }
228 /* // Overview of Stati
233 start // vor und während storage class specifiern
235 operaator ->goto Function
241 operator ->goto Function
243 afterName ->goto Variable or Function
251 start // vor und während storage class specifiern
255 expectName // Typ ist da -> im Falle von '(': notyetimplemented
258 expectSize // after [
261 expectNextVarName // anders als bei expectName kann hier auch * oder & kommen
270 start // vor und während storage class specifiern
274 expectName // Typ ist da
275 expectBracket // Nach Name
276 expectParameter // nach ( oder ,
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