PageRenderTime 49ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/jEdit/tags/jedit-4-2-pre14/org/gjt/sp/jedit/syntax/DummyTokenHandler.java

#
Java | 68 lines | 11 code | 5 blank | 52 comment | 0 complexity | 4a50a3b22fb9f9a0a00fa821bddab326 MD5 | raw file
Possible License(s): BSD-3-Clause, AGPL-1.0, Apache-2.0, LGPL-2.0, LGPL-3.0, GPL-2.0, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, MPL-2.0-no-copyleft-exception, IPL-1.0
  1. /*
  2. * DummyTokenHandler.java - Ignores tokens
  3. * :tabSize=8:indentSize=8:noTabs=false:
  4. * :folding=explicit:collapseFolds=1:
  5. *
  6. * Copyright (C) 2002 Slava Pestov
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * 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. package org.gjt.sp.jedit.syntax;
  23. import javax.swing.text.Segment;
  24. /**
  25. * A dummy token handler that discards tokens.
  26. *
  27. * @author Slava Pestov
  28. * @version $Id: DummyTokenHandler.java 4902 2003-10-26 19:43:58Z spestov $
  29. * @since jEdit 4.1pre1
  30. */
  31. public class DummyTokenHandler implements TokenHandler
  32. {
  33. /**
  34. * To avoid having to create new instances of this class, use
  35. * this variable. This is allowed because instances of this
  36. * class do not store any state.
  37. */
  38. public static final DummyTokenHandler INSTANCE = new DummyTokenHandler();
  39. //{{{ handleToken() method
  40. /**
  41. * Called by the token marker when a syntax token has been parsed.
  42. * @param seg The segment containing the text
  43. * @param id The token type (one of the constants in the
  44. * {@link Token} class).
  45. * @param offset The start offset of the token
  46. * @param length The number of characters in the token
  47. * @param context The line context
  48. * @since jEdit 4.2pre3
  49. */
  50. public void handleToken(Segment seg, byte id, int offset, int length,
  51. TokenMarker.LineContext context) {} //}}}
  52. //{{{ setLineContext() method
  53. /**
  54. * The token handler can compare this object with the object
  55. * previously given for this line to see if the token type at the end
  56. * of the line has changed (meaning subsequent lines might need to be
  57. * retokenized).
  58. * @since jEdit 4.2pre6
  59. */
  60. public void setLineContext(TokenMarker.LineContext lineContext)
  61. {
  62. } //}}}
  63. }