1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #include "sal/config.h"
31 #include "sal/types.h"
34 #include <s2_luidl/pe_evalu.hxx>
36 // NOT FULLY DECLARED SERVICES
37 #include <ary/idl/i_enumvalue.hxx>
38 #include <ary/idl/i_gate.hxx>
39 #include <ary/idl/ip_ce.hxx>
40 #include <ary/doc/d_oldidldocu.hxx>
41 #include <s2_luidl/tk_ident.hxx>
42 #include <s2_luidl/tk_punct.hxx>
43 #include <s2_luidl/tk_const.hxx>
55 #define DF &PE_Value::On_Default
58 PE_Value::aDispatcher
[PE_Value::e_STATES_MAX
][PE_Value::tt_MAX
] =
59 { { DF
, DF
, DF
}, // e_none
60 { &PE_Value::On_expect_name_Identifier
,
61 DF
, DF
}, // expect_name
62 { DF
, &PE_Value::On_got_name_Punctuation
,
63 &PE_Value::On_got_name_Assignment
} // got_name
69 PE_Value::CallHandler( const char * i_sTokenText
,
70 E_TokenType i_eTokenType
)
71 { (this->*aDispatcher
[eState
][i_eTokenType
])(i_sTokenText
); }
77 PE_Value::PE_Value( String
& o_rName
,
78 String
& o_rAssignment
,
82 pAssignment(&o_rAssignment
),
88 PE_Value::EstablishContacts( UnoIDL_PE
* io_pParentPE
,
89 ary::Repository
& io_rRepository
,
90 TokenProcessing_Result
& o_rResult
)
92 UnoIDL_PE::EstablishContacts(io_pParentPE
,io_rRepository
,o_rResult
);
100 PE_Value::ProcessToken( const Token
& i_rToken
)
102 i_rToken
.Trigger(*this);
106 PE_Value::Process_Identifier( const TokIdentifier
& i_rToken
)
108 CallHandler(i_rToken
.Text(), tt_identifier
);
112 PE_Value::Process_Punctuation( const TokPunctuation
& i_rToken
)
114 CallHandler(i_rToken
.Text(), tt_punctuation
);
118 PE_Value::Process_Assignment( const TokAssignment
& i_rToken
)
120 CallHandler(i_rToken
.Text(), tt_assignment
);
124 PE_Value::On_expect_name_Identifier(const char * i_sText
)
127 SetResult(done
,stay
);
132 PE_Value::On_got_name_Punctuation(const char * i_sText
)
134 if ( (i_sText
[0] == ',' AND NOT
IsConst())
135 OR (i_sText
[0] == ';' AND
IsConst()) )
137 SetResult(done
,pop_success
);
140 else if (i_sText
[0] == '}' AND NOT
IsConst())
142 SetResult(not_done
,pop_success
);
150 PE_Value::On_got_name_Assignment(const char * i_sText
)
152 *pAssignment
= i_sText
;
153 SetResult(done
,pop_success
);
158 PE_Value::On_Default(SAL_UNUSED_PARAMETER
const char * )
160 SetResult(not_done
,pop_failure
);
166 eState
= expect_name
;
173 PE_Value::TransferData()
175 csv_assert(pName
->length() > 0);
188 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */