Class ParserRule


  • public class ParserRule
    extends java.lang.Object
    A parser rule.
    • Field Detail

      • 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
    • 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