xref: /trunk/main/autodoc/source/parser/cpp/pe_defs.hxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef ADC_CPP_PE_DEFS_HXX
29 #define ADC_CPP_PE_DEFS_HXX
30 
31 
32 
33 
34 // USED SERVICES
35     // BASE CLASSES
36 #include "cpp_pe.hxx"
37     // COMPONENTS
38 #include <semantic/callf.hxx>
39 #include <semantic/sub_peu.hxx>
40     // PARAMETERS
41 
42 
43 namespace cpp
44 {
45 
46 
47 
48 class PE_Defines : public cpp::Cpp_PE
49 {
50   public:
51     enum E_State
52     {
53         expectName,
54         gotDefineName,
55         expectMacroParameters,
56         size_of_states
57     };
58 
59                         PE_Defines(
60                             Cpp_PE *            i_pParent );
61                         ~PE_Defines();
62 
63     virtual void        Call_Handler(
64                             const cpp::Token &  i_rTok );
65 
66   private:
67     void                Setup_StatusFunctions();
68     virtual void        InitData();
69     virtual void        TransferData();
70     void                Hdl_SyntaxError( const char *);
71 
72     void                On_expectName_DefineName( const char * );
73     void                On_expectName_MacroName( const char * );
74 
75     void                On_gotDefineName_PreProDefinition( const char * );
76 
77     void                On_expectMacroParameters_MacroParameter( const char * );
78     void                On_expectMacroParameters_PreProDefinition( const char * );
79 
80     // DATA
81     Dyn< PeStatusArray<PE_Defines> >
82                         pStati;
83 
84     String              sName;
85     StringVector        aParameters;
86     StringVector        aDefinition;
87     bool                bIsMacro;
88 };
89 
90 
91 
92 }   //namespace cpp
93 #endif
94 
95