Update ooo320-m1
[ooovba.git] / autodoc / source / parser / cpp / pe_file.hxx
blobd746347ca3f21f62de11fe6c84e909dcf45a96db
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_file.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_PE_FILE_HXX
32 #define ADC_CPP_PE_FILE_HXX
36 // USED SERVICES
37 // BASE CLASSES
38 #include "cpp_pe.hxx"
39 // COMPONENTS
40 #include <semantic/callf.hxx>
41 #include <semantic/sub_peu.hxx>
42 // PARAMETERS
45 namespace cpp {
47 class PeEnvironment;
49 class PE_Namespace;
50 class PE_Enum;
51 class PE_Typedef;
52 class PE_VarFunc;
53 class PE_TemplateTop;
54 class PE_Defines;
55 class PE_Ignore;
57 #if 0
58 class PE_Template;
59 class PE_Extern;
60 #endif
63 class PE_File : public Cpp_PE
65 public:
66 enum E_State
68 std, /// before class, struct or union
69 in_extern,
70 in_externC,
71 size_of_states
74 PE_File(
75 PeEnvironment & io_rEnv );
76 ~PE_File();
78 virtual void Call_Handler(
79 const cpp::Token & i_rTok );
80 virtual Cpp_PE * Handle_ChildFailure();
82 private:
83 typedef SubPe< PE_File, PE_Namespace> SP_Namespace;
84 typedef SubPe< PE_File, PE_Typedef> SP_Typedef;
85 typedef SubPe< PE_File, PE_VarFunc> SP_VarFunc;
86 typedef SubPe< PE_File, PE_TemplateTop> SP_Template;
87 typedef SubPe< PE_File, PE_Defines> SP_Defines;
88 typedef SubPe< PE_File, PE_Ignore > SP_Ignore;
89 #if 0
90 typedef SubPe< PE_File, PE_Using> SP_Using;
91 #endif // 0
93 typedef SubPeUse< PE_File, PE_Namespace> SPU_Namespace;
94 typedef SubPeUse< PE_File, PE_Typedef> SPU_Typedef;
95 typedef SubPeUse< PE_File, PE_VarFunc> SPU_VarFunc;
96 typedef SubPeUse< PE_File, PE_TemplateTop> SPU_Template;
97 typedef SubPeUse< PE_File, PE_Defines> SPU_Defines;
98 typedef SubPeUse< PE_File, PE_Ignore> SPU_Ignore;
100 void Setup_StatusFunctions();
101 virtual void InitData();
102 virtual void TransferData();
103 void Hdl_SyntaxError( const char *);
105 void SpReturn_VarFunc();
106 void SpReturn_Template();
108 void On_std_namespace(const char * i_sText);
109 void On_std_ClassKey(const char * i_sText);
110 void On_std_typedef(const char * i_sText);
111 void On_std_enum(const char * i_sText);
112 void On_std_VarFunc(const char * i_sText);
113 void On_std_template(const char * i_sText);
114 void On_std_extern(const char * i_sText);
115 void On_std_using(const char * i_sText);
116 void On_std_SwBracketRight(const char * i_sText);
118 void On_std_DefineName(const char * i_sText);
119 void On_std_MacroName(const char * i_sText);
121 void On_in_extern_Constant(const char * i_sText);
122 void On_in_extern_Ignore(const char * i_sText);
123 void On_in_externC_SwBracket_Left(const char * i_sText);
124 void On_in_externC_NoBlock(const char * i_sText);
126 PeEnvironment & access_Env() { return *pEnv; }
129 // DATA
130 PeEnvironment * pEnv;
132 Dyn< PeStatusArray<PE_File> >
133 pStati;
135 Dyn<SP_Namespace> pSpNamespace;
136 Dyn<SP_Typedef> pSpTypedef;
137 Dyn<SP_VarFunc> pSpVarFunc;
138 Dyn<SP_Template> pSpTemplate;
139 Dyn<SP_Defines> pSpDefs;
141 Dyn<SP_Ignore> pSpIgnore;
142 #if 0
143 SP_Using aSpUsing;
144 #endif // 0
146 Dyn<SPU_Namespace> pSpuNamespace;
147 Dyn<SPU_Typedef> pSpuTypedef;
148 Dyn<SPU_VarFunc> pSpuVarFunc;
149 Dyn<SPU_Template> pSpuTemplate;
150 Dyn<SPU_Defines> pSpuDefs;
152 Dyn<SPU_Ignore> pSpuUsing;
153 Dyn<SPU_Ignore> pSpuIgnoreFailure;
155 bool bWithinSingleExternC; /** After 'extern "C"' without following '{',
156 waiting for the next function or variable to
157 set back to false.
161 } // namespace cpp
165 #if 0 // Branches
167 namespace
168 -> Named Namespace declaration
169 -> Unnamed Namespace declaration
170 -> Namespace alias definition
172 class struct union
173 -> Class
174 -> Predeclaration
176 typedef
177 -> Typedef
179 enum
180 -> Enum
182 extern
183 -> Extern-"C"
184 -> TypeDeclaration
186 TypeDeclaration
187 -> FunctionDecl
188 -> FunctionDef
189 -> Variable
191 template
192 -> TemplateClass
193 -> TemplateFunction
194 -> TemplateFunction/Method-Implementation
195 -> TemplatePredeclaration
198 -> End of Namespace
199 -> End of Extern-"C"
202 -> AssemblerDeclaration
204 using
205 -> Using-Declaration
206 -> Using-Directive
208 #endif // 0
211 #endif