1) Moved net.sourceforge.phpeclipse.ui\src\net\sourceforge\phpdt back to net.sourcefo...
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / phpeditor / util / PHPVariableDetector.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  www.phpeclipse.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 PHP aware variable detector (i.e. a PHP identifier starting with a '$'
20  * character).
21  */
22 public class PHPVariableDetector implements IWordDetector {
23
24         /*
25          * (non-Javadoc) Method declared on IWordDetector.
26          */
27         public boolean isWordPart(char character) {
28                 return Scanner.isPHPIdentifierPart(character);
29         }
30
31         /*
32          * (non-Javadoc) Method declared on IWordDetector.
33          */
34         public boolean isWordStart(char character) {
35                 return character == '$';
36         }
37 }