xref: /trunk/main/autodoc/source/parser_i/inc/s2_luidl/pe_tydf2.hxx (revision a3cdc23e488c57f3433f22cd4458e65c27aa499c)
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 #ifndef LUIDL_PE_TYDF2_HXX
23 #define LUIDL_PE_TYDF2_HXX
24 
25 // USED SERVICES
26     // BASE CLASSES
27 #include <s2_luidl/parsenv2.hxx>
28 #include <s2_luidl/pestate.hxx>
29     // COMPONENTS
30     // PARAMETERS
31 
32 namespace csi
33 {
34 namespace uidl
35 {
36 
37 class PE_Type;
38 
39 class PE_Typedef : public UnoIDL_PE,
40                    public ParseEnvState
41 {
42 public:
43                         PE_Typedef();
44     virtual void        EstablishContacts(
45                             UnoIDL_PE *         io_pParentPE,
46                             ary::Repository &   io_rRepository,
47                             TokenProcessing_Result &
48                                                 o_rResult );
49                         ~PE_Typedef();
50 
51     virtual void        ProcessToken(
52                             const Token &       i_rToken );
53 
54     virtual void        Process_Identifier(
55                             const TokIdentifier &
56                                                 i_rToken );
57     virtual void        Process_Punctuation(
58                             const TokPunctuation &
59                                                 i_rToken );
60     virtual void        Process_Default();
61 
62 private:
63     enum E_State
64     {
65         e_none = 0,
66         expect_description,
67         expect_name,
68         got_name,
69         e_STATES_MAX
70     };
71     enum E_TokenType // @ATTENTION  Do not change existing values (except of tt_MAX) !!! Else array-indices will break.
72     {
73         tt_any = 0,
74         tt_identifier,
75         tt_punctuation,
76         tt_MAX
77     };
78     typedef void (PE_Typedef::*F_TOK)(const char *);
79 
80 
81     void                CallHandler(
82                             const char *        i_sTokenText,
83                             E_TokenType         i_eTokenType );
84 
85     void                On_expect_description_Any(const char * i_sText);
86     void                On_expect_name_Identifier(const char * i_sText);
87     void                On_got_name_Punctuation(const char * i_sText);
88     void                On_Default(const char * );
89 
90     virtual void        InitData();
91     virtual void        ReceiveData();
92     virtual void        TransferData();
93     virtual UnoIDL_PE & MyPE();
94 
95     // DATA
96     static F_TOK        aDispatcher[e_STATES_MAX][tt_MAX];
97 
98     E_State             eState;
99     Dyn<PE_Type>        pPE_Type;
100     ary::idl::Type_id   nType;
101     String              sName;
102 };
103 
104 } // namespace uidl
105 } // namespace csi
106 
107 #endif
108 
109 /* vim: set noet sw=4 ts=4: */
110