xref: /AOO41X/main/autodoc/source/parser/inc/tokens/tokproct.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_CPP_TOKPROCT_HXX
25 #define ADC_CPP_TOKPROCT_HXX
26 
27 
28 
29 // USED SERVICES
30     // BASE CLASSES
31     // COMPONENTS
32     // PARAMETERS
33 
34 
35 class ParseEnvironment;
36 
37 /** is a parent class for classes, which take part in parsing tokens semantically.
38     It provides some types for them.
39 */
40 class TokenProcessing_Types
41 {
42   public:
43     enum E_TokenDone
44     {
45         not_done = 0,
46         done = 1
47     };
48 
49     enum E_EnvStackAction
50     {
51         stay,           // same parse environment
52         push,           // push sub environment
53         pop_success,    // return to parent environment, parsing was successful
54         pop_failure     // return to parent environment, but an error occured.
55     };
56 
57     struct TokenProcessing_Result
58     {
59         E_TokenDone         eDone;
60         E_EnvStackAction    eStackAction;
61         ParseEnvironment *  pEnv2Push;
62 
TokenProcessing_ResultTokenProcessing_Types::TokenProcessing_Result63                             TokenProcessing_Result()
64                                                 : eDone(not_done), eStackAction(stay), pEnv2Push(0) {}
ResetTokenProcessing_Types::TokenProcessing_Result65         void                Reset()             { eDone = not_done; eStackAction = stay; pEnv2Push = 0; }
66     };
67 
68     enum E_ParseResult
69     {
70         res_error,
71         res_complete,
72         res_predeclaration
73     };
74 };
75 
76 
77 
78 #endif
79 
80