Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[pde-dev] Problem using org.eclipse.jface.text.rules package


I am writing a class to parse types (in eiffel) which have the following
In English, all caps starting with a letter and allowing numbers and

I have created an EiffelType Detector as follows:

//import statements and comments here ...public class EiffelTypeDetector
implements IWordDetector {

	 * uppercase letter
	 * @see org.eclipse.jface.text.rules.IWordDetector#isWordStart(char)
	public boolean isWordStart(char c) {
		return Character.isUpperCase(c);

	 * uppercase letter or number
	 * @see org.eclipse.jface.text.rules.IWordDetector#isWordPart(char)
	public boolean isWordPart(char c) {
		return (Character.isUpperCase(c) || Character.isDigit(c) || (c ==


As you can see... it seems pretty trivial, but here's the weird thing...

I have created a class called EiffelCodeScanner which extends
RuleBasedScanner and included the following code in the constructor

WordRule typeRule = new WordRule(new EiffelTypeDetector(), type);


		IRule[] result= new IRule[rules.size()];

Now when I run my editor, it works as expected, except words like
HAPPynewyear have HAPP highlighted which is wrong!

What else do I have to do to ensure that ALL letters of the word must be


Dave Makalsky <dm@xxxxxxxxxxx>

Back to the top