Bug 436663. Work around ATSUI crasher caused by long Hebrew sequence. r=roc, sr=vlad
[wine-gecko.git] / parser / htmlparser / public / nsITokenizer.h
blobcd9d33f412ed837db23f4057617ec58c6cc48686
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
15 * The Original Code is mozilla.org code.
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998
20 * the Initial Developer. All Rights Reserved.
22 * Contributor(s):
24 * Alternatively, the contents of this file may be used under the terms of
25 * either of the GNU General Public License Version 2 or later (the "GPL"),
26 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
36 * ***** END LICENSE BLOCK ***** */
39 /**
40 * MODULE NOTES:
41 * @update gess 4/1/98
45 #ifndef __NSITOKENIZER__
46 #define __NSITOKENIZER__
48 #include "nsISupports.h"
49 #include "prtypes.h"
51 class CToken;
52 class nsScanner;
53 class nsDeque;
54 class nsTokenAllocator;
56 #define NS_ITOKENIZER_IID \
57 {0xe4238ddc, 0x9eb6, 0x11d2, {0xba, 0xa5, 0x0, 0x10, 0x4b, 0x98, 0x3f, 0xd4 }}
59 /**
60 * This interface is used as a callback to objects interested
61 * in observing the token stream created from the parse process.
63 class nsITokenObserver {
64 public:
65 virtual PRBool operator()(CToken* aToken)=0;
68 /***************************************************************
69 Notes:
70 ***************************************************************/
73 class nsITokenizer : public nsISupports {
74 public:
75 NS_DECLARE_STATIC_IID_ACCESSOR(NS_ITOKENIZER_IID)
77 NS_IMETHOD WillTokenize(PRBool aIsFinalChunk,nsTokenAllocator* aTokenAllocator)=0;
78 NS_IMETHOD ConsumeToken(nsScanner& aScanner,PRBool& aFlushTokens)=0;
79 NS_IMETHOD DidTokenize(PRBool aIsFinalChunk)=0;
81 NS_IMETHOD_(CToken*) PushTokenFront(CToken* aToken)=0;
82 NS_IMETHOD_(CToken*) PushToken(CToken* aToken)=0;
83 NS_IMETHOD_(CToken*) PopToken(void)=0;
84 NS_IMETHOD_(CToken*) PeekToken(void)=0;
85 NS_IMETHOD_(CToken*) GetTokenAt(PRInt32 anIndex)=0;
86 NS_IMETHOD_(PRInt32) GetCount(void)=0;
87 NS_IMETHOD_(nsTokenAllocator*) GetTokenAllocator(void)=0;
88 NS_IMETHOD_(void) PrependTokens(nsDeque& aDeque)=0;
89 NS_IMETHOD CopyState(nsITokenizer* aTokenizer)=0;
93 NS_DEFINE_STATIC_IID_ACCESSOR(nsITokenizer, NS_ITOKENIZER_IID)
95 #define NS_DECL_NSITOKENIZER \
96 NS_IMETHOD WillTokenize(PRBool aIsFinalChunk,nsTokenAllocator* aTokenAllocator);\
97 NS_IMETHOD ConsumeToken(nsScanner& aScanner,PRBool& aFlushTokens);\
98 NS_IMETHOD DidTokenize(PRBool aIsFinalChunk);\
99 NS_IMETHOD_(CToken*) PushTokenFront(CToken* aToken);\
100 NS_IMETHOD_(CToken*) PushToken(CToken* aToken);\
101 NS_IMETHOD_(CToken*) PopToken(void);\
102 NS_IMETHOD_(CToken*) PeekToken(void);\
103 NS_IMETHOD_(CToken*) GetTokenAt(PRInt32 anIndex);\
104 NS_IMETHOD_(PRInt32) GetCount(void);\
105 NS_IMETHOD_(nsTokenAllocator*) GetTokenAllocator(void);\
106 NS_IMETHOD_(void) PrependTokens(nsDeque& aDeque);\
107 NS_IMETHOD CopyState(nsITokenizer* aTokenizer);
110 #endif