xref: /AOO41X/main/autodoc/source/parser_i/inc/s2_luidl/pe_enum2.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 ADC_UIDL_PE_ENUM2_HXX
25 #define ADC_UIDL_PE_ENUM2_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 namespace csi
39 {
40 namespace uidl
41 {
42 
43 // class Enum;
44 
45 class PE_Value;
46 
47 class PE_Enum : public UnoIDL_PE,
48                     public ParseEnvState
49 {
50   public:
51                         PE_Enum();
52     virtual void        EstablishContacts(
53                             UnoIDL_PE *         io_pParentPE,
54                             ary::Repository &   io_rRepository,
55                             TokenProcessing_Result &
56                                                 o_rResult );
57                         ~PE_Enum();
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 
69   private:
70     enum E_State
71     {
72         e_none,
73         expect_name,
74         expect_curl_bracket_open,
75         expect_value,
76         expect_finish,
77         e_STATES_MAX
78     };
79     enum E_TokenType
80     {
81         tt_identifier,
82         tt_punctuation,
83         tt_MAX
84     };
85     typedef void (PE_Enum::*F_TOK)(const char *);
86 
87 
88     void                CallHandler(
89                             const char *        i_sTokenText,
90                             E_TokenType         i_eTokenType );
91 
92     void                On_expect_name_Identifier(const char * i_sText);
93     void                On_expect_curl_bracket_open_Punctuation(const char * i_sText);
94     void                On_expect_value_Punctuation(const char * i_sText);
95     void                On_expect_value_Identifier(const char * i_sText);
96     void                On_expect_finish_Punctuation(const char * i_sText);
97     void                On_Default(const char * );
98 
99     void                EmptySingleValueData();
100     void                CreateSingleValue();
101 
102     virtual void        InitData();
103     virtual void        ReceiveData();
104     virtual void        TransferData();
105     virtual UnoIDL_PE & MyPE();
106 
107   // DATA
108     static F_TOK        aDispatcher[e_STATES_MAX][tt_MAX];
109 
110     E_State             eState;
111 
112     String              sData_Name;
113     ary::idl::Ce_id     nDataId;
114 
115     Dyn<PE_Value>       pPE_Value;
116     String              sName;
117     String              sAssignment;
118 };
119 
120 
121 
122 }   // namespace uidl
123 }   // namespace csi
124 
125 
126 #endif
127 
128