org.gjt.sp.jedit.syntax

## Class ParserRule

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

-     public class ParserRule
      extends java.lang.Object

  A parser rule.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `int` | `action`
    `static int` | `ACTION_HINTS`
    `static int` | `AT_LINE_START`
    `static int` | `AT_WHITESPACE_END`
    `static int` | `AT_WORD_START`
    `ParserRuleSet` | `delegate`
    `char[]` | `end`
    `static int` | `END_REGEXP`
    `int` | `endPosMatch`
    `java.util.regex.Pattern` | `endRegexp`
    `static int` | `EOL_SPAN`
    `ParserRule` | `escapeRule` escapeRule is the rule-specific sequence used to escape other characters while the rule is in effect.
    `static int` | `IS_ESCAPE`
    `static int` | `MAJOR_ACTIONS`
    `static int` | `MARK_FOLLOWING`
    `static int` | `MARK_PREVIOUS`
    `static byte` | `MATCH_TYPE_CONTEXT`
    `static byte` | `MATCH_TYPE_RULE`
    `byte` | `matchType` matchType is the type of the token for the matched region.
    `static int` | `NO_LINE_BREAK`
    `static int` | `NO_WORD_BREAK`
    `static int` | `REGEXP`
    `static int` | `SEQ`
    `static int` | `SPAN`
    `char[]` | `start`
    `int` | `startPosMatch`
    `java.util.regex.Pattern` | `startRegexp`
    `byte` | `token`
    `char[]` | `upHashChar` The upHashChar should be a String but it is stored in an array making iterations much faster
    `char[]` | `upHashChars`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static ParserRule` | `createEOLSpanRule(int posMatch, java.lang.String seq, ParserRuleSet delegate, byte id, byte matchType)`
    `static ParserRule` | `createEscapeRule(java.lang.String seq)`
    `static ParserRule` | `createMarkFollowingRule(int posMatch, java.lang.String seq, byte id, byte matchType)`
    `static ParserRule` | `createMarkPreviousRule(int posMatch, java.lang.String seq, byte id, byte matchType)`
    `static ParserRule` | `createRegexpEOLSpanRule(int posMatch, char[] hashChars, java.lang.String seq, ParserRuleSet delegate, byte id, byte matchType, boolean ignoreCase)`
    `static ParserRule` | `createRegexpEOLSpanRule(java.lang.String hashChar, int posMatch, java.lang.String seq, ParserRuleSet delegate, byte id, byte matchType, boolean ignoreCase)`
    `static ParserRule` | `createRegexpSequenceRule(int posMatch, char[] hashChars, java.lang.String seq, ParserRuleSet delegate, byte id, boolean ignoreCase)`
    `static ParserRule` | `createRegexpSequenceRule(java.lang.String hashChar, int posMatch, java.lang.String seq, ParserRuleSet delegate, byte id, boolean ignoreCase)`
    `static ParserRule` | `createRegexpSpanRule(int startPosMatch, char[] hashChars, java.lang.String start, int endPosMatch, java.lang.String end, ParserRuleSet delegate, byte id, byte matchType, boolean noLineBreak, boolean noWordBreak, boolean ignoreCase, java.lang.String escape, boolean endRegexp)`
    `static ParserRule` | `createRegexpSpanRule(java.lang.String hashChar, int startPosMatch, java.lang.String start, int endPosMatch, java.lang.String end, ParserRuleSet delegate, byte id, byte matchType, boolean noLineBreak, boolean noWordBreak, boolean ignoreCase, java.lang.String escape, boolean endRegexp)`
    `static ParserRule` | `createSequenceRule(int posMatch, java.lang.String seq, ParserRuleSet delegate, byte id)`
    `static ParserRule` | `createSpanRule(int startPosMatch, java.lang.String start, int endPosMatch, java.lang.String end, ParserRuleSet delegate, byte id, byte matchType, boolean noLineBreak, boolean noWordBreak, java.lang.String escape)`
    `java.lang.String` | `toString()`

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

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

- - ### Field Detail

    - #### MAJOR_ACTIONS

          public static final int MAJOR_ACTIONS

      See Also:
        Constant Field Values

    - #### SEQ

          public static final int SEQ

      See Also:
        Constant Field Values

    - #### SPAN

          public static final int SPAN

      See Also:
        Constant Field Values

    - #### MARK_PREVIOUS

          public static final int MARK_PREVIOUS

      See Also:
        Constant Field Values

    - #### MARK_FOLLOWING

          public static final int MARK_FOLLOWING

      See Also:
        Constant Field Values

    - #### EOL_SPAN

          public static final int EOL_SPAN

      See Also:
        Constant Field Values

    - #### ACTION_HINTS

          public static final int ACTION_HINTS

      See Also:
        Constant Field Values

    - #### NO_LINE_BREAK

          public static final int NO_LINE_BREAK

      See Also:
        Constant Field Values

    - #### NO_WORD_BREAK

          public static final int NO_WORD_BREAK

      See Also:
        Constant Field Values

    - #### IS_ESCAPE

          public static final int IS_ESCAPE

      See Also:
        Constant Field Values

    - #### REGEXP

          public static final int REGEXP

      See Also:
        Constant Field Values

    - #### END_REGEXP

          public static final int END_REGEXP

      See Also:
        Constant Field Values

    - #### MATCH_TYPE_CONTEXT

          public static final byte MATCH_TYPE_CONTEXT

      See Also:
        Constant Field Values

    - #### MATCH_TYPE_RULE

          public static final byte MATCH_TYPE_RULE

      See Also:
        Constant Field Values

    - #### AT_LINE_START

          public static final int AT_LINE_START

      See Also:
        Constant Field Values

    - #### AT_WHITESPACE_END

          public static final int AT_WHITESPACE_END

      See Also:
        Constant Field Values

    - #### AT_WORD_START

          public static final int AT_WORD_START

      See Also:
        Constant Field Values

    - #### upHashChar

          public final char[] upHashChar

      The upHashChar should be a String but it is stored in an array making iterations much faster

    - #### upHashChars

          public final char[] upHashChars

    - #### startPosMatch

          public final int startPosMatch

    - #### start

          public final char[] start

    - #### startRegexp

          public final java.util.regex.Pattern startRegexp

    - #### endPosMatch

          public final int endPosMatch

    - #### end

          public final char[] end

    - #### endRegexp

          public final java.util.regex.Pattern endRegexp

    - #### action

          public final int action

    - #### token

          public final byte token

    - #### matchType

          public final byte matchType

      matchType is the type of the token for the matched region. Special values are: MATCH_TYPE_CONTEXT = default token for the context, MATCH_TYPE_RULE = same token as the rule itself.
      Since:
        jEdit 4.3pre10

    - #### escapeRule

          public final ParserRule escapeRule

      escapeRule is the rule-specific sequence used to escape other characters while the rule is in effect. If this character is non-zero, the character following the escape char will be skipped during parsing, and highlighted with the rule's token.
      Since:
        jEdit 4.3pre12

    - #### delegate

          public ParserRuleSet delegate

  - ### Method Detail

    - #### createSequenceRule

          public static ParserRule createSequenceRule(int posMatch,
                                      java.lang.String seq,
                                      ParserRuleSet delegate,
                                      byte id)

    - #### createRegexpSequenceRule

          public static ParserRule createRegexpSequenceRule(java.lang.String hashChar,
                                            int posMatch,
                                            java.lang.String seq,
                                            ParserRuleSet delegate,
                                            byte id,
                                            boolean ignoreCase)
                                                     throws java.util.regex.PatternSyntaxException

      Throws:
        `java.util.regex.PatternSyntaxException`

    - #### createRegexpSequenceRule

          public static ParserRule createRegexpSequenceRule(int posMatch,
                                            char[] hashChars,
                                            java.lang.String seq,
                                            ParserRuleSet delegate,
                                            byte id,
                                            boolean ignoreCase)
                                                     throws java.util.regex.PatternSyntaxException

      Throws:
        `java.util.regex.PatternSyntaxException`

    - #### createSpanRule

          public static ParserRule createSpanRule(int startPosMatch,
                                  java.lang.String start,
                                  int endPosMatch,
                                  java.lang.String end,
                                  ParserRuleSet delegate,
                                  byte id,
                                  byte matchType,
                                  boolean noLineBreak,
                                  boolean noWordBreak,
                                  java.lang.String escape)

    - #### createRegexpSpanRule

          public static ParserRule createRegexpSpanRule(java.lang.String hashChar,
                                        int startPosMatch,
                                        java.lang.String start,
                                        int endPosMatch,
                                        java.lang.String end,
                                        ParserRuleSet delegate,
                                        byte id,
                                        byte matchType,
                                        boolean noLineBreak,
                                        boolean noWordBreak,
                                        boolean ignoreCase,
                                        java.lang.String escape,
                                        boolean endRegexp)
                                                 throws java.util.regex.PatternSyntaxException

      Throws:
        `java.util.regex.PatternSyntaxException`

    - #### createRegexpSpanRule

          public static ParserRule createRegexpSpanRule(int startPosMatch,
                                        char[] hashChars,
                                        java.lang.String start,
                                        int endPosMatch,
                                        java.lang.String end,
                                        ParserRuleSet delegate,
                                        byte id,
                                        byte matchType,
                                        boolean noLineBreak,
                                        boolean noWordBreak,
                                        boolean ignoreCase,
                                        java.lang.String escape,
                                        boolean endRegexp)
                                                 throws java.util.regex.PatternSyntaxException

      Throws:
        `java.util.regex.PatternSyntaxException`

    - #### createEOLSpanRule

          public static ParserRule createEOLSpanRule(int posMatch,
                                     java.lang.String seq,
                                     ParserRuleSet delegate,
                                     byte id,
                                     byte matchType)

    - #### createRegexpEOLSpanRule

          public static ParserRule createRegexpEOLSpanRule(java.lang.String hashChar,
                                           int posMatch,
                                           java.lang.String seq,
                                           ParserRuleSet delegate,
                                           byte id,
                                           byte matchType,
                                           boolean ignoreCase)
                                                    throws java.util.regex.PatternSyntaxException

      Throws:
        `java.util.regex.PatternSyntaxException`

    - #### createRegexpEOLSpanRule

          public static ParserRule createRegexpEOLSpanRule(int posMatch,
                                           char[] hashChars,
                                           java.lang.String seq,
                                           ParserRuleSet delegate,
                                           byte id,
                                           byte matchType,
                                           boolean ignoreCase)
                                                    throws java.util.regex.PatternSyntaxException

      Throws:
        `java.util.regex.PatternSyntaxException`

    - #### createMarkFollowingRule

          public static ParserRule createMarkFollowingRule(int posMatch,
                                           java.lang.String seq,
                                           byte id,
                                           byte matchType)

    - #### createMarkPreviousRule

          public static ParserRule createMarkPreviousRule(int posMatch,
                                          java.lang.String seq,
                                          byte id,
                                          byte matchType)

    - #### createEscapeRule

          public static ParserRule createEscapeRule(java.lang.String seq)

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`