xref: /trunk/main/autodoc/source/parser/cpp/pe_enval.hxx (revision 1ecadb572e7010ff3b3382ad9bf179dbc6efadbb)
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_ENVAL_HXX
29 #define ADC_CPP_PE_ENVAL_HXX
30 
31 
32 
33 // USED SERVICES
34     // BASE CLASSES
35 #include "cpp_pe.hxx"
36     // COMPONENTS
37 #include <semantic/callf.hxx>
38 #include <semantic/sub_peu.hxx>
39     // PARAMETERS
40 
41 
42 namespace cpp {
43 
44 class PE_Expression;
45 
46 
47 class PE_EnumValue : public Cpp_PE
48 {
49   public:
50     enum E_State
51     {
52         start,                      // before name
53         afterName,
54         expectFinish,               // after init-expression
55         size_of_states
56     };
57                         PE_EnumValue(
58                             Cpp_PE *            i_pParent );
59                         ~PE_EnumValue();
60 
61     virtual void        Call_Handler(
62                             const cpp::Token &  i_rTok );
63 
64   private:
65     typedef SubPe< PE_EnumValue, PE_Expression >        SP_Expression;
66     typedef SubPeUse< PE_EnumValue, PE_Expression>      SPU_Expression;
67 
68     void                Setup_StatusFunctions();
69     virtual void        InitData();
70     virtual void        TransferData();
71     void                Hdl_SyntaxError(const char *);
72 
73     void                SpReturn_InitExpression();
74 
75     void                On_start_Identifier(const char * );
76 
77     void                On_afterName_SwBracket_Right(const char * );
78     void                On_afterName_Comma(const char * );
79     void                On_afterName_Assign(const char * );
80 
81     void                On_expectFinish_SwBracket_Right(const char * );
82     void                On_expectFinish_Comma(const char * );
83 
84     // DATA
85     Dyn< PeStatusArray<PE_EnumValue> >
86                         pStati;
87     Dyn<SP_Expression>  pSpExpression;
88     Dyn<SPU_Expression> pSpuInitExpression;
89 
90     String              sName;
91     String              sInitExpression;
92 };
93 
94 
95 
96 
97 }   // namespace cpp
98 #endif
99 
100