The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.6KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE 6 technical preview.
  4. Copyright (c) 2020 - Raw Material Software Limited
  5. You may use this code under the terms of the GPL v3
  6. (see www.gnu.org/licenses).
  7. For this technical preview, this file is not subject to commercial licensing.
  8. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  9. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  10. DISCLAIMED.
  11. ==============================================================================
  12. */
  13. namespace juce
  14. {
  15. //==============================================================================
  16. /**
  17. A base class for tokenising code so that the syntax can be displayed in a
  18. code editor.
  19. @see CodeDocument, CodeEditorComponent
  20. @tags{GUI}
  21. */
  22. class JUCE_API CodeTokeniser
  23. {
  24. public:
  25. CodeTokeniser() = default;
  26. virtual ~CodeTokeniser() = default;
  27. //==============================================================================
  28. /** Reads the next token from the source and returns its token type.
  29. This must leave the source pointing to the first character in the
  30. next token.
  31. */
  32. virtual int readNextToken (CodeDocument::Iterator& source) = 0;
  33. /** Returns a suggested syntax highlighting colour scheme. */
  34. virtual CodeEditorComponent::ColourScheme getDefaultColourScheme() = 0;
  35. private:
  36. JUCE_LEAK_DETECTOR (CodeTokeniser)
  37. };
  38. } // namespace juce