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
A scanning rule matching a regular expression.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.eclipse.jface.text.rules.ITokenevaluate(org.eclipse.jface.text.rules.ICharacterScanner pScanner) protected org.eclipse.jface.text.rules.ITokengetToken()protected booleanisEOF(int ch) Convenience method to determine if a character corresponds to an end of file.protected booleanisEOL(int ch) Convenience method to determine if a character corresponds to an end of line.
-
Constructor Details
-
RegexRule
Constructor, initializing the token to return and the regex to match.- Parameters:
pRegex- the regular expression to matchpToken- the token to associate
-
-
Method Details
-
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 ch) Convenience method to determine if a character corresponds to an end of line.- Parameters:
ch- the character to check- Returns:
trueif the character is an end of line,falseotherwise.
-
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:
trueif the character is an end of file,falseotherwise.
-