xref: /trunk/main/autodoc/source/parser_i/inc/s2_luidl/pe_singl.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 LUIDL_PE_SINGL_HXX
29 #define LUIDL_PE_SINGL_HXX
30 
31 
32 
33 // USED SERVICES
34     // BASE CLASSES
35 #include <s2_luidl/parsenv2.hxx>
36 #include <s2_luidl/pestate.hxx>
37     // COMPONENTS
38     // PARAMETERS
39 
40 namespace ary
41 {
42     namespace idl
43     {
44         class Singleton;
45         class SglIfcSingleton;
46     }
47 }
48 
49 
50 namespace csi
51 {
52 namespace uidl
53 {
54 
55 class PE_Type;
56 
57 
58 class PE_Singleton : public UnoIDL_PE,
59                      public ParseEnvState
60 {
61   public:
62                         PE_Singleton();
63     virtual             ~PE_Singleton();
64 
65     virtual void        EstablishContacts(
66                             UnoIDL_PE *         io_pParentPE,
67                             ary::Repository &   io_rRepository,
68                             TokenProcessing_Result &
69                                                 o_rResult );
70     virtual void        ProcessToken(
71                             const Token &       i_rToken );
72 
73     virtual void        Process_MetaType(
74                             const TokMetaType & i_rToken );
75     virtual void        Process_Identifier(
76                             const TokIdentifier &
77                                                 i_rToken );
78     virtual void        Process_Punctuation(
79                             const TokPunctuation &
80                                                 i_rToken );
81     virtual void        Process_Default();
82 
83   private:
84     enum E_State
85     {
86         e_none = 0,
87         need_name,
88         need_curlbr_open,
89         e_std,
90         in_service,
91         need_finish,
92         in_base_interface,
93         e_STATES_MAX
94     };
95 
96 
97 #if 0
98     enum E_TokenType    /// @ATTENTION  Do not change existing values (except of tt_MAX) !!! Else array-indices will break.
99     {
100         tt_metatype = 0,
101         tt_identifier = 1,
102         tt_punctuation = 2,
103         tt_startoftype = 3,
104         tt_MAX
105     };
106     typedef void (PE_Singleton::*F_TOK)(const char *);
107 
108 
109     void                On_need_singleton_MetaType(const char * i_sText);
110     void                On_need_name_Identifer(const char * i_sText);
111     void                On_need_curlbr_open_Punctuation(const char * i_sText);
112     void                On_std_GotoService(const char * i_sText);
113     void                On_std_Punctuation(const char * i_sText);
114     void                On_need_finish_Punctuation(const char * i_sText);
115 
116     void                CallHandler(
117                             const char *        i_sTokenText,
118                             E_TokenType         i_eTokenType );
119 #endif // 0
120 
121     void                On_Default();
122 
123     virtual void        InitData();
124     virtual void        TransferData();
125     virtual void        ReceiveData();
126     virtual UnoIDL_PE & MyPE();
127 
128     // DATA
129 //  static F_TOK        aDispatcher[e_STATES_MAX][tt_MAX];
130 
131     E_State             eState;
132     String              sData_Name;
133     bool                bIsPreDeclaration;
134     ary::idl::Singleton *
135                         pCurSingleton;
136     ary::idl::SglIfcSingleton *
137                         pCurSiSingleton;
138 
139     Dyn<PE_Type>        pPE_Type;
140     ary::idl::Type_id   nCurParsed_Type;
141 };
142 
143 
144 }   // namespace uidl
145 }   // namespace csi
146 
147 
148 
149 #endif
150 
151