org.gjt.sp.jedit.syntax

## Class TokenMarker

- java.lang.Object
- - org.gjt.sp.jedit.syntax.TokenMarker

-     public class TokenMarker
      extends java.lang.Object

  A token marker splits lines of text into tokens. Each token carries a length field and an identification tag that can be mapped to a color or font style for painting that token.
  See Also:
    `Token`, `TokenHandler`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `TokenMarker.LineContext` Stores persistent per-line syntax parser state.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TokenMarker()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addRuleSet(ParserRuleSet rules)`
    `ParserRuleSet` | `getMainRuleSet()`
    `ParserRuleSet` | `getRuleSet(java.lang.String setName)`
    `ParserRuleSet[]` | `getRuleSets()`
    `TokenMarker.LineContext` | `markTokens(TokenMarker.LineContext prevContext, TokenHandler tokenHandler, javax.swing.text.Segment line)` Do not call this method directly; call Buffer.markTokens() instead.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### TokenMarker

          public TokenMarker()

  - ### Method Detail

    - #### addRuleSet

          public void addRuleSet(ParserRuleSet rules)

    - #### getMainRuleSet

          public ParserRuleSet getMainRuleSet()

    - #### getRuleSet

          public ParserRuleSet getRuleSet(java.lang.String setName)

    - #### getRuleSets

          public ParserRuleSet[] getRuleSets()

      Since:
        jEdit 4.2pre3

    - #### markTokens

          public TokenMarker.LineContext markTokens(TokenMarker.LineContext prevContext,
                                                    TokenHandler tokenHandler,
                                                    javax.swing.text.Segment line)

      Do not call this method directly; call Buffer.markTokens() instead.
      Parameters:
        `prevContext` - the context of the previous line, it can be null
        `tokenHandler` - the token handler
        `line` - a segment containing the content of the line