java.lang.Object
org.libreoffice.ide.eclipse.core.editors.syntax.RegexRule
All Implemented Interfaces:
org.eclipse.jface.text.rules.IRule
Direct Known Subclasses:
EqualityNameRule

public class RegexRule extends Object implements org.eclipse.jface.text.rules.IRule
A scanning rule matching a regular expression.
  • Constructor Summary

    Constructors
    Constructor
    Description
    RegexRule(String pRegex, org.eclipse.jface.text.rules.IToken pToken)
    Constructor, initializing the token to return and the regex to match.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.eclipse.jface.text.rules.IToken
    evaluate(org.eclipse.jface.text.rules.ICharacterScanner pScanner)
    protected org.eclipse.jface.text.rules.IToken
     
    protected boolean
    isEOF(int ch)
    Convenience method to determine if a character corresponds to an end of file.
    protected boolean
    isEOL(int ch)
    Convenience method to determine if a character corresponds to an end of line.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RegexRule

      public RegexRule(String pRegex, org.eclipse.jface.text.rules.IToken pToken)
      Constructor, initializing the token to return and the regex to match.
      Parameters:
      pRegex - the regular expression to match
      pToken - the token to associate
  • Method Details

    • evaluate

      public org.eclipse.jface.text.rules.IToken evaluate(org.eclipse.jface.text.rules.ICharacterScanner pScanner)
      Specified by:
      evaluate in interface org.eclipse.jface.text.rules.IRule
    • getToken

      protected org.eclipse.jface.text.rules.IToken getToken()
      Returns:
      the associated token.
    • isEOL

      protected boolean isEOL(int ch)
      Convenience method to determine if a character corresponds to an end of line.
      Parameters:
      ch - the character to check
      Returns:
      true if the character is an end of line, false otherwise.
    • isEOF

      protected boolean isEOF(int ch)
      Convenience method to determine if a character corresponds to an end of file.
      Parameters:
      ch - the character to check
      Returns:
      true if the character is an end of file, false otherwise.