eada1ba3113ca7aae913c3c2d421cceffb8e7b34
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / phpeditor / util / PHPWordDetector.java
1 /**********************************************************************
2 Copyright (c) 2000, 2002 IBM Corp. and others.
3 All rights reserved. This program and the accompanying materials
4 are made available under the terms of the Common Public License v1.0
5 which accompanies this distribution, and is available at
6 http://www.eclipse.org/legal/cpl-v10.html
7
8 Contributors:
9     IBM Corporation - Initial implementation
10     Klaus Hartlage - www.eclipseproject.de
11 **********************************************************************/
12 package net.sourceforge.phpeclipse.phpeditor.util;
13
14 import net.sourceforge.phpdt.internal.compiler.parser.Scanner;
15
16 import org.eclipse.jface.text.rules.IWordDetector;
17
18 /**
19  * A Java aware word detector.
20  */
21 public class PHPWordDetector implements IWordDetector {
22
23         /* (non-Javadoc)
24          * Method declared on IWordDetector.
25          */
26         public boolean isWordPart(char character) {
27                 return Scanner.isPHPIdentifierPart(character);
28         }
29         
30         /* (non-Javadoc)
31          * Method declared on IWordDetector.
32          */
33         public boolean isWordStart(char character) {
34                 return (character=='$')||Scanner.isPHPIdentifierStart(character);
35         }
36 }