PageRenderTime 38ms CodeModel.GetById 11ms RepoModel.GetById 0ms app.codeStats 1ms

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

#
Java | 58 lines | 8 code | 4 blank | 46 comment | 0 complexity | 7995a0af2a0478f89d523363b4e0fd5a 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. * TokenHandler.java - Token markers send tokens to implementations of
  3. * this class
  4. * :tabSize=8:indentSize=8:noTabs=false:
  5. * :folding=explicit:collapseFolds=1:
  6. *
  7. * Copyright (C) 2002 Slava Pestov
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License
  11. * as published by the Free Software Foundation; either version 2
  12. * of the License, or any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  22. */
  23. package org.gjt.sp.jedit.syntax;
  24. import javax.swing.text.Segment;
  25. /**
  26. * Token markers send tokens to implementations of this interface.
  27. *
  28. * @author Slava Pestov
  29. * @version $Id: TokenHandler.java 4902 2003-10-26 19:43:58Z spestov $
  30. * @since jEdit 4.1pre1
  31. */
  32. public interface TokenHandler
  33. {
  34. /**
  35. * Called by the token marker when a syntax token has been parsed.
  36. * @param seg The segment containing the text
  37. * @param id The token type (one of the constants in the
  38. * {@link Token} class).
  39. * @param offset The start offset of the token
  40. * @param length The number of characters in the token
  41. * @param context The line context
  42. * @since jEdit 4.2pre3
  43. */
  44. public void handleToken(Segment seg, byte id, int offset, int length,
  45. TokenMarker.LineContext context);
  46. /**
  47. * The token handler can compare this object with the object
  48. * previously given for this line to see if the token type at the end
  49. * of the line has changed (meaning subsequent lines might need to be
  50. * retokenized).
  51. * @since jEdit 4.2pre6
  52. */
  53. public void setLineContext(TokenMarker.LineContext lineContext);
  54. }