01: /*
02: * DummyTokenHandler.java - Ignores tokens
03: * :tabSize=8:indentSize=8:noTabs=false:
04: * :folding=explicit:collapseFolds=1:
05: *
06: * Copyright (C) 2002 Slava Pestov
07: *
08: * This program is free software; you can redistribute it and/or
09: * modify it under the terms of the GNU General Public License
10: * as published by the Free Software Foundation; either version 2
11: * of the License, or any later version.
12: *
13: * This program is distributed in the hope that it will be useful,
14: * but WITHOUT ANY WARRANTY; without even the implied warranty of
15: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16: * GNU General Public License for more details.
17: *
18: * You should have received a copy of the GNU General Public License
19: * along with this program; if not, write to the Free Software
20: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21: */
22:
23: package org.gjt.sp.jedit.syntax;
24:
25: import javax.swing.text.Segment;
26:
27: /**
28: * A dummy token handler that discards tokens.
29: *
30: * @author Slava Pestov
31: * @version $Id: DummyTokenHandler.java 4902 2003-10-26 19:43:58Z spestov $
32: * @since jEdit 4.1pre1
33: */
34: public class DummyTokenHandler implements TokenHandler {
35: /**
36: * To avoid having to create new instances of this class, use
37: * this variable. This is allowed because instances of this
38: * class do not store any state.
39: */
40: public static final DummyTokenHandler INSTANCE = new DummyTokenHandler();
41:
42: //{{{ handleToken() method
43: /**
44: * Called by the token marker when a syntax token has been parsed.
45: * @param seg The segment containing the text
46: * @param id The token type (one of the constants in the
47: * {@link Token} class).
48: * @param offset The start offset of the token
49: * @param length The number of characters in the token
50: * @param context The line context
51: * @since jEdit 4.2pre3
52: */
53: public void handleToken(Segment seg, byte id, int offset,
54: int length, TokenMarker.LineContext context) {
55: } //}}}
56:
57: //{{{ setLineContext() method
58: /**
59: * The token handler can compare this object with the object
60: * previously given for this line to see if the token type at the end
61: * of the line has changed (meaning subsequent lines might need to be
62: * retokenized).
63: * @since jEdit 4.2pre6
64: */
65: public void setLineContext(TokenMarker.LineContext lineContext) {
66: } //}}}
67: }
|