Class RegexRule
- 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 java.lang.Object implements org.eclipse.jface.text.rules.IRuleA scanning rule matching a regular expression.
-
-
Constructor Summary
Constructors Constructor Description 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.eclipse.jface.text.rules.ITokenevaluate(org.eclipse.jface.text.rules.ICharacterScanner pScanner)protected org.eclipse.jface.text.rules.ITokengetToken()protected booleanisEOF(int pChar)Convenience method to determine if a character corresponds to an end of file.protected booleanisEOL(int pChar)Convenience method to determine if a character corresponds to an end of line.
-
-
-
Method Detail
-
evaluate
public org.eclipse.jface.text.rules.IToken evaluate(org.eclipse.jface.text.rules.ICharacterScanner pScanner)
- Specified by:
evaluatein interfaceorg.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:
trueif the character is an end of line,falseotherwise.
-
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:
trueif the character is an end of file,falseotherwise.
-
-