Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #ifndef LUIDL_PE_EVALU_HXX
21 : #define LUIDL_PE_EVALU_HXX
22 :
23 :
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 :
33 : namespace csi
34 : {
35 : namespace uidl
36 : {
37 :
38 : class PE_Value : public UnoIDL_PE,
39 : public ParseEnvState
40 : {
41 : public:
42 : PE_Value(
43 : String & o_rName,
44 : String & o_rAssignment,
45 : bool i_bIsConst );
46 : virtual void EstablishContacts(
47 : UnoIDL_PE * io_pParentPE,
48 : ary::Repository &
49 : io_rRepository,
50 : TokenProcessing_Result &
51 : o_rResult );
52 : ~PE_Value();
53 :
54 : virtual void ProcessToken(
55 : const Token & i_rToken );
56 :
57 : virtual void Process_Identifier(
58 : const TokIdentifier &
59 : i_rToken );
60 : virtual void Process_Punctuation(
61 : const TokPunctuation &
62 : i_rToken );
63 : virtual void Process_Assignment(
64 : const TokAssignment &
65 : i_rToken );
66 : private:
67 : enum E_State
68 : {
69 : e_none = 0,
70 : expect_name,
71 : got_name,
72 : e_STATES_MAX
73 : };
74 : enum E_TokenType /// @ATTENTION Do not change existing values (except of tt_MAX) !!! Else array-indices will break.
75 : {
76 : tt_identifier = 0,
77 : tt_punctuation = 1,
78 : tt_assignment = 2,
79 : tt_MAX
80 : };
81 : typedef void (PE_Value::*F_TOK)(const char *);
82 :
83 :
84 : void CallHandler(
85 : const char * i_sTokenText,
86 : E_TokenType i_eTokenType );
87 :
88 : void On_expect_name_Identifier(const char * i_sText);
89 : void On_got_name_Punctuation(const char * i_sText);
90 : void On_got_name_Assignment(const char * i_sText);
91 : void On_Default(const char * );
92 :
93 : virtual void InitData();
94 : virtual void TransferData();
95 : virtual UnoIDL_PE & MyPE();
96 :
97 1169 : bool IsConst() const { return bIsConst; }
98 :
99 : static F_TOK aDispatcher[e_STATES_MAX][tt_MAX];
100 :
101 : E_State eState;
102 : String * pName;
103 : String * pAssignment;
104 : bool bIsConst;
105 : };
106 :
107 :
108 :
109 : } // namespace uidl
110 : } // namespace csi
111 :
112 :
113 : #endif
114 :
115 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|