Update ooo320-m1
[ooovba.git] / autodoc / source / parser_i / inc / tokens / tkpcont2.hxx
blob20b6fbd69711b49a345853e16f5726b757713478
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: tkpcont2.hxx,v $
10 * $Revision: 1.4 $
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_TKPCONT2_HXX
32 #define ADC_TKPCONT2_HXX
34 // USED SERVICES
35 // BASE CLASSES
36 // COMPONENTS
37 // PARAMETERS
38 class CharacterSource;
39 class TkpNullContext;
40 class TkpNullContex2;
42 /** @task
43 Specifies a context within which tokens are interpreted in a special
44 way. For example in parsing C++ there could be a context for code,
45 one for comments and a third one for preprocessor statements, because
46 each of these would give the same token different meanings.
47 **/
48 class TkpContext
50 public:
51 // LIFECYCLE
52 virtual ~TkpContext() {}
54 // OPERATIONS
55 /** @descr
56 The functions starts to parse with the CurToken() of io_rText.
57 It leaves io_rText at the first char of the following Token or
58 the following Context.
60 This function returns, when a context has parsed some characterss
61 and completed a token OR left the context.
62 If the token is to be ignored, PassNewToken() returns false
63 and cuts the token from io_rText.
64 If the token is to be parsed further in a different context,
65 PassNewToken() returns false, but the token is
66 NOT cut from io_rText.
68 If the function has found a valid and complete token, PassNewToken()
69 passes the parsed token to the internally known receiver and
70 returns true. The token is cut from io_rText.
71 **/
72 virtual void ReadCharChain(
73 CharacterSource & io_rText ) = 0;
74 /** Has to pass the parsed token to a known receiver.
75 @return true, if a token was passed.
76 false, if no token was parsed complete by this context.
78 virtual bool PassNewToken() = 0;
79 virtual TkpContext &
80 FollowUpContext() = 0;
82 static TkpNullContext &
83 Null_();
86 TkpNullContex2 & TkpContext_Null2_();
88 class StateMachineContext
90 public:
91 virtual ~StateMachineContext() {}
93 /// Is used by StmBoundsStatu2 only.
94 virtual void PerformStatusFunction(
95 uintt i_nStatusSignal,
96 UINT16 i_nTokenId,
97 CharacterSource & io_rText ) = 0;
100 class TkpNullContex2 : public TkpContext
102 public:
103 ~TkpNullContex2();
105 virtual void ReadCharChain(
106 CharacterSource & io_rText );
107 virtual bool PassNewToken();
108 virtual TkpContext &
109 FollowUpContext();
112 class TkpDocuContext : public TkpContext
114 public:
115 virtual void SetParentContext(
116 TkpContext & io_rParentContext,
117 const char * i_sMultiLineEndToken ) = 0;
118 virtual void SetMode_IsMultiLine(
119 bool i_bTrue ) = 0;
124 #endif