xref: /AOO41X/main/autodoc/source/parser_i/inc/s2_luidl/pe_tydf2.hxx (revision 1c78a5d6c0093dece4c096ba53051800fbad6e33)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef LUIDL_PE_TYDF2_HXX
25 #define LUIDL_PE_TYDF2_HXX
26 
27 
28 
29 // USED SERVICES
30     // BASE CLASSES
31 #include <s2_luidl/parsenv2.hxx>
32 #include <s2_luidl/pestate.hxx>
33     // COMPONENTS
34     // PARAMETERS
35 
36 
37 
38 
39 namespace csi
40 {
41 namespace uidl
42 {
43 
44 class PE_Type;
45 
46 
47 class PE_Typedef : public UnoIDL_PE,
48                    public ParseEnvState
49 {
50   public:
51                         PE_Typedef();
52     virtual void        EstablishContacts(
53                             UnoIDL_PE *         io_pParentPE,
54                             ary::Repository &   io_rRepository,
55                             TokenProcessing_Result &
56                                                 o_rResult );
57                         ~PE_Typedef();
58 
59     virtual void        ProcessToken(
60                             const Token &       i_rToken );
61 
62     virtual void        Process_Identifier(
63                             const TokIdentifier &
64                                                 i_rToken );
65     virtual void        Process_Punctuation(
66                             const TokPunctuation &
67                                                 i_rToken );
68     virtual void        Process_Default();
69 
70   private:
71     enum E_State
72     {
73         e_none = 0,
74         expect_description,
75         expect_name,
76         got_name,
77         e_STATES_MAX
78     };
79     enum E_TokenType    /// @ATTENTION  Do not change existing values (except of tt_MAX) !!! Else array-indices will break.
80     {
81         tt_any = 0,
82         tt_identifier,
83         tt_punctuation,
84         tt_MAX
85     };
86     typedef void (PE_Typedef::*F_TOK)(const char *);
87 
88 
89     void                CallHandler(
90                             const char *        i_sTokenText,
91                             E_TokenType         i_eTokenType );
92 
93     void                On_expect_description_Any(const char * i_sText);
94     void                On_expect_name_Identifier(const char * i_sText);
95     void                On_got_name_Punctuation(const char * i_sText);
96     void                On_Default(const char * );
97 
98     virtual void        InitData();
99     virtual void        ReceiveData();
100     virtual void        TransferData();
101     virtual UnoIDL_PE & MyPE();
102 
103     // DATA
104     static F_TOK        aDispatcher[e_STATES_MAX][tt_MAX];
105 
106     E_State             eState;
107     Dyn<PE_Type>        pPE_Type;
108     ary::idl::Type_id   nType;
109     String              sName;
110 };
111 
112 
113 
114 }   // namespace uidl
115 }   // namespace csi
116 
117 
118 
119 #endif
120 
121