org.openoffice.ide.eclipse.core.editors.syntax
Class RegexRule

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

public class RegexRule
extends java.lang.Object
implements org.eclipse.jface.text.rules.IRule

A scanning rule matching a regular expression.

Author:
cedricbosdo

Constructor Summary
RegexRule(java.lang.String pRegex, org.eclipse.jface.text.rules.IToken pToken)
          Constructor, initializing the token to return and the regex to match.
 
Method Summary
 org.eclipse.jface.text.rules.IToken evaluate(org.eclipse.jface.text.rules.ICharacterScanner pScanner)
          
protected  org.eclipse.jface.text.rules.IToken getToken()
           
protected  boolean isEOF(int pChar)
          Convenience method to determine if a character corresponds to an end of file.
protected  boolean isEOL(int pChar)
          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 Detail

RegexRule

public RegexRule(java.lang.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 Detail

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 pChar)
Convenience method to determine if a character corresponds to an end of line.

Parameters:
pChar - the character to check
Returns:
true if the character is an end of line, false otherwise.

isEOF

protected boolean isEOF(int pChar)
Convenience method to determine if a character corresponds to an end of file.

Parameters:
pChar - the character to check
Returns:
true if the character is an end of file, false otherwise.