1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: sub_peu.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef ADC_CPP_SUB_PEU_HXX
32 #define ADC_CPP_SUB_PEU_HXX
38 #include <semantic/parseenv.hxx>
39 #include <tokens/tokproct.hxx>
42 #include <semantic/sub_pe.hxx>
46 template <class PE
, class SUB
>
47 class SubPeUse
: public SubPeUseIfc
,
48 private TokenProcessing_Types
51 typedef void (PE::*F_INIT
)();
52 typedef void (PE::*F_RETURN
)();
55 SubPe
<PE
,SUB
> & i_rSubPeCreator
,
61 E_TokenDone i_eDone
);
62 virtual void InitParse() const;
63 virtual void GetResults() const;
70 SubPe
<PE
,SUB
> & rSubPeCreator
;
79 template <class PE
, class SUB
>
80 SubPeUse
<PE
,SUB
>::SubPeUse( SubPe
<PE
,SUB
> & i_rSubPeCreator
,
83 : rSubPeCreator(i_rSubPeCreator
),
89 template <class PE
, class SUB
>
90 SubPeUse
<PE
,SUB
>::~SubPeUse()
94 template <class PE
, class SUB
>
96 SubPeUse
<PE
,SUB
>::Push( E_TokenDone i_eDone
)
98 Parent().SetTokenResult( i_eDone
, push
, &rSubPeCreator
.Get() );
99 Parent().SetCurSPU(this);
102 template <class PE
, class SUB
>
104 SubPeUse
<PE
,SUB
>::InitParse() const
110 template <class PE
, class SUB
>
112 SubPeUse
<PE
,SUB
>::GetResults() const
115 (Parent().*fReturn
)();
118 template <class PE
, class SUB
>
120 SubPeUse
<PE
,SUB
>::Parent() const
122 return rSubPeCreator
.Parent();
125 template <class PE
, class SUB
>
127 SubPeUse
<PE
,SUB
>::Child() const
129 return rSubPeCreator
.Child();