Added: PreferencePage; External Browser startup; extended syntax highlighting
authorkhartlage <khartlage>
Sat, 12 Oct 2002 17:00:48 +0000 (17:00 +0000)
committerkhartlage <khartlage>
Sat, 12 Oct 2002 17:00:48 +0000 (17:00 +0000)
29 files changed:
net.sourceforge.phpeclipse/.classpath
net.sourceforge.phpeclipse/icons/obj16/java.gif [new file with mode: 0644]
net.sourceforge.phpeclipse/plugin.properties [new file with mode: 0644]
net.sourceforge.phpeclipse/plugin.xml
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPEclipsePreferencePage.java [new file with mode: 0644]
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPeclipsePlugin.java
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPEclipseShowAction.java [new file with mode: 0644]
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPEclipseShowContextHelp.java [new file with mode: 0644]
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPActionContributor.java [new file with mode: 0644]
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPAnnotationHover.java [new file with mode: 0644]
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPContentOutlinePage.java [new file with mode: 0644]
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPDocumentProvider.java [new file with mode: 0644]
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPEditor.java [new file with mode: 0644]
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPEditorEnvironment.java [new file with mode: 0644]
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPEditorMessages.java [new file with mode: 0644]
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPEditorMessages.properties [new file with mode: 0644]
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPSourceViewerConfiguration.java [new file with mode: 0644]
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPTextHover.java [new file with mode: 0644]
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PresentationAction.java [new file with mode: 0644]
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPAutoIndentStrategy.java [new file with mode: 0644]
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPCodeScanner.java [new file with mode: 0644]
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPCompletionProcessor.java [new file with mode: 0644]
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPDoubleClickSelector.java [new file with mode: 0644]
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPEditorMessages.java [new file with mode: 0644]
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPPartitionScanner.java [new file with mode: 0644]
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPWordDetector.java [new file with mode: 0644]
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/util/PHPColorProvider.java [new file with mode: 0644]
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/util/PHPWhitespaceDetector.java [new file with mode: 0644]
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/util/PHPWordDetector.java [new file with mode: 0644]

index a2d12a9..b0ab4bd 100644 (file)
     <classpathentry kind="var"
         path="ECLIPSE_HOME/plugins/org.eclipse.swt.win32_2.0.0/ws/win32/swt.jar" sourcepath="_ORG_ECLIPSE_PLATFORM_WIN32_SOURCE/org.eclipse.swt.win32_2.0.0/ws/win32/swtsrc.zip"/>
     <classpathentry kind="var"
-        path="ECLIPSE_HOME/plugins/org.eclipse.compare_2.0.0/compare.jar" sourcepath="_ORG_ECLIPSE_PLATFORM_SOURCE/org.eclipse.compare_2.0.0/comparesrc.zip"/>
-    <classpathentry kind="var"
-        path="ECLIPSE_HOME/plugins/org.eclipse.core.boot_2.0.0/boot.jar" sourcepath="_ORG_ECLIPSE_PLATFORM_SOURCE/org.eclipse.core.boot_2.0.0/bootsrc.zip"/>
-    <classpathentry kind="var"
         path="ECLIPSE_HOME/plugins/org.eclipse.core.runtime_2.0.0/runtime.jar" sourcepath="_ORG_ECLIPSE_PLATFORM_SOURCE/org.eclipse.core.runtime_2.0.0/runtimesrc.zip"/>
     <classpathentry kind="var"
-        path="ECLIPSE_HOME/plugins/org.eclipse.team.cvs.ssh_2.0.0/teamcvsssh.jar" sourcepath="_ORG_ECLIPSE_PLATFORM_SOURCE/org.eclipse.team.cvs.ssh_2.0.0/teamcvssshsrc.zip"/>
-    <classpathentry kind="var"
-        path="ECLIPSE_HOME/plugins/org.eclipse.team.cvs.core_2.0.0/cvs.jar" sourcepath="_ORG_ECLIPSE_PLATFORM_SOURCE/org.eclipse.team.cvs.core_2.0.0/cvssrc.zip"/>
-    <classpathentry kind="var"
-        path="ECLIPSE_HOME/plugins/org.eclipse.team.cvs.ui_2.0.0/teamcvsui.jar" sourcepath="_ORG_ECLIPSE_PLATFORM_SOURCE/org.eclipse.team.cvs.ui_2.0.0/teamcvsuisrc.zip"/>
-    <classpathentry kind="var"
-        path="ECLIPSE_HOME/plugins/org.eclipse.debug.core_2.0.0/dtcore.jar" sourcepath="_ORG_ECLIPSE_PLATFORM_SOURCE/org.eclipse.debug.core_2.0.0/dtcoresrc.zip"/>
-    <classpathentry kind="var"
-        path="ECLIPSE_HOME/plugins/org.eclipse.debug.ui_2.0.0/dtui.jar" sourcepath="_ORG_ECLIPSE_PLATFORM_SOURCE/org.eclipse.debug.ui_2.0.0/dtuisrc.zip"/>
-    <classpathentry kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.platform.doc.isv_2.0.0/activeHelpSample.jar"/>
-    <classpathentry kind="var"
-        path="ECLIPSE_HOME/plugins/org.eclipse.tomcat_4.0.3/tomcatwrapper.jar" sourcepath="_ORG_ECLIPSE_PLATFORM_SOURCE/org.eclipse.tomcat_4.0.3/tomcatwrappersrc.zip"/>
-    <classpathentry kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.tomcat_4.0.3/catalina.jar"/>
-    <classpathentry kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.tomcat_4.0.3/bootstrap.jar"/>
-    <classpathentry kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.tomcat_4.0.3/jakarta-regexp-1.2.jar"/>
-    <classpathentry kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.tomcat_4.0.3/jasper-compiler.jar"/>
-    <classpathentry kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.tomcat_4.0.3/jasper-runtime.jar"/>
-    <classpathentry kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.tomcat_4.0.3/naming-factory.jar"/>
-    <classpathentry kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.tomcat_4.0.3/naming-common.jar"/>
-    <classpathentry kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.tomcat_4.0.3/naming-resources.jar"/>
-    <classpathentry kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.tomcat_4.0.3/servlet.jar"/>
-    <classpathentry kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.tomcat_4.0.3/servlets-common.jar"/>
-    <classpathentry kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.tomcat_4.0.3/servlets-default.jar"/>
-    <classpathentry kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.tomcat_4.0.3/servlets-invoker.jar"/>
-    <classpathentry kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.tomcat_4.0.3/servlets-manager.jar"/>
-    <classpathentry kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.tomcat_4.0.3/servlets-snoop.jar"/>
-    <classpathentry kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.tomcat_4.0.3/servlets-webdav.jar"/>
-    <classpathentry kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.tomcat_4.0.3/tomcat-util.jar"/>
-    <classpathentry kind="var"
-        path="ECLIPSE_HOME/plugins/org.eclipse.team.ui_2.0.0/teamui.jar" sourcepath="_ORG_ECLIPSE_PLATFORM_SOURCE/org.eclipse.team.ui_2.0.0/teamuisrc.zip"/>
-    <classpathentry kind="var"
-        path="ECLIPSE_HOME/plugins/org.eclipse.team.core_2.0.0/team.jar" sourcepath="_ORG_ECLIPSE_PLATFORM_SOURCE/org.eclipse.team.core_2.0.0/teamsrc.zip"/>
-    <classpathentry kind="var"
-        path="ECLIPSE_HOME/plugins/org.eclipse.jdt.ui_2.0.0/jdt.jar" sourcepath="_ORG_ECLIPSE_JDT_SOURCE/org.eclipse.jdt.ui_2.0.0/jdtsrc.zip"/>
-    <classpathentry kind="var"
-        path="ECLIPSE_HOME/plugins/org.eclipse.jdt.debug_2.0.0/jdi.jar" sourcepath="_ORG_ECLIPSE_JDT_SOURCE/org.eclipse.jdt.debug_2.0.0/jdisrc.zip"/>
-    <classpathentry kind="var"
-        path="ECLIPSE_HOME/plugins/org.eclipse.jdt.debug_2.0.0/jdimodel.jar" sourcepath="_ORG_ECLIPSE_JDT_SOURCE/org.eclipse.jdt.debug_2.0.0/jdimodelsrc.zip"/>
-    <classpathentry kind="var"
-        path="ECLIPSE_HOME/plugins/org.eclipse.search_2.0.0/search.jar" sourcepath="_ORG_ECLIPSE_PLATFORM_SOURCE/org.eclipse.search_2.0.0/searchsrc.zip"/>
-    <classpathentry kind="var"
-        path="ECLIPSE_HOME/plugins/org.eclipse.pde.runtime_2.0.0/pdert.jar" sourcepath="_ORG_ECLIPSE_PDE_SOURCE/org.eclipse.pde.runtime_2.0.0/pdertsrc.zip"/>
-    <classpathentry kind="var"
-        path="ECLIPSE_HOME/plugins/org.eclipse.pde.ui_2.0.0/pdeui.jar" sourcepath="_ORG_ECLIPSE_PDE_SOURCE/org.eclipse.pde.ui_2.0.0/pdeuisrc.zip"/>
-    <classpathentry kind="var"
-        path="ECLIPSE_HOME/plugins/org.junit_3.7.0/junit.jar" sourcepath="_ORG_ECLIPSE_JDT_SOURCE/org.junit_3.7.0/junitsrc.zip"/>
-    <classpathentry kind="var"
-        path="ECLIPSE_HOME/plugins/org.eclipse.jdt.debug.ui_2.0.0/jdiui.jar" sourcepath="_ORG_ECLIPSE_JDT_SOURCE/org.eclipse.jdt.debug.ui_2.0.0/jdiuisrc.zip"/>
-    <classpathentry kind="var"
-        path="ECLIPSE_HOME/plugins/org.eclipse.pde.core_2.0.0/pdecore.jar" sourcepath="_ORG_ECLIPSE_PDE_SOURCE/org.eclipse.pde.core_2.0.0/pdecoresrc.zip"/>
-    <classpathentry kind="var"
-        path="ECLIPSE_HOME/plugins/org.eclipse.pde.build_2.0.0/pdebuild.jar" sourcepath="_ORG_ECLIPSE_PDE_SOURCE/org.eclipse.pde.build_2.0.0/pdebuildsrc.zip"/>
-    <classpathentry kind="var"
-        path="ECLIPSE_HOME/plugins/org.eclipse.pde_2.0.0/pde.jar" sourcepath="_ORG_ECLIPSE_PDE_SOURCE/org.eclipse.pde_2.0.0/pdesrc.zip"/>
-    <classpathentry kind="var"
-        path="ECLIPSE_HOME/plugins/org.eclipse.ui.externaltools_2.0.0/externaltools.jar" sourcepath="_ORG_ECLIPSE_PLATFORM_SOURCE/org.eclipse.ui.externaltools_2.0.0/externaltoolssrc.zip"/>
-    <classpathentry kind="var"
-        path="ECLIPSE_HOME/plugins/org.eclipse.help_2.0.0/help.jar" sourcepath="_ORG_ECLIPSE_PLATFORM_SOURCE/org.eclipse.help_2.0.0/helpsrc.zip"/>
-    <classpathentry kind="var"
-        path="ECLIPSE_HOME/plugins/org.eclipse.help.ui_2.0.0/helpworkbench.jar" sourcepath="_ORG_ECLIPSE_PLATFORM_SOURCE/org.eclipse.help.ui_2.0.0/helpworkbenchsrc.zip"/>
-    <classpathentry kind="var"
-        path="ECLIPSE_HOME/plugins/org.eclipse.help.ui.win32_2.0.0/helpworkbenchwin32.jar" sourcepath="_ORG_ECLIPSE_PLATFORM_WIN32_SOURCE/org.eclipse.help.ui.win32_2.0.0/helpworkbenchwin32src.zip"/>
-    <classpathentry kind="var"
-        path="ECLIPSE_HOME/plugins/org.eclipse.update.ui.forms_2.0.0/forms.jar" sourcepath="_ORG_ECLIPSE_PLATFORM_SOURCE/org.eclipse.update.ui.forms_2.0.0/formssrc.zip"/>
-    <classpathentry kind="var"
-        path="ECLIPSE_HOME/plugins/org.eclipse.update.core_2.0.0/updatecore.jar" sourcepath="_ORG_ECLIPSE_PLATFORM_SOURCE/org.eclipse.update.core_2.0.0/updatecoresrc.zip"/>
-    <classpathentry kind="var"
-        path="ECLIPSE_HOME/plugins/org.eclipse.update.ui_2.0.0/updateui.jar" sourcepath="_ORG_ECLIPSE_PLATFORM_SOURCE/org.eclipse.update.ui_2.0.0/updateuisrc.zip"/>
-    <classpathentry kind="var"
-        path="ECLIPSE_HOME/plugins/org.eclipse.update.ui.win32_2.0.0/updateui32.jar" sourcepath="_ORG_ECLIPSE_PLATFORM_WIN32_SOURCE/org.eclipse.update.ui.win32_2.0.0/updateui32src.zip"/>
-    <classpathentry kind="var"
-        path="ECLIPSE_HOME/plugins/org.eclipse.jdt.core_2.0.0/jdtcore.jar" sourcepath="_ORG_ECLIPSE_JDT_SOURCE/org.eclipse.jdt.core_2.0.0/jdtcoresrc.zip"/>
-    <classpathentry kind="var"
-        path="ECLIPSE_HOME/plugins/org.eclipse.jdt.junit_2.0.0/junitsupport.jar" sourcepath="_ORG_ECLIPSE_JDT_SOURCE/org.eclipse.jdt.junit_2.0.0/junitsupportsrc.zip"/>
-    <classpathentry kind="var"
-        path="ECLIPSE_HOME/plugins/org.eclipse.jdt.launching_2.0.0/launching.jar" sourcepath="_ORG_ECLIPSE_JDT_SOURCE/org.eclipse.jdt.launching_2.0.0/launchingsrc.zip"/>
+        path="ECLIPSE_HOME/plugins/org.eclipse.core.boot_2.0.0/boot.jar" sourcepath="_ORG_ECLIPSE_PLATFORM_SOURCE/org.eclipse.core.boot_2.0.0/bootsrc.zip"/>
     <classpathentry kind="var" path="JRE_LIB" rootpath="JRE_SRCROOT" sourcepath="JRE_SRC"/>
+    <classpathentry kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.jdt.ui_2.0.0/jdt.jar"/>
     <classpathentry kind="output" path="bin"/>
 </classpath>
diff --git a/net.sourceforge.phpeclipse/icons/obj16/java.gif b/net.sourceforge.phpeclipse/icons/obj16/java.gif
new file mode 100644 (file)
index 0000000..83de817
Binary files /dev/null and b/net.sourceforge.phpeclipse/icons/obj16/java.gif differ
diff --git a/net.sourceforge.phpeclipse/plugin.properties b/net.sourceforge.phpeclipse/plugin.properties
new file mode 100644 (file)
index 0000000..708b293
--- /dev/null
@@ -0,0 +1,11 @@
+#########################################
+#
+#########################################
+pluginName=PHP Plugin
+providerName = EclipseProject.de
+
+#
+# Extension point names
+#
+phpEditorName=Example Java Editor
+phpFileExtension=php
index 388930e..dc2699f 100644 (file)
@@ -1,10 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <plugin
    id="PHPEclipse"
-   name="Plug-in PHP for Eclipse"
-   version="1.0.0"
-   provider-name="phpeclipse"
-   class="net.sourceforge.phpeclipse.pluginPHP">
+   name="%pluginName"
+   version="1.0.1"
+   provider-name="%providerName"
+   class="net.sourceforge.phpeclipse.PHPeclipsePlugin">
 
    <runtime>
       <library name="PHPEclipse.jar"/>
    <requires>
       <import plugin="org.eclipse.core.resources"/>
       <import plugin="org.eclipse.ui"/>
-      <import plugin="org.eclipse.jdt.doc.isv"/>
-      <import plugin="org.eclipse.compare"/>
-      <import plugin="org.eclipse.core.boot"/>
-      <import plugin="org.eclipse.core.runtime"/>
-      <import plugin="org.eclipse.team.cvs.ssh"/>
-      <import plugin="org.eclipse.team.cvs.core"/>
-      <import plugin="org.eclipse.team.cvs.ui"/>
-      <import plugin="org.eclipse.debug.core"/>
-      <import plugin="org.eclipse.debug.ui"/>
       <import plugin="org.eclipse.jdt"/>
-      <import plugin="org.eclipse.jdt.source"/>
-      <import plugin="org.eclipse.jdt.doc.user"/>
-      <import plugin="org.eclipse.platform"/>
-      <import plugin="org.eclipse.platform.win32"/>
-      <import plugin="org.eclipse.platform.doc.isv"/>
-      <import plugin="org.eclipse.platform.source"/>
-      <import plugin="org.eclipse.tomcat"/>
-      <import plugin="org.eclipse.team.ui"/>
-      <import plugin="org.eclipse.team.core"/>
-      <import plugin="org.eclipse.swt"/>
       <import plugin="org.eclipse.jdt.ui"/>
-      <import plugin="org.eclipse.jdt.debug"/>
-      <import plugin="org.eclipse.search"/>
-      <import plugin="org.eclipse.pde.runtime"/>
-      <import plugin="org.eclipse.pde.ui"/>
-      <import plugin="org.junit"/>
-      <import plugin="org.eclipse.jdt.debug.ui"/>
-      <import plugin="org.eclipse.pde.core"/>
-      <import plugin="org.eclipse.pde.build"/>
-      <import plugin="org.eclipse.platform.win32.source"/>
-      <import plugin="org.eclipse.pde"/>
-      <import plugin="org.eclipse.pde.source"/>
-      <import plugin="org.eclipse.pde.doc.user"/>
-      <import plugin="org.eclipse.sdk.win32"/>
-      <import plugin="org.eclipse.platform.doc.user"/>
-      <import plugin="org.eclipse.ui.externaltools"/>
-      <import plugin="org.eclipse.help"/>
-      <import plugin="org.eclipse.help.ui"/>
-      <import plugin="org.eclipse.help.webapp"/>
-      <import plugin="org.eclipse.update.ui.forms"/>
-      <import plugin="org.eclipse.update.core"/>
-      <import plugin="org.eclipse.update.ui"/>
-      <import plugin="org.eclipse.jdt.core"/>
-      <import plugin="org.eclipse.jdt.junit"/>
-      <import plugin="org.eclipse.jdt.launching"/>
    </requires>
 
 
    <extension
          point="org.eclipse.ui.editors">
       <editor
-            name="Editor PHP"
-            icon="icons/sample.gif"
+            name="%phpEditorName"
+            icon="icons/obj16/java.gif"
             extensions="php"
-            contributorClass="org.eclipse.ui.texteditor.BasicTextEditorActionContributor"
-            class="net.sourceforge.phpeclipse.editors.PHPEditor"
-            id="net.sourceforge.phpeclipse.editors.PHPEditor">
+            contributorClass="net.sourceforge.phpeclipse.phpeditor.PHPActionContributor"
+            class="net.sourceforge.phpeclipse.phpeditor.PHPEditor"
+            id="net.sourceforge.phpeclipse.PHPEditor">
       </editor>
    </extension>
+   <extension
+         point="org.eclipse.ui.popupMenus">
+      <objectContribution
+            objectClass="org.eclipse.core.resources.IFile"
+            nameFilter="*.php"
+            id="net.sourceforge.phpeclipse.actions.popupShowAction">
+         <action
+               label="Open in Browser"
+               class="net.sourceforge.phpeclipse.actions.PHPEclipseShowAction"
+               menubarPath="additions"
+               id="net.sourceforge.phpeclipse.actions.showAction">
+         </action>
+      </objectContribution>
+      <viewerContribution
+            targetID="#TextEditorContext"
+            id="net.sourceforge.phpeclipse.actions.popup.editor">
+         <action
+               label="PHP Help"
+               class="net.sourceforge.phpeclipse.actions.PHPEclipseShowContextHelp"
+               menubarPath="additions"
+               id="net.sourceforge.phpeclipse.actions.editor.contexthelp">
+         </action>
+         &gt;
+      </viewerContribution>
+   </extension>
+   <extension
+         point="org.eclipse.ui.preferencePages">
+      <page
+            name="PHP"
+            class="net.sourceforge.phpeclipse.PHPEclipsePreferencePage"
+            id="net.sourceforge.phpeclipse.preference.PHPEclipsePreferencePage">
+      </page>
+   </extension>
+   <extension
+         point="org.eclipse.ui.documentProviders">
+      <provider
+            extensions="%phpFileExtension"
+            class="net.sourceforge.phpeclipse.phpeditor.PHPDocumentProvider"
+            id="net.sourceforge.phpeclipse.phpeditor.PHPDocumentProvider">
+      </provider>
+   </extension>
 
 </plugin>
diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPEclipsePreferencePage.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPEclipsePreferencePage.java
new file mode 100644 (file)
index 0000000..05b2d4e
--- /dev/null
@@ -0,0 +1,133 @@
+/**********************************************************************
+Copyright (c) 2000, 2002 IBM Corp. and others.
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Common Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/cpl-v10.html
+
+Contributors:
+    IBM Corporation - Initial implementation
+    Klaus Hartlage - www.eclipseproject.de
+**********************************************************************/
+package net.sourceforge.phpeclipse;
+
+import java.io.IOException;
+import java.text.MessageFormat;
+
+import org.eclipse.jface.preference.BooleanFieldEditor;
+import org.eclipse.jface.preference.DirectoryFieldEditor;
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.StringFieldEditor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+/**
+ * 
+ * @author khartlage
+ */
+public class PHPEclipsePreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
+
+       public PHPEclipsePreferencePage() {
+               super(FieldEditorPreferencePage.GRID);
+               //Initialize the preference store we wish to use
+               setPreferenceStore(PHPeclipsePlugin.getDefault().getPreferenceStore());
+       }
+
+       protected void createFieldEditors() {
+               Shell shell = getShell();
+               final IPreferenceStore store = PHPeclipsePlugin.getDefault().getPreferenceStore();
+
+               StringFieldEditor localhost = new StringFieldEditor(PHPeclipsePlugin.LOCALHOST_PREF, "&Localhost:", 60, getFieldEditorParent());
+
+               DirectoryFieldEditor documentRoot =
+                       new DirectoryFieldEditor(PHPeclipsePlugin.DOCUMENTROOT_PREF, "&DocumentRoot:", getFieldEditorParent());
+
+               BooleanFieldEditor useExternalBrowser =
+                       new BooleanFieldEditor(PHPeclipsePlugin.USE_EXTERNAL_BROWSER_PREF, "&Use External Browser", 60, getFieldEditorParent());
+
+               StringFieldEditor externalBrowser =
+                       new StringFieldEditor(PHPeclipsePlugin.EXTERNAL_BROWSER_PREF, "&External Browser command:", 60, getFieldEditorParent());
+
+               StringFieldEditor startMySQL =
+                       new StringFieldEditor(PHPeclipsePlugin.MYSQL_PREF, "&MySQL command:", 60, getFieldEditorParent());
+               Button button = new Button(shell, SWT.PUSH);
+               button.setText("Start MySQL");
+               button.addSelectionListener(new SelectionAdapter() {
+                       public void widgetSelected(SelectionEvent e) {
+                               try {
+                                       Runtime runtime = Runtime.getRuntime();
+                                       runtime.exec(store.getString(PHPeclipsePlugin.MYSQL_PREF));
+                               } catch (IOException e1) {
+                               }
+                       }
+               });
+
+               StringFieldEditor startApache =
+                       new StringFieldEditor(PHPeclipsePlugin.APACHE_START_PREF, "Start &Apache command:", 60, getFieldEditorParent());
+               Button startButton = new Button(shell, SWT.PUSH);
+               startButton.setText("Start Apache");
+               startButton.addSelectionListener(new SelectionAdapter() {
+                       public void widgetSelected(SelectionEvent e) {
+                               String[] arguments = { store.getString(PHPeclipsePlugin.DOCUMENTROOT_PREF)};
+                               MessageFormat form = new MessageFormat(store.getString(PHPeclipsePlugin.APACHE_START_PREF));
+
+                               try {
+                                       Runtime runtime = Runtime.getRuntime();
+                                       runtime.exec(form.format(arguments));
+                               } catch (IOException e2) {
+                               }
+                       }
+               });
+
+               StringFieldEditor stopApache =
+                       new StringFieldEditor(PHPeclipsePlugin.APACHE_STOP_PREF, "&Stop Apache command:", 60, getFieldEditorParent());
+    Button stopButton = new Button(shell, SWT.PUSH);
+    stopButton.setText("Stop Apache");
+    stopButton.addSelectionListener(new SelectionAdapter() {
+      public void widgetSelected(SelectionEvent e) {
+        try {
+          Runtime runtime = Runtime.getRuntime();
+          runtime.exec(store.getString(PHPeclipsePlugin.MYSQL_PREF));
+        } catch (IOException e1) {
+        }
+      }
+    });
+    
+               StringFieldEditor restartApache =
+                       new StringFieldEditor(PHPeclipsePlugin.APACHE_RESTART_PREF, "&Restart Apache command:", 60, getFieldEditorParent());
+    Button restartButton = new Button(shell, SWT.PUSH);
+    restartButton.setText("Restart Apache");
+    restartButton.addSelectionListener(new SelectionAdapter() {
+      public void widgetSelected(SelectionEvent e) {
+        try {
+          Runtime runtime = Runtime.getRuntime();
+          runtime.exec(store.getString(PHPeclipsePlugin.MYSQL_PREF));
+        } catch (IOException e1) {
+        }
+      }
+    });
+    
+               addField(localhost);
+               addField(documentRoot);
+               addField(useExternalBrowser);
+               addField(externalBrowser);
+               addField(startMySQL);
+               addField(startApache);
+//    add(startButton);
+               addField(stopApache);
+               addField(restartApache);
+       }
+
+       /**
+        * @see IWorkbenchPreferencePage#init
+        */
+       public void init(IWorkbench workbench) {
+       }
+
+}
index 12e570f..6dea6cf 100644 (file)
@@ -1,3 +1,14 @@
+/**********************************************************************
+Copyright (c) 2000, 2002 IBM Corp. and others.
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Common Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/cpl-v10.html
+
+Contributors:
+    IBM Corporation - Initial implementation
+    Klaus Hartlage - www.eclipseproject.de
+**********************************************************************/
 package net.sourceforge.phpeclipse;
 
 import java.util.MissingResourceException;
@@ -6,32 +17,101 @@ import java.util.ResourceBundle;
 import org.eclipse.core.resources.IWorkspace;
 import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.IPluginDescriptor;
+import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.ui.plugin.AbstractUIPlugin;
 
 /**
  * The main plugin class to be used in the desktop.
  */
 public class PHPeclipsePlugin extends AbstractUIPlugin {
+       public static final String LOCALHOST_PREF = "_localhost";
+       public static final String DOCUMENTROOT_PREF = "_documentroot";
+       public static final String USE_EXTERNAL_BROWSER_PREF = "_use_external_browser";
+       public static final String EXTERNAL_BROWSER_PREF = "_external_browser";
+       public static final String MYSQL_PREF = "_my_sql";
+       public static final String APACHE_START_PREF = "_apache_start";
+       public static final String APACHE_STOP_PREF = "_apache_stop";
+       public static final String APACHE_RESTART_PREF = "_apache_restart";
        //The shared instance.
        private static PHPeclipsePlugin plugin;
        //Resource bundle.
        private ResourceBundle resourceBundle;
+       /**
+       * The Java virtual machine that we are running on.  
+       */
+       private static int jvm;
+
+       /** MRJ 2.0 */
+       private static final int MRJ_2_0 = 0;
+
+       /** MRJ 2.1 or later */
+       private static final int MRJ_2_1 = 1;
+
+       /** Java on Mac OS X 10.0 (MRJ 3.0) */
+       private static final int MRJ_3_0 = 3;
+
+       /** MRJ 3.1 */
+       private static final int MRJ_3_1 = 4;
 
+       /** Windows NT  */
+       private static final int WINDOWS_NT = 5;
+
+       /** Windows 9x  */
+       private static final int WINDOWS_9x = 6;
+
+       /** JVM constant for any other platform */
+       private static final int OTHER = -1;
        /**
         * The constructor.
         */
        public PHPeclipsePlugin(IPluginDescriptor descriptor) {
                super(descriptor);
                plugin = this;
+               setJVM();
                try {
-                       resourceBundle =
-                               ResourceBundle.getBundle(
-                                       "net.sourceforge.PHPeclipsePluginResources");
+                       resourceBundle = ResourceBundle.getBundle("net.sourceforge.PHPeclipsePluginResources");
                } catch (MissingResourceException x) {
                        resourceBundle = null;
                }
        }
 
+       public static void setJVM() {
+               String osName = System.getProperty("os.name");
+
+               if (osName.startsWith("Mac OS")) {
+                       String mrjVersion = System.getProperty("mrj.version");
+                       String majorMRJVersion = mrjVersion.substring(0, 3);
+                       jvm = OTHER;
+                       try {
+
+                               double version = Double.valueOf(majorMRJVersion).doubleValue();
+
+                               if (version == 2) {
+                                       jvm = MRJ_2_0;
+                               } else if (version >= 2.1 && version < 3) {
+                                       jvm = MRJ_2_1;
+                               } else if (version == 3.0) {
+                                       jvm = MRJ_3_0;
+                               } else if (version >= 3.1) {
+                                       // Assume that all 3.1 and later versions of MRJ work the same.
+                                       jvm = MRJ_3_1;
+                               }
+
+                       } catch (NumberFormatException nfe) {
+
+                       }
+
+               } else if (osName.startsWith("Windows")) {
+                       if (osName.indexOf("9") != -1) {
+                               jvm = WINDOWS_9x;
+                       } else {
+                               jvm = WINDOWS_NT;
+                       }
+               }
+       }
+       public static int getJVM() {
+               return jvm;
+       }
        /**
         * Returns the shared instance.
         */
@@ -51,8 +131,7 @@ public class PHPeclipsePlugin extends AbstractUIPlugin {
         * or 'key' if not found.
         */
        public static String getResourceString(String key) {
-               ResourceBundle bundle =
-                       PHPeclipsePlugin.getDefault().getResourceBundle();
+               ResourceBundle bundle = PHPeclipsePlugin.getDefault().getResourceBundle();
                try {
                        return bundle.getString(key);
                } catch (MissingResourceException e) {
@@ -66,4 +145,31 @@ public class PHPeclipsePlugin extends AbstractUIPlugin {
        public ResourceBundle getResourceBundle() {
                return resourceBundle;
        }
-}
+
+       protected void initializeDefaultPreferences(IPreferenceStore store) {
+               // windows preferences:
+               store.setDefault(LOCALHOST_PREF, "http://localhost");
+               
+               store.setDefault(USE_EXTERNAL_BROWSER_PREF, "false");
+               if (jvm == WINDOWS_9x) {
+                       store.setDefault(EXTERNAL_BROWSER_PREF, "command.com /c start iexplore {0}");
+               } else if (jvm == WINDOWS_NT) {
+                       store.setDefault(EXTERNAL_BROWSER_PREF, "rundll32 url.dll,FileProtocolHandler {0}");
+               } else {
+                       store.setDefault(EXTERNAL_BROWSER_PREF, "netscape {0}");
+               }
+               if ((jvm == WINDOWS_9x) || (jvm == WINDOWS_NT)) {
+      store.setDefault(DOCUMENTROOT_PREF, "c:\\eclipse\\workspace");
+                       store.setDefault(MYSQL_PREF, "c:\\apache\\mysql\\bin\\mysqld.exe --standalone");
+                       store.setDefault(APACHE_START_PREF, "c:\\apache\\apache.exe \"DocumentRoot \"{0}\"\"");
+                       store.setDefault(APACHE_STOP_PREF, "c:\\apache\\apache.exe -k shutdown");
+                       store.setDefault(APACHE_RESTART_PREF, "c:\\apache\\apache.exe -k restart");
+               } else {
+      store.setDefault(DOCUMENTROOT_PREF, "/eclipse/workspace");
+                       store.setDefault(MYSQL_PREF, "/apache/mysql/bin/mysqld --standalone");
+                       store.setDefault(APACHE_START_PREF, "/apache/apache \"DocumentRoot \"{0}\"\"");
+                       store.setDefault(APACHE_STOP_PREF, "/apache/apache.exe -k shutdown");
+                       store.setDefault(APACHE_RESTART_PREF, "/apache/apache -k restart");
+               }
+       }
+}
\ No newline at end of file
diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPEclipseShowAction.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPEclipseShowAction.java
new file mode 100644 (file)
index 0000000..a6b8466
--- /dev/null
@@ -0,0 +1,133 @@
+/**********************************************************************
+Copyright (c) 2000, 2002 IBM Corp. and others.
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Common Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/cpl-v10.html
+
+Contributors:
+    IBM Corporation - Initial implementation
+    Klaus Hartlage - www.eclipseproject.de
+**********************************************************************/
+package net.sourceforge.phpeclipse.actions;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.text.MessageFormat;
+import java.util.Iterator;
+
+import net.sourceforge.phpeclipse.PHPeclipsePlugin;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.jdt.internal.ui.actions.OpenBrowserUtil;
+// import org.eclipse.help.ui.browser.LaunchURL;
+
+public class PHPEclipseShowAction implements IObjectActionDelegate {
+       private IWorkbenchPart workbenchPart;
+       /**
+        * Constructor for Action1.
+        */
+       public PHPEclipseShowAction() {
+               super();
+       }
+
+       /**
+        * @see IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart)
+        */
+       public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+               workbenchPart = targetPart;
+       }
+  
+//  public static void open(final URL url, final Shell shell, final String dialogTitle) {
+//    IHelp help= WorkbenchHelp.getHelpSupport();
+//    if (help != null) {
+//      WorkbenchHelp.getHelpSupport().displayHelpResource(url.toExternalForm());
+//    } else {
+//      showMessage(shell, dialogTitle, ActionMessages.getString("OpenBrowserUtil.help_not_available"), false); //$NON-NLS-1$
+//    }
+//  }
+  
+       public void run(IAction action) {
+               ISelectionProvider selectionProvider = null;
+               selectionProvider = workbenchPart.getSite().getSelectionProvider();
+
+               StructuredSelection selection = null;
+               selection = (StructuredSelection) selectionProvider.getSelection();
+
+               IPreferenceStore store = PHPeclipsePlugin.getDefault().getPreferenceStore();
+
+               Shell shell = null;
+               Iterator iterator = null;
+               iterator = selection.iterator();
+               while (iterator.hasNext()) {
+                       //  obj => selected object in the view
+                       Object obj = iterator.next();
+
+                       // is it a resource
+                       if (obj instanceof IResource) {
+                               IResource resource = (IResource) obj;
+
+                               // check if it's a file resource
+                               switch (resource.getType()) {
+
+                                       case IResource.FILE :
+                                               // single file:
+                                               IFile file = (IFile) resource;
+                                               IPath path = file.getFullPath();
+                                               //            if (j2h==null) {
+                                               //              shell = new Shell();
+                                               //              j2h = new Java2HTML(shell); 
+                                               //            }
+
+                                               String fileName = file.getLocation().toString();
+                                               //       fileName = "http://localhost"+fileName.replaceAll("c:", "");
+                                               fileName = store.getString(PHPeclipsePlugin.LOCALHOST_PREF) + fileName.replaceAll("C:", "");
+
+                                               try {
+                                                       if (store.getBoolean(PHPeclipsePlugin.USE_EXTERNAL_BROWSER_PREF)) {
+                                                               String[] arguments = { fileName };
+                                                               MessageFormat form = new MessageFormat(store.getString(PHPeclipsePlugin.EXTERNAL_BROWSER_PREF));
+
+                                                               Runtime runtime = Runtime.getRuntime();
+                                                               runtime.exec(form.format(arguments));
+                                                               //                      runtime.exec(store.getString(PHPeclipsePlugin.EXTERNAL_BROWSER_PREF) + " " + fileName);
+                                                               //                                                              runtime.exec("command.com /c start iexplore " + fileName);
+                                                       } else {
+                                                               OpenBrowserUtil.open(new URL(fileName), shell, fileName);
+                                                       }
+                                               } catch (MalformedURLException e) {
+                                                       MessageDialog.openInformation(shell, "MalformedURLException: ", e.toString());
+                                               } catch (IOException e) {
+                                                       MessageDialog.openInformation(shell, "IOException", "Cannot show: " + fileName);
+
+                                               }
+
+                                               //            MessageDialog.openInformation(shell, "PHPEclipse", "FileName - " + fileName);
+                                               //
+                                               //            Runtime runtime = Runtime.getRuntime();
+                                               //            try {
+                                               //                                                      runtime.exec("command.com /c start iexplore "+fileName);
+
+                                               //            MessageDialog.openInformation(shell, "J2h Plug-in", "FileName - " + fileName);
+                                               //            j2h.convert( fileName );
+                               }
+                       }
+               }
+       } /**
+                                        * @see IActionDelegate#selectionChanged(IAction, ISelection)
+                                        */
+       public void selectionChanged(IAction action, ISelection selection) {
+       }
+
+}
diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPEclipseShowContextHelp.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPEclipseShowContextHelp.java
new file mode 100644 (file)
index 0000000..9a638e2
--- /dev/null
@@ -0,0 +1,47 @@
+/**********************************************************************
+Copyright (c) 2000, 2002 IBM Corp. and others.
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Common Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/cpl-v10.html
+
+Contributors:
+    IBM Corporation - Initial implementation
+    Klaus Hartlage - www.eclipseproject.de
+**********************************************************************/
+package net.sourceforge.phpeclipse.actions;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.ui.IEditorActionDelegate;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.actions.ActionDelegate;
+import org.eclipse.ui.internal.EditorPluginAction;
+
+public class PHPEclipseShowContextHelp
+  extends ActionDelegate
+  implements IEditorActionDelegate {
+    
+private IEditorPart editor;
+  /**
+   * @see ActionDelegate#run(IAction)
+   */
+  public void run(IAction action) {
+    EditorPluginAction editorPluginAction = (EditorPluginAction) action;
+    IEditorInput input = editor.getEditorInput();
+    // Add your code here to perform the action
+    MessageDialog.openInformation(
+      editor.getSite().getShell(),
+      "Context Help: ", 
+      input.toString());
+  }
+
+  /**
+   * @see IEditorActionDelegate#setActiveEditor(IAction, IEditorPart)
+   */
+  public void setActiveEditor(IAction action, IEditorPart targetEditor) {
+      this.editor = targetEditor;
+  }
+
+}
diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPActionContributor.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPActionContributor.java
new file mode 100644 (file)
index 0000000..1fbefe5
--- /dev/null
@@ -0,0 +1,97 @@
+package net.sourceforge.phpeclipse.phpeditor;
+
+/**********************************************************************
+Copyright (c) 2000, 2002 IBM Corp. and others.
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Common Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/cpl-v10.html
+
+Contributors:
+    IBM Corporation - Initial implementation
+    Klaus Hartlage - www.eclipseproject.de
+**********************************************************************/
+
+import java.util.ResourceBundle;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchActionConstants;
+import org.eclipse.ui.editors.text.TextEditorActionContributor;
+import org.eclipse.ui.texteditor.BasicTextEditorActionContributor;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.ui.texteditor.RetargetTextEditorAction;
+import org.eclipse.ui.texteditor.TextEditorAction;
+
+/**
+ * Contributes interesting Java actions to the desktop's Edit menu and the toolbar.
+ */
+public class PHPActionContributor extends TextEditorActionContributor {
+
+       protected RetargetTextEditorAction fContentAssistProposal;
+       protected RetargetTextEditorAction fContentAssistTip;
+       protected TextEditorAction fTogglePresentation;
+
+       /**
+        * Default constructor.
+        */
+       public PHPActionContributor() {
+               super();
+               fContentAssistProposal= new RetargetTextEditorAction(PHPEditorMessages.getResourceBundle(), "ContentAssistProposal."); //$NON-NLS-1$
+               fContentAssistTip= new RetargetTextEditorAction(PHPEditorMessages.getResourceBundle(), "ContentAssistTip."); //$NON-NLS-1$
+               fTogglePresentation= new PresentationAction();
+       }
+       
+       /*
+        * @see IEditorActionBarContributor#init(IActionBars)
+        */
+       public void init(IActionBars bars) {
+               super.init(bars);
+               
+               IMenuManager menuManager= bars.getMenuManager();
+               IMenuManager editMenu= menuManager.findMenuUsingPath(IWorkbenchActionConstants.M_EDIT);
+               if (editMenu != null) {
+                       editMenu.add(new Separator());
+                       editMenu.add(fContentAssistProposal);
+                       editMenu.add(fContentAssistTip);
+               }       
+               
+               IToolBarManager toolBarManager= bars.getToolBarManager();
+               if (toolBarManager != null) {
+                       toolBarManager.add(new Separator());
+                       toolBarManager.add(fTogglePresentation);
+               }
+       }
+       
+       private void doSetActiveEditor(IEditorPart part) {
+               super.setActiveEditor(part);
+
+               ITextEditor editor= null;
+               if (part instanceof ITextEditor)
+                       editor= (ITextEditor) part;
+
+               fContentAssistProposal.setAction(getAction(editor, "ContentAssistProposal")); //$NON-NLS-1$
+               fContentAssistTip.setAction(getAction(editor, "ContentAssistTip")); //$NON-NLS-1$
+
+               fTogglePresentation.setEditor(editor);
+               fTogglePresentation.update();
+       }
+       
+       /*
+        * @see IEditorActionBarContributor#setActiveEditor(IEditorPart)
+        */
+       public void setActiveEditor(IEditorPart part) {
+               super.setActiveEditor(part);
+               doSetActiveEditor(part);
+       }
+       
+       /*
+        * @see IEditorActionBarContributor#dispose()
+        */
+       public void dispose() {
+               doSetActiveEditor(null);
+               super.dispose();
+       }
+}
diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPAnnotationHover.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPAnnotationHover.java
new file mode 100644 (file)
index 0000000..f5f0e60
--- /dev/null
@@ -0,0 +1,41 @@
+package net.sourceforge.phpeclipse.phpeditor;
+
+/**********************************************************************
+Copyright (c) 2000, 2002 IBM Corp. and others.
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Common Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/cpl-v10.html
+
+Contributors:
+    IBM Corporation - Initial implementation
+    Klaus Hartlage - www.eclipseproject.de
+**********************************************************************/
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.source.IAnnotationHover;
+import org.eclipse.jface.text.source.ISourceViewer;
+
+/** 
+ * The JavaAnnotationHover provides the hover support for java editors.
+ */
+public class PHPAnnotationHover implements IAnnotationHover {
+
+       /* (non-Javadoc)
+        * Method declared on IAnnotationHover
+        */
+       public String getHoverInfo(ISourceViewer sourceViewer, int lineNumber) {
+               IDocument document= sourceViewer.getDocument();
+
+               try {
+                       IRegion info= document.getLineInformation(lineNumber);
+                       return document.get(info.getOffset(), info.getLength());
+               } catch (BadLocationException x) {
+               }
+
+               return null;
+       }
+}
diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPContentOutlinePage.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPContentOutlinePage.java
new file mode 100644 (file)
index 0000000..d7ab260
--- /dev/null
@@ -0,0 +1,251 @@
+package net.sourceforge.phpeclipse.phpeditor;
+
+/**********************************************************************
+Copyright (c) 2000, 2002 IBM Corp. and others.
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Common Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/cpl-v10.html
+
+Contributors:
+    IBM Corporation - Initial implementation
+    Klaus Hartlage - www.eclipseproject.de
+**********************************************************************/
+
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.BadPositionCategoryException;
+import org.eclipse.jface.text.DefaultPositionUpdater;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IPositionUpdater;
+import org.eclipse.jface.text.Position;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+
+import org.eclipse.ui.texteditor.IDocumentProvider;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.ui.views.contentoutline.ContentOutlinePage;
+
+/**
+ * A content outline page which always represents the content of the
+ * connected editor in 10 segments.
+ */
+public class PHPContentOutlinePage extends ContentOutlinePage {
+
+       /**
+        * A segment element.
+        */
+       protected static class Segment {
+               public String name;
+               public Position position;
+
+               public Segment(String name, Position position) {
+                       this.name= name;
+                       this.position= position;
+               }
+
+               public String toString() {
+                       return name;
+               }
+       };
+
+       /**
+        * Divides the editor's document into ten segments and provides elements for them.
+        */
+       protected class ContentProvider implements ITreeContentProvider {
+
+               protected final static String SEGMENTS= "__java_segments"; //$NON-NLS-1$
+               protected IPositionUpdater fPositionUpdater= new DefaultPositionUpdater(SEGMENTS);
+               protected List fContent= new ArrayList(10);
+
+               protected void parse(IDocument document) {
+
+                       int lines= document.getNumberOfLines();
+                       int increment= Math.max(Math.round((float) (lines / 10)), 10);
+
+                       for (int line= 0; line < lines; line += increment) {
+
+                               int length= increment;
+                               if (line + increment > lines)
+                                       length= lines - line;
+
+                               try {
+
+                                       int offset= document.getLineOffset(line);
+                                       int end= document.getLineOffset(line + length);
+                                       length= end - offset;
+                                       Position p= new Position(offset, length);
+                                       document.addPosition(SEGMENTS, p);
+                                       fContent.add(new Segment(MessageFormat.format(PHPEditorMessages.getString("OutlinePage.segment.title_pattern"), new Object[] { new Integer(offset) }), p)); //$NON-NLS-1$
+
+                               } catch (BadPositionCategoryException x) {
+                               } catch (BadLocationException x) {
+                               }
+                       }
+               }
+
+               /*
+                * @see IContentProvider#inputChanged(Viewer, Object, Object)
+                */
+               public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+                       if (oldInput != null) {
+                               IDocument document= fDocumentProvider.getDocument(oldInput);
+                               if (document != null) {
+                                       try {
+                                               document.removePositionCategory(SEGMENTS);
+                                       } catch (BadPositionCategoryException x) {
+                                       }
+                                       document.removePositionUpdater(fPositionUpdater);
+                               }
+                       }
+
+                       fContent.clear();
+
+                       if (newInput != null) {
+                               IDocument document= fDocumentProvider.getDocument(newInput);
+                               if (document != null) {
+                                       document.addPositionCategory(SEGMENTS);
+                                       document.addPositionUpdater(fPositionUpdater);
+
+                                       parse(document);
+                               }
+                       }
+               }
+
+               /*
+                * @see IContentProvider#dispose
+                */
+               public void dispose() {
+                       if (fContent != null) {
+                               fContent.clear();
+                               fContent= null;
+                       }
+               }
+
+               /*
+                * @see IContentProvider#isDeleted(Object)
+                */
+               public boolean isDeleted(Object element) {
+                       return false;
+               }
+
+               /*
+                * @see IStructuredContentProvider#getElements(Object)
+                */
+               public Object[] getElements(Object element) {
+                       return fContent.toArray();
+               }
+
+               /*
+                * @see ITreeContentProvider#hasChildren(Object)
+                */
+               public boolean hasChildren(Object element) {
+                       return element == fInput;
+               }
+
+               /*
+                * @see ITreeContentProvider#getParent(Object)
+                */
+               public Object getParent(Object element) {
+                       if (element instanceof Segment)
+                               return fInput;
+                       return null;
+               }
+
+               /*
+                * @see ITreeContentProvider#getChildren(Object)
+                */
+               public Object[] getChildren(Object element) {
+                       if (element == fInput)
+                               return fContent.toArray();
+                       return new Object[0];
+               }
+       };
+
+       protected Object fInput;
+       protected IDocumentProvider fDocumentProvider;
+       protected ITextEditor fTextEditor;
+
+       /**
+        * Creates a content outline page using the given provider and the given editor.
+        */
+       public PHPContentOutlinePage(IDocumentProvider provider, ITextEditor editor) {
+               super();
+               fDocumentProvider= provider;
+               fTextEditor= editor;
+       }
+       
+       /* (non-Javadoc)
+        * Method declared on ContentOutlinePage
+        */
+       public void createControl(Composite parent) {
+
+               super.createControl(parent);
+
+               TreeViewer viewer= getTreeViewer();
+               viewer.setContentProvider(new ContentProvider());
+               viewer.setLabelProvider(new LabelProvider());
+               viewer.addSelectionChangedListener(this);
+
+               if (fInput != null)
+                       viewer.setInput(fInput);
+       }
+       
+       /* (non-Javadoc)
+        * Method declared on ContentOutlinePage
+        */
+       public void selectionChanged(SelectionChangedEvent event) {
+
+               super.selectionChanged(event);
+
+               ISelection selection= event.getSelection();
+               if (selection.isEmpty())
+                       fTextEditor.resetHighlightRange();
+               else {
+                       Segment segment= (Segment) ((IStructuredSelection) selection).getFirstElement();
+                       int start= segment.position.getOffset();
+                       int length= segment.position.getLength();
+                       try {
+                               fTextEditor.setHighlightRange(start, length, true);
+                       } catch (IllegalArgumentException x) {
+                               fTextEditor.resetHighlightRange();
+                       }
+               }
+       }
+       
+       /**
+        * Sets the input of the outline page
+        */
+       public void setInput(Object input) {
+               fInput= input;
+               update();
+       }
+       
+       /**
+        * Updates the outline page.
+        */
+       public void update() {
+               TreeViewer viewer= getTreeViewer();
+
+               if (viewer != null) {
+                       Control control= viewer.getControl();
+                       if (control != null && !control.isDisposed()) {
+                               control.setRedraw(false);
+                               viewer.setInput(fInput);
+                               viewer.expandAll();
+                               control.setRedraw(true);
+                       }
+               }
+       }
+}
diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPDocumentProvider.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPDocumentProvider.java
new file mode 100644 (file)
index 0000000..919bdd9
--- /dev/null
@@ -0,0 +1,66 @@
+package net.sourceforge.phpeclipse.phpeditor;
+
+/**********************************************************************
+Copyright (c) 2000, 2002 IBM Corp. and others.
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Common Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/cpl-v10.html
+
+Contributors:
+    IBM Corporation - Initial implementation
+    Klaus Hartlage - www.eclipseproject.de
+**********************************************************************/
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IDocumentPartitioner;
+import org.eclipse.jface.text.rules.DefaultPartitioner;
+import org.eclipse.jface.text.rules.RuleBasedPartitioner;
+import org.eclipse.ui.editors.text.FileDocumentProvider;
+import net.sourceforge.phpeclipse.phpeditor.php.PHPPartitionScanner;
+
+/** 
+ * The JavaDocumentProvider provides the IDocuments used by java editors.
+ */
+
+public class PHPDocumentProvider extends FileDocumentProvider {
+
+       // private final static String[] TYPES= new String[] { PHPPartitionScanner.PHP, PHPPartitionScanner.JAVA_DOC, PHPPartitionScanner.JAVA_MULTILINE_COMMENT };
+private final static String[] TYPES= new String[] { PHPPartitionScanner.PHP, PHPPartitionScanner.JAVA_MULTILINE_COMMENT };
+
+       private static PHPPartitionScanner fgScanner= null;
+
+       public PHPDocumentProvider() {
+               super();
+       }
+       
+       /* (non-Javadoc)
+        * Method declared on AbstractDocumentProvider
+        */
+        protected IDocument createDocument(Object element) throws CoreException {
+               IDocument document= super.createDocument(element);
+               if (document != null) {
+                       IDocumentPartitioner partitioner= createJavaPartitioner();
+                       document.setDocumentPartitioner(partitioner);
+                       partitioner.connect(document);
+               }
+               return document;
+       }
+       
+       /**
+        * Return a partitioner for .java files.
+        */
+        private IDocumentPartitioner createJavaPartitioner() {
+               return new DefaultPartitioner(getPHPPartitionScanner(), TYPES);
+       }
+       
+       /**
+        * Return a scanner for creating java partitions.
+        */
+        private PHPPartitionScanner getPHPPartitionScanner() {
+               if (fgScanner == null)
+                       fgScanner= new PHPPartitionScanner();
+               return fgScanner;
+       }
+}
diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPEditor.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPEditor.java
new file mode 100644 (file)
index 0000000..f32a1e8
--- /dev/null
@@ -0,0 +1,140 @@
+package net.sourceforge.phpeclipse.phpeditor;
+
+/**********************************************************************
+Copyright (c) 2000, 2002 IBM Corp. and others.
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Common Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/cpl-v10.html
+
+Contributors:
+    IBM Corporation - Initial implementation
+    Klaus Hartlage - www.eclipseproject.de
+**********************************************************************/
+import java.util.ResourceBundle;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.editors.text.TextEditor;
+import org.eclipse.ui.texteditor.DefaultRangeIndicator;
+import org.eclipse.ui.texteditor.TextOperationAction;
+import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
+
+/**
+ * Java specific text editor.
+ */
+public class PHPEditor extends TextEditor {
+
+       /** The outline page */
+       private PHPContentOutlinePage fOutlinePage;
+
+       /**
+        * Default constructor.
+        */
+       public PHPEditor() {
+               super();
+       }
+       
+       /** The <code>JavaEditor</code> implementation of this 
+        * <code>AbstractTextEditor</code> method extend the 
+        * actions to add those specific to the receiver
+        */
+       protected void createActions() {
+               super.createActions();
+               setAction("ContentAssistProposal", new TextOperationAction(PHPEditorMessages.getResourceBundle(), "ContentAssistProposal.", this, ISourceViewer.CONTENTASSIST_PROPOSALS)); 
+               setAction("ContentAssistTip", new TextOperationAction(PHPEditorMessages.getResourceBundle(), "ContentAssistTip.", this, ISourceViewer.CONTENTASSIST_CONTEXT_INFORMATION)); 
+       }
+       
+       /** The <code>JavaEditor</code> implementation of this 
+        * <code>AbstractTextEditor</code> method performs any extra 
+        * disposal actions required by the java editor.
+        */
+       public void dispose() {
+               PHPEditorEnvironment.disconnect(this);
+               if (fOutlinePage != null)
+                       fOutlinePage.setInput(null);
+               super.dispose();
+       }
+       
+       /** The <code>JavaEditor</code> implementation of this 
+        * <code>AbstractTextEditor</code> method performs any extra 
+        * revert behavior required by the java editor.
+        */
+       public void doRevertToSaved() {
+               super.doRevertToSaved();
+               if (fOutlinePage != null)
+                       fOutlinePage.update();
+       }
+       
+       /** The <code>JavaEditor</code> implementation of this 
+        * <code>AbstractTextEditor</code> method performs any extra 
+        * save behavior required by the java editor.
+        */
+       public void doSave(IProgressMonitor monitor) {
+               super.doSave(monitor);
+               if (fOutlinePage != null)
+                       fOutlinePage.update();
+       }
+       
+       /** The <code>JavaEditor</code> implementation of this 
+        * <code>AbstractTextEditor</code> method performs any extra 
+        * save as behavior required by the java editor.
+        */
+       public void doSaveAs() {
+               super.doSaveAs();
+               if (fOutlinePage != null)
+                       fOutlinePage.update();
+       }
+       
+       /** The <code>JavaEditor</code> implementation of this 
+        * <code>AbstractTextEditor</code> method performs sets the 
+        * input of the outline page after AbstractTextEditor has set input.
+        */ 
+       public void doSetInput(IEditorInput input) throws CoreException {
+               super.doSetInput(input);
+               if (fOutlinePage != null)
+                       fOutlinePage.setInput(input);
+       }
+       
+       /** The <code>JavaEditor</code> implementation of this 
+        * <code>AbstractTextEditor</code> method adds any 
+        * JavaEditor specific entries.
+        */ 
+       public void editorContextMenuAboutToShow(MenuManager menu) {
+               super.editorContextMenuAboutToShow(menu);
+               addAction(menu, "ContentAssistProposal"); //$NON-NLS-1$
+               addAction(menu, "ContentAssistTip"); //$NON-NLS-1$
+       }
+       
+       /** The <code>JavaEditor</code> implementation of this 
+        * <code>AbstractTextEditor</code> method performs gets
+        * the java content outline page if request is for a an 
+        * outline page.
+        */ 
+       public Object getAdapter(Class required) {
+               if (IContentOutlinePage.class.equals(required)) {
+                       if (fOutlinePage == null) {
+                               fOutlinePage= new PHPContentOutlinePage(getDocumentProvider(), this);
+                               if (getEditorInput() != null)
+                                       fOutlinePage.setInput(getEditorInput());
+                       }
+                       return fOutlinePage;
+               }
+               return super.getAdapter(required);
+       }
+               
+       /* (non-Javadoc)
+        * Method declared on AbstractTextEditor
+        */
+       protected void initializeEditor() {
+
+               PHPEditorEnvironment.connect(this);
+
+               setSourceViewerConfiguration(new PHPSourceViewerConfiguration());
+               setRangeIndicator(new DefaultRangeIndicator());
+               setEditorContextMenuId("#PHPEditorContext"); //$NON-NLS-1$
+               setRulerContextMenuId("#PHPRulerContext"); //$NON-NLS-1$
+       }
+}
diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPEditorEnvironment.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPEditorEnvironment.java
new file mode 100644 (file)
index 0000000..47760a9
--- /dev/null
@@ -0,0 +1,74 @@
+package net.sourceforge.phpeclipse.phpeditor;
+
+/**********************************************************************
+Copyright (c) 2000, 2002 IBM Corp. and others.
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Common Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/cpl-v10.html
+
+Contributors:
+    IBM Corporation - Initial implementation
+    Klaus Hartlage - www.eclipseproject.de
+**********************************************************************/
+
+import org.eclipse.jface.text.rules.RuleBasedScanner;
+import net.sourceforge.phpeclipse.phpeditor.php.PHPCodeScanner;
+//import net.sourceforge.phpeclipse.phpeditor.html.JavaDocScanner;
+import net.sourceforge.phpeclipse.phpeditor.util.PHPColorProvider;
+
+/** The JavaEditorEnvironment maintains singletons used by the java editor
+ * examples.
+ */
+public class PHPEditorEnvironment {
+
+       private static PHPColorProvider fgColorProvider;
+       private static PHPCodeScanner fgCodeScanner;
+       //private static JavaDocScanner fgDocScanner;
+
+       private static int fgRefCount= 0;
+
+       /**
+        * A connection has occured - initialize the receiver if it is the first activation.
+        */
+       public static void connect(Object client) {
+               if (++fgRefCount == 1) {
+                       fgColorProvider= new PHPColorProvider();
+                       fgCodeScanner= new PHPCodeScanner(fgColorProvider);
+       //              fgDocScanner= new JavaDocScanner(fgColorProvider);
+               }
+       }
+       
+       /**
+        * A disconnection has occured - clear the receiver if it is the last deactivation.
+        */
+        public static void disconnect(Object client) {
+               if (--fgRefCount == 0) {
+                       fgCodeScanner= null;
+//                     fgDocScanner= null;
+                       fgColorProvider.dispose();
+                       fgColorProvider= null;
+               }
+       }
+       
+       /**
+        * Returns the singleton scanner.
+        */
+        public static RuleBasedScanner getPHPCodeScanner() {
+               return fgCodeScanner;
+       }
+       
+       /**
+        * Returns the singleton color provider.
+        */
+        public static PHPColorProvider getJavaColorProvider() {
+               return fgColorProvider;
+       }
+       
+       /**
+        * Returns the singleton document scanner.
+        */
+//      public static RuleBasedScanner getJavaDocScanner() {
+//             return fgDocScanner;
+//     }
+}
diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPEditorMessages.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPEditorMessages.java
new file mode 100644 (file)
index 0000000..c82eccb
--- /dev/null
@@ -0,0 +1,37 @@
+/**********************************************************************
+Copyright (c) 2000, 2002 IBM Corp. and others.
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Common Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/cpl-v10.html
+
+Contributors:
+    IBM Corporation - Initial implementation
+    Klaus Hartlage - www.eclipseproject.de
+**********************************************************************/
+package net.sourceforge.phpeclipse.phpeditor;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class PHPEditorMessages {
+
+       private static final String RESOURCE_BUNDLE= "net.sourceforge.phpeclipse.phpeditor.PHPEditorMessages";//$NON-NLS-1$
+
+       private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
+
+       private PHPEditorMessages() {
+       }
+
+       public static String getString(String key) {
+               try {
+                       return fgResourceBundle.getString(key);
+               } catch (MissingResourceException e) {
+                       return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
+               }
+       }
+       
+       public static ResourceBundle getResourceBundle() {
+               return fgResourceBundle;
+       }
+}
diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPEditorMessages.properties b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPEditorMessages.properties
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPSourceViewerConfiguration.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPSourceViewerConfiguration.java
new file mode 100644 (file)
index 0000000..c6aaad9
--- /dev/null
@@ -0,0 +1,167 @@
+/**********************************************************************
+Copyright (c) 2000, 2002 IBM Corp. and others.
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Common Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/cpl-v10.html
+
+Contributors:
+    IBM Corporation - Initial implementation
+    Klaus Hartlage - www.eclipseproject.de
+**********************************************************************/
+package net.sourceforge.phpeclipse.phpeditor;
+
+
+import java.util.List;
+
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.jface.text.DefaultAutoIndentStrategy;
+import org.eclipse.jface.text.IAutoIndentStrategy;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITextDoubleClickStrategy;
+import org.eclipse.jface.text.ITextHover;
+import org.eclipse.jface.text.TextAttribute;
+import org.eclipse.jface.text.contentassist.ContentAssistant;
+import org.eclipse.jface.text.contentassist.IContentAssistant;
+import org.eclipse.jface.text.presentation.IPresentationReconciler;
+import org.eclipse.jface.text.presentation.PresentationReconciler;
+import org.eclipse.jface.text.rules.BufferedRuleBasedScanner;
+import org.eclipse.jface.text.rules.DefaultDamagerRepairer;
+import org.eclipse.jface.text.rules.IToken;
+import org.eclipse.jface.text.rules.RuleBasedDamagerRepairer;
+import org.eclipse.jface.text.rules.Token;
+import org.eclipse.jface.text.source.IAnnotationHover;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jface.text.source.SourceViewerConfiguration;
+import net.sourceforge.phpeclipse.phpeditor.php.PHPAutoIndentStrategy;
+import net.sourceforge.phpeclipse.phpeditor.php.PHPCompletionProcessor;
+import net.sourceforge.phpeclipse.phpeditor.php.PHPDoubleClickSelector;
+import net.sourceforge.phpeclipse.phpeditor.php.PHPPartitionScanner;
+//import net.sourceforge.phpeclipse.phpeditor.html.JavaDocCompletionProcessor;
+import net.sourceforge.phpeclipse.phpeditor.util.PHPColorProvider;
+
+/**
+ * Configuration for an <code>SourceViewer</code> which shows PHP code.
+ */
+public class PHPSourceViewerConfiguration extends SourceViewerConfiguration {
+
+       /**
+        * Single token scanner.
+        */
+       static class SingleTokenScanner extends BufferedRuleBasedScanner {
+               public SingleTokenScanner(TextAttribute attribute) {
+                       setDefaultReturnToken(new Token(attribute));
+               }
+       };
+
+       /**
+        * Default constructor.
+        */
+       public PHPSourceViewerConfiguration() {
+       }
+
+       /* (non-Javadoc)
+        * Method declared on SourceViewerConfiguration
+        */
+       public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer) {
+               return new PHPAnnotationHover();
+       }
+
+       /* (non-Javadoc)
+        * Method declared on SourceViewerConfiguration
+        */
+       public IAutoIndentStrategy getAutoIndentStrategy(ISourceViewer sourceViewer, String contentType) {
+               return (IDocument.DEFAULT_CONTENT_TYPE.equals(contentType) ? new PHPAutoIndentStrategy() : new DefaultAutoIndentStrategy());
+       }
+
+       /* (non-Javadoc)
+        * Method declared on SourceViewerConfiguration
+        */
+       public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
+               return new String[] {
+                       IDocument.DEFAULT_CONTENT_TYPE,
+      PHPPartitionScanner.PHP,
+               //      PHPPartitionScanner.JAVA_DOC,
+                       PHPPartitionScanner.JAVA_MULTILINE_COMMENT };
+       }
+
+       /* (non-Javadoc)
+        * Method declared on SourceViewerConfiguration
+        */
+       public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
+
+               ContentAssistant assistant = new ContentAssistant();
+               assistant.setContentAssistProcessor(new PHPCompletionProcessor(), IDocument.DEFAULT_CONTENT_TYPE);
+       //      assistant.setContentAssistProcessor(new JavaDocCompletionProcessor(), PHPPartitionScanner.JAVA_DOC);
+
+               assistant.enableAutoActivation(true);
+               assistant.setAutoActivationDelay(500);
+               assistant.setProposalPopupOrientation(assistant.PROPOSAL_OVERLAY);
+               assistant.setContextInformationPopupOrientation(assistant.CONTEXT_INFO_ABOVE);
+               assistant.setContextInformationPopupBackground(PHPEditorEnvironment.getJavaColorProvider().getColor(new RGB(150, 150, 0)));
+
+               return assistant;
+       }
+
+       /* (non-Javadoc)
+        * Method declared on SourceViewerConfiguration
+        */
+       public String getDefaultPrefix(ISourceViewer sourceViewer, String contentType) {
+               return (IDocument.DEFAULT_CONTENT_TYPE.equals(contentType) ? "//" : null); //$NON-NLS-1$
+       }
+
+       /* (non-Javadoc)
+        * Method declared on SourceViewerConfiguration
+        */
+       public ITextDoubleClickStrategy getDoubleClickStrategy(ISourceViewer sourceViewer, String contentType) {
+               return new PHPDoubleClickSelector();
+       }
+
+       /* (non-Javadoc)
+        * Method declared on SourceViewerConfiguration
+        */
+       public String[] getIndentPrefixes(ISourceViewer sourceViewer, String contentType) {
+               return new String[] { "\t", "    " }; //$NON-NLS-1$ //$NON-NLS-2$
+       }
+
+       /* (non-Javadoc)
+        * Method declared on SourceViewerConfiguration
+        */
+       public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
+
+               PHPColorProvider provider = PHPEditorEnvironment.getJavaColorProvider();
+               PresentationReconciler reconciler = new PresentationReconciler();
+
+               DefaultDamagerRepairer dr = new DefaultDamagerRepairer(new SingleTokenScanner(new TextAttribute(provider.getColor(provider.HTML_DEFAULT))));
+               reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE);
+               reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);
+    
+    dr = new DefaultDamagerRepairer(PHPEditorEnvironment.getPHPCodeScanner());
+    reconciler.setDamager(dr, PHPPartitionScanner.PHP);
+    reconciler.setRepairer(dr, PHPPartitionScanner.PHP);
+    
+//             dr = new DefaultDamagerRepairer(new SingleTokenScanner(new TextAttribute(provider.getColor(provider.JAVADOC_DEFAULT))));
+//             reconciler.setDamager(dr, PHPPartitionScanner.JAVA_DOC);
+//             reconciler.setRepairer(dr, PHPPartitionScanner.JAVA_DOC);
+
+               dr = new DefaultDamagerRepairer(new SingleTokenScanner(new TextAttribute(provider.getColor(provider.MULTI_LINE_COMMENT))));
+               reconciler.setDamager(dr, PHPPartitionScanner.JAVA_MULTILINE_COMMENT);
+               reconciler.setRepairer(dr, PHPPartitionScanner.JAVA_MULTILINE_COMMENT);
+
+               return reconciler;
+       }
+
+       /* (non-Javadoc)
+        * Method declared on SourceViewerConfiguration
+        */
+       public int getTabWidth(ISourceViewer sourceViewer) {
+               return 4;
+       }
+
+       /* (non-Javadoc)
+        * Method declared on SourceViewerConfiguration
+        */
+       public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) {
+               return new PHPTextHover();
+       }
+}
diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPTextHover.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPTextHover.java
new file mode 100644 (file)
index 0000000..884a557
--- /dev/null
@@ -0,0 +1,50 @@
+/**********************************************************************
+Copyright (c) 2000, 2002 IBM Corp. and others.
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Common Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/cpl-v10.html
+
+Contributors:
+    IBM Corporation - Initial implementation
+    Klaus Hartlage - www.eclipseproject.de
+**********************************************************************/
+package net.sourceforge.phpeclipse.phpeditor;
+
+
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextHover;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.Region;
+
+/**
+ * Example implementation for an <code>ITextHover</code> which hovers over Java code.
+ */
+public class PHPTextHover implements ITextHover {
+
+       /* (non-Javadoc)
+        * Method declared on ITextHover
+        */
+       public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) {
+               if (hoverRegion != null) {
+                       try {
+                               if (hoverRegion.getLength() > -1)
+                                       return textViewer.getDocument().get(hoverRegion.getOffset(), hoverRegion.getLength());
+                       } catch (BadLocationException x) {
+                       }
+               }
+               return "empty selection";
+       }
+       
+       /* (non-Javadoc)
+        * Method declared on ITextHover
+        */
+       public IRegion getHoverRegion(ITextViewer textViewer, int offset) {
+               Point selection= textViewer.getSelectedRange();
+               if (selection.x <= offset && offset < selection.x + selection.y)
+                       return new Region(selection.x, selection.y);
+               return new Region(offset, 0);
+       }
+}
diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PresentationAction.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PresentationAction.java
new file mode 100644 (file)
index 0000000..784efcd
--- /dev/null
@@ -0,0 +1,53 @@
+/**********************************************************************
+Copyright (c) 2000, 2002 IBM Corp. and others.
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Common Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/cpl-v10.html
+
+Contributors:
+    IBM Corporation - Initial implementation
+    Klaus Hartlage - www.eclipseproject.de
+**********************************************************************/
+package net.sourceforge.phpeclipse.phpeditor;
+
+import java.util.ResourceBundle;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.ui.texteditor.TextEditorAction;
+
+/**
+ * A toolbar action which toggles the presentation model of the
+ * connected text editor. The editor shows either the highlight range
+ * only or always the whole document.
+ */
+public class PresentationAction extends TextEditorAction {
+
+       /**
+        * Constructs and updates the action.
+        */
+       public PresentationAction() {
+               super(PHPEditorMessages.getResourceBundle(), "TogglePresentation.", null); //$NON-NLS-1$
+               update();
+       }
+       
+       /* (non-Javadoc)
+        * Method declared on IAction
+        */
+       public void run() {
+
+               ITextEditor editor= getTextEditor();
+
+               editor.resetHighlightRange();
+               boolean show= editor.showsHighlightRangeOnly();
+               setChecked(!show);
+               editor.showHighlightRangeOnly(!show);
+       }
+       
+       /* (non-Javadoc)
+        * Method declared on TextEditorAction
+        */
+       public void update() {
+               setChecked(getTextEditor() != null && getTextEditor().showsHighlightRangeOnly());
+               setEnabled(true);
+       }
+}
diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPAutoIndentStrategy.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPAutoIndentStrategy.java
new file mode 100644 (file)
index 0000000..3850ccf
--- /dev/null
@@ -0,0 +1,271 @@
+/**********************************************************************
+Copyright (c) 2000, 2002 IBM Corp. and others.
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Common Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/cpl-v10.html
+
+Contributors:
+    IBM Corporation - Initial implementation
+    Klaus Hartlage - www.eclipseproject.de
+**********************************************************************/
+package net.sourceforge.phpeclipse.phpeditor.php;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.DefaultAutoIndentStrategy;
+import org.eclipse.jface.text.DocumentCommand;
+import org.eclipse.jface.text.IDocument;
+
+/**
+ * Auto indent strategy sensitive to brackets.
+ */
+public class PHPAutoIndentStrategy extends DefaultAutoIndentStrategy {
+
+       public PHPAutoIndentStrategy() {
+       }
+       
+       /* (non-Javadoc)
+        * Method declared on IAutoIndentStrategy
+        */
+       public void customizeDocumentCommand(IDocument d, DocumentCommand c) {
+               if (c.length == 0 && c.text != null && endsWithDelimiter(d, c.text))
+                       smartIndentAfterNewLine(d, c);
+               else if ("}".equals(c.text)) {  
+                       smartInsertAfterBracket(d, c);
+               }
+       }
+       
+       /**
+        * Returns whether or not the text ends with one of the given search strings.
+        */
+       private boolean endsWithDelimiter(IDocument d, String txt) {
+
+               String[] delimiters= d.getLegalLineDelimiters();
+
+               for (int i= 0; i < delimiters.length; i++) {
+                       if (txt.endsWith(delimiters[i]))
+                               return true;
+               }
+
+               return false;
+       }
+       
+       /**
+        * Returns the line number of the next bracket after end.
+        * @returns the line number of the next matching bracket after end
+        * @param document - the document being parsed
+        * @param line - the line to start searching back from
+        * @param end - the end position to search back from
+        * @param closingBracketIncrease - the number of brackets to skip
+        */
+        protected int findMatchingOpenBracket(IDocument document, int line, int end, int closingBracketIncrease) throws BadLocationException {
+
+               int start= document.getLineOffset(line);
+               int brackcount= getBracketCount(document, start, end, false) - closingBracketIncrease;
+
+               // sum up the brackets counts of each line (closing brackets count negative, 
+               // opening positive) until we find a line the brings the count to zero
+               while (brackcount < 0) {
+                       line--;
+                       if (line < 0) {
+                               return -1;
+                       }
+                       start= document.getLineOffset(line);
+                       end= start + document.getLineLength(line) - 1;
+                       brackcount += getBracketCount(document, start, end, false);
+               }
+               return line;
+       }
+       
+       /**
+        * Returns the bracket value of a section of text. Closing brackets have a value of -1 and 
+        * open brackets have a value of 1.
+        * @returns the line number of the next matching bracket after end
+        * @param document - the document being parsed
+        * @param start - the start position for the search
+        * @param end - the end position for the search
+        * @param ignoreCloseBrackets - whether or not to ignore closing brackets in the count
+        */
+        private int getBracketCount(IDocument document, int start, int end, boolean ignoreCloseBrackets) throws BadLocationException {
+
+               int begin = start;
+               int bracketcount= 0;
+               while (begin < end) {
+                       char curr= document.getChar(begin);
+                       begin++;
+                       switch (curr) {
+                               case '/' :
+                                       if (begin < end) {
+                                               char next= document.getChar(begin);
+                                               if (next == '*') {
+                                                       // a comment starts, advance to the comment end
+                                                       begin= getCommentEnd(document, begin + 1, end);
+                                               } else if (next == '/') {
+                                                       // '//'-comment: nothing to do anymore on this line 
+                                                       begin= end;
+                                               }
+                                       }
+                                       break;
+                               case '*' :
+                                       if (begin < end) {
+                                               char next= document.getChar(begin);
+                                               if (next == '/') {
+                                                       // we have been in a comment: forget what we read before
+                                                       bracketcount= 0;
+                                                       begin++;
+                                               }
+                                       }
+                                       break;
+                               case '{' :
+                                       bracketcount++;
+                                       ignoreCloseBrackets= false;
+                                       break;
+                               case '}' :
+                                       if (!ignoreCloseBrackets) {
+                                               bracketcount--;
+                                       }
+                                       break;
+                               case '"' :
+                               case '\'' :
+                                       begin= getStringEnd(document, begin, end, curr);
+                                       break;
+                               default :
+                                       }
+               }
+               return bracketcount;
+       }
+       
+       /**
+        * Returns the end position a comment starting at pos.
+        * @returns the end position a comment starting at pos
+        * @param document - the document being parsed
+        * @param position - the start position for the search
+        * @param end - the end position for the search
+        */
+        private int getCommentEnd(IDocument document, int position, int end) throws BadLocationException {
+               int currentPosition = position;
+               while (currentPosition < end) {
+                       char curr= document.getChar(currentPosition);
+                       currentPosition++;
+                       if (curr == '*') {
+                               if (currentPosition < end && document.getChar(currentPosition) == '/') {
+                                       return currentPosition + 1;
+                               }
+                       }
+               }
+               return end;
+       }
+       
+       /**
+        * Returns the String at line with the leading whitespace removed.
+        * @returns the String at line with the leading whitespace removed.
+        * @param document - the document being parsed
+        * @param line - the line being searched
+        */
+        protected String getIndentOfLine(IDocument document, int line) throws BadLocationException {
+               if (line > -1) {
+                       int start= document.getLineOffset(line);
+                       int end= start + document.getLineLength(line) - 1;
+                       int whiteend= findEndOfWhiteSpace(document, start, end);
+                       return document.get(start, whiteend - start);
+               } else {
+                       return ""; //$NON-NLS-1$
+               }
+       }
+       
+       /**
+        * Returns the position of the character in the document after position.
+        * @returns the next location of character.
+        * @param document - the document being parsed
+        * @param position - the position to start searching from
+        * @param end - the end of the document
+        * @param character - the character you are trying to match
+        */
+        private int getStringEnd(IDocument document, int position, int end, char character) throws BadLocationException {
+               int currentPosition = position;
+               while (currentPosition < end) {
+                       char currentCharacter= document.getChar(currentPosition);
+                       currentPosition++;
+                       if (currentCharacter == '\\') {
+                               // ignore escaped characters
+                               currentPosition++;
+                       } else if (currentCharacter == character) {
+                               return currentPosition;
+                       }
+               }
+               return end;
+       }
+       
+       /**
+        * Set the indent of a new line based on the command provided in the supplied document.
+        * @param document - the document being parsed
+        * @param command - the command being performed
+        */
+        protected void smartIndentAfterNewLine(IDocument document, DocumentCommand command) {
+
+               int docLength= document.getLength();
+               if (command.offset == -1 || docLength == 0)
+                       return;
+
+               try {
+                       int p= (command.offset == docLength ? command.offset - 1 : command.offset);
+                       int line= document.getLineOfOffset(p);
+
+                       StringBuffer buf= new StringBuffer(command.text);
+                       if (command.offset < docLength && document.getChar(command.offset) == '}') {
+                               int indLine= findMatchingOpenBracket(document, line, command.offset, 0);
+                               if (indLine == -1) {
+                                       indLine= line;
+                               }
+                               buf.append(getIndentOfLine(document, indLine));
+                       } else {
+                               int start= document.getLineOffset(line);
+                               int whiteend= findEndOfWhiteSpace(document, start, command.offset);
+                               buf.append(document.get(start, whiteend - start));
+                               if (getBracketCount(document, start, command.offset, true) > 0) {
+                                       buf.append('\t');
+                               }
+                       }
+                       command.text= buf.toString();
+
+               } catch (BadLocationException excp) {
+                       System.out.println(PHPEditorMessages.getString("AutoIndent.error.bad_location_1")); //$NON-NLS-1$
+               }
+       }
+       
+       /**
+        * Set the indent of a bracket based on the command provided in the supplied document.
+        * @param document - the document being parsed
+        * @param command - the command being performed
+        */
+        protected void smartInsertAfterBracket(IDocument document, DocumentCommand command) {
+               if (command.offset == -1 || document.getLength() == 0)
+                       return;
+
+               try {
+                       int p= (command.offset == document.getLength() ? command.offset - 1 : command.offset);
+                       int line= document.getLineOfOffset(p);
+                       int start= document.getLineOffset(line);
+                       int whiteend= findEndOfWhiteSpace(document, start, command.offset);
+
+                       // shift only when line does not contain any text up to the closing bracket
+                       if (whiteend == command.offset) {
+                               // evaluate the line with the opening bracket that matches out closing bracket
+                               int indLine= findMatchingOpenBracket(document, line, command.offset, 1);
+                               if (indLine != -1 && indLine != line) {
+                                       // take the indent of the found line
+                                       StringBuffer replaceText= new StringBuffer(getIndentOfLine(document, indLine));
+                                       // add the rest of the current line including the just added close bracket
+                                       replaceText.append(document.get(whiteend, command.offset - whiteend));
+                                       replaceText.append(command.text);
+                                       // modify document command
+                                       command.length= command.offset - start;
+                                       command.offset= start;
+                                       command.text= replaceText.toString();
+                               }
+                       }
+               } catch (BadLocationException excp) {
+                       System.out.println(PHPEditorMessages.getString("AutoIndent.error.bad_location_2")); //$NON-NLS-1$
+               }
+       }
+}
diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPCodeScanner.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPCodeScanner.java
new file mode 100644 (file)
index 0000000..84f31f4
--- /dev/null
@@ -0,0 +1,2466 @@
+/**********************************************************************
+Copyright (c) 2000, 2002 IBM Corp. and others.
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Common Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/cpl-v10.html
+
+Contributors:
+    IBM Corporation - Initial implementation
+    Klaus Hartlage - www.eclipseproject.de
+**********************************************************************/
+package net.sourceforge.phpeclipse.phpeditor.php;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import net.sourceforge.phpeclipse.phpeditor.util.PHPColorProvider;
+import net.sourceforge.phpeclipse.phpeditor.util.PHPWhitespaceDetector;
+import net.sourceforge.phpeclipse.phpeditor.util.PHPWordDetector;
+import org.eclipse.jface.text.TextAttribute;
+import org.eclipse.jface.text.rules.EndOfLineRule;
+import org.eclipse.jface.text.rules.IRule;
+import org.eclipse.jface.text.rules.IToken;
+import org.eclipse.jface.text.rules.MultiLineRule;
+import org.eclipse.jface.text.rules.RuleBasedScanner;
+import org.eclipse.jface.text.rules.SingleLineRule;
+import org.eclipse.jface.text.rules.Token;
+import org.eclipse.jface.text.rules.WhitespaceRule;
+import org.eclipse.jface.text.rules.WordRule;
+
+/**
+ * A Java code scanner.
+ */
+public class PHPCodeScanner extends RuleBasedScanner {
+
+       private static String[] fgKeywords =
+               {
+                       "if",
+                       "elseif",
+                       "else",
+                       "endif",
+                       "for",
+                       "endfor",
+                       "while",
+                       "endwhile",
+                       "switch",
+                       "case",
+                       "endswitch",
+                       "break",
+                       "continue",
+                       "return",
+                       "define",
+                       "include",
+                       "include_once",
+                       "require",
+                       "require_once",
+                       "function",
+                       "class",
+                       "new",
+                       "do",
+                       "old_function",
+                       "default",
+                       "global",
+                       "static",
+                       "foreach",
+                       "endforeach",
+                       "extends",
+                       "empty",
+                       "array",
+                       "isset",
+                       "echo",
+                       "var" };
+
+       private static String[] fgTypes =
+               {
+                       "COM_invoke",
+                       "COM_load",
+                       "abs",
+                       "accept_connect",
+                       "acos",
+                       "add",
+                       "add",
+                       "add_iovec",
+                       "addaction",
+                       "addcolor",
+                       "addcslashes",
+                       "addentry",
+                       "addfill",
+                       "addshape",
+                       "addslashes",
+                       "addstring",
+                       "addstring",
+                       "align",
+                       "apache_child_terminate",
+                       "apache_lookup_uri",
+                       "apache_lookup_uri",
+                       "apache_note",
+                       "apache_sub_req",
+                       "array_count_values",
+                       "array_diff",
+                       "array_filter",
+                       "array_flip",
+                       "array_intersect",
+                       "array_keys",
+                       "array_map",
+                       "array_merge",
+                       "array_merge_recursive",
+                       "array_multisort",
+                       "array_pad",
+                       "array_pop",
+                       "array_push",
+                       "array_rand",
+                       "array_reduce",
+                       "array_reverse",
+                       "array_search",
+                       "array_shift",
+                       "array_slice",
+                       "array_splice",
+                       "array_sum",
+                       "array_unique",
+                       "array_unshift",
+                       "array_values",
+                       "array_walk",
+                       "arsort",
+                       "asin",
+                       "asort",
+                       "aspell_check",
+                       "aspell_check_raw",
+                       "aspell_new",
+                       "aspell_suggest",
+                       "assert",
+                       "assert_options",
+                       "atan",
+                       "atan2",
+                       "base64_decode",
+                       "base64_encode",
+                       "base_convert",
+                       "basename",
+                       "bcadd",
+                       "bccomp",
+                       "bcdiv",
+                       "bcmod",
+                       "bcmul",
+                       "bcpow",
+                       "bcscale",
+                       "bcsqrt",
+                       "bcsub",
+                       "bin2hex",
+                       "bind",
+                       "bindec",
+                       "bindtextdomain",
+                       "build_iovec",
+                       "bzclose",
+                       "bzcompress",
+                       "bzdecompress",
+                       "bzerrno",
+                       "bzerror",
+                       "bzerrstr",
+                       "bzflush",
+                       "bzopen",
+                       "bzread",
+                       "bzwrite",
+                       "call_user_func",
+                       "call_user_func_array",
+                       "call_user_method",
+                       "call_user_method_array",
+                       "ccvs_add",
+                       "ccvs_auth",
+                       "ccvs_command",
+                       "ccvs_count",
+                       "ccvs_delete",
+                       "ccvs_done",
+                       "ccvs_init",
+                       "ccvs_lookup",
+                       "ccvs_new",
+                       "ccvs_report",
+                       "ccvs_return",
+                       "ccvs_reverse",
+                       "ccvs_sale",
+                       "ccvs_status",
+                       "ccvs_textvalue",
+                       "ccvs_void",
+                       "ceil",
+                       "chdir",
+                       "checkdate",
+                       "checkdnsrr",
+                       "checkdnsrr",
+                       "chgrp",
+                       "chmod",
+                       "chop",
+                       "chown",
+                       "chr",
+                       "chroot",
+                       "chroot",
+                       "chunk_split",
+                       "class_exists",
+                       "clearstatcache",
+                       "close",
+                       "closedir",
+                       "closelog",
+                       "com_get",
+                       "com_propget",
+                       "com_propput",
+                       "com_propset",
+                       "com_set",
+                       "compact",
+                       "confirm_cybermut_compiled",
+                       "confirm_extname_compiled",
+                       "connect",
+                       "connection_aborted",
+                       "connection_status",
+                       "constant",
+                       "convert_cyr_string",
+                       "copy",
+                       "cos",
+                       "count",
+                       "count_chars",
+                       "cpdf_add_annotation",
+                       "cpdf_add_outline",
+                       "cpdf_arc",
+                       "cpdf_begin_text",
+                       "cpdf_circle",
+                       "cpdf_clip",
+                       "cpdf_close",
+                       "cpdf_closepath",
+                       "cpdf_closepath_fill_stroke",
+                       "cpdf_closepath_stroke",
+                       "cpdf_continue_text",
+                       "cpdf_curveto",
+                       "cpdf_end_text",
+                       "cpdf_fill",
+                       "cpdf_fill_stroke",
+                       "cpdf_finalize",
+                       "cpdf_finalize_page",
+                       "cpdf_global_set_document_limits",
+                       "cpdf_import_jpeg",
+                       "cpdf_lineto",
+                       "cpdf_moveto",
+                       "cpdf_newpath",
+                       "cpdf_open",
+                       "cpdf_output_buffer",
+                       "cpdf_page_init",
+                       "cpdf_place_inline_image",
+                       "cpdf_rect",
+                       "cpdf_restore",
+                       "cpdf_rlineto",
+                       "cpdf_rmoveto",
+                       "cpdf_rotate",
+                       "cpdf_rotate_text",
+                       "cpdf_save",
+                       "cpdf_save_to_file",
+                       "cpdf_scale",
+                       "cpdf_set_action_url",
+                       "cpdf_set_char_spacing",
+                       "cpdf_set_creator",
+                       "cpdf_set_current_page",
+                       "cpdf_set_font",
+                       "cpdf_set_font_directories",
+                       "cpdf_set_font_map_file",
+                       "cpdf_set_horiz_scaling",
+                       "cpdf_set_keywords",
+                       "cpdf_set_leading",
+                       "cpdf_set_page_animation",
+                       "cpdf_set_subject",
+                       "cpdf_set_text_matrix",
+                       "cpdf_set_text_pos",
+                       "cpdf_set_text_rendering",
+                       "cpdf_set_text_rise",
+                       "cpdf_set_title",
+                       "cpdf_set_viewer_preferences",
+                       "cpdf_set_word_spacing",
+                       "cpdf_setdash",
+                       "cpdf_setflat",
+                       "cpdf_setgray",
+                       "cpdf_setgray_fill",
+                       "cpdf_setgray_stroke",
+                       "cpdf_setlinecap",
+                       "cpdf_setlinejoin",
+                       "cpdf_setlinewidth",
+                       "cpdf_setmiterlimit",
+                       "cpdf_setrgbcolor",
+                       "cpdf_setrgbcolor_fill",
+                       "cpdf_setrgbcolor_stroke",
+                       "cpdf_show",
+                       "cpdf_show_xy",
+                       "cpdf_stringwidth",
+                       "cpdf_stroke",
+                       "cpdf_text",
+                       "cpdf_translate",
+                       "crack_check",
+                       "crack_closedict",
+                       "crack_getlastmessage",
+                       "crack_opendict",
+                       "crash",
+                       "crc32",
+                       "create_function",
+                       "crypt",
+                       "crypt",
+                       "ctype_alnum",
+                       "ctype_alpha",
+                       "ctype_cntrl",
+                       "ctype_digit",
+                       "ctype_graph",
+                       "ctype_lower",
+                       "ctype_print",
+                       "ctype_punct",
+                       "ctype_space",
+                       "ctype_upper",
+                       "ctype_xdigit",
+                       "curl_close",
+                       "curl_errno",
+                       "curl_error",
+                       "curl_exec",
+                       "curl_getinfo",
+                       "curl_getinfo",
+                       "curl_init",
+                       "curl_setopt",
+                       "curl_version",
+                       "current",
+                       "cv_add",
+                       "cv_auth",
+                       "cv_command",
+                       "cv_count",
+                       "cv_delete",
+                       "cv_done",
+                       "cv_init",
+                       "cv_lookup",
+                       "cv_new",
+                       "cv_report",
+                       "cv_return",
+                       "cv_reverse",
+                       "cv_sale",
+                       "cv_status",
+                       "cv_textvalue",
+                       "cv_void",
+                       "cybercash_base64_decode",
+                       "cybercash_base64_encode",
+                       "cybercash_decr",
+                       "cybercash_encr",
+                       "cybermut_creerformulairecm",
+                       "cybermut_creerreponsecm",
+                       "cybermut_testmac",
+                       "date",
+                       "dba_close",
+                       "dba_delete",
+                       "dba_exists",
+                       "dba_fetch",
+                       "dba_firstkey",
+                       "dba_insert",
+                       "dba_nextkey",
+                       "dba_open",
+                       "dba_optimize",
+                       "dba_popen",
+                       "dba_replace",
+                       "dba_sync",
+                       "dbase_add_record",
+                       "dbase_close",
+                       "dbase_create",
+                       "dbase_delete_record",
+                       "dbase_get_record",
+                       "dbase_get_record_with_names",
+                       "dbase_numfields",
+                       "dbase_numrecords",
+                       "dbase_open",
+                       "dbase_pack",
+                       "dbase_replace_record",
+                       "dblist",
+                       "dbmclose",
+                       "dbmdelete",
+                       "dbmexists",
+                       "dbmfetch",
+                       "dbmfirstkey",
+                       "dbminsert",
+                       "dbmnextkey",
+                       "dbmopen",
+                       "dbmreplace",
+                       "dbx_close",
+                       "dbx_cmp_asc",
+                       "dbx_cmp_desc",
+                       "dbx_connect",
+                       "dbx_error",
+                       "dbx_query",
+                       "dbx_sort",
+                       "dcgettext",
+                       "decbin",
+                       "dechex",
+                       "decoct",
+                       "define",
+                       "define_syslog_variables",
+                       "defined",
+                       "deg2rad",
+                       "delete_iovec",
+                       "dgettext",
+                       "dir",
+                       "dirname",
+                       "diskfreespace",
+                       "display_disabled_function",
+                       "dl",
+                       "domxml_add_root",
+                       "domxml_attributes",
+                       "domxml_children",
+                       "domxml_dumpmem",
+                       "domxml_elem_get_attribute",
+                       "domxml_elem_set_attribute",
+                       "domxml_get_attribute",
+                       "domxml_getattr",
+                       "domxml_new_child",
+                       "domxml_new_xmldoc",
+                       "domxml_node",
+                       "domxml_node_attributes",
+                       "domxml_node_children",
+                       "domxml_node_new_child",
+                       "domxml_node_set_content",
+                       "domxml_node_unlink_node",
+                       "domxml_root",
+                       "domxml_set_attribute",
+                       "domxml_setattr",
+                       "domxml_unlink_node",
+                       "domxml_version",
+                       "doubleval",
+                       "drawarc",
+                       "drawcircle",
+                       "drawcubic",
+                       "drawcubicto",
+                       "drawcurve",
+                       "drawcurveto",
+                       "drawglyph",
+                       "drawline",
+                       "drawlineto",
+                       "each",
+                       "easter_date",
+                       "easter_days",
+                       "end",
+                       "ereg",
+                       "ereg_replace",
+                       "eregi",
+                       "eregi_replace",
+                       "error_log",
+                       "error_reporting",
+                       "escapeshellarg",
+                       "escapeshellcmd",
+                       "exec",
+                       "exit",
+                       "exp",
+                       "explode",
+                       "extension_loaded",
+                       "extract",
+                       "ezmlm_hash",
+                       "ezmlm_hash",
+                       "fbsql",
+                       "fbsql_affected_rows",
+                       "fbsql_autocommit",
+                       "fbsql_close",
+                       "fbsql_commit",
+                       "fbsql_connect",
+                       "fbsql_create_db",
+                       "fbsql_data_seek",
+                       "fbsql_database",
+                       "fbsql_database_password",
+                       "fbsql_db_query",
+                       "fbsql_drop_db",
+                       "fbsql_errno",
+                       "fbsql_error",
+                       "fbsql_fetch_array",
+                       "fbsql_fetch_assoc",
+                       "fbsql_fetch_field",
+                       "fbsql_fetch_lengths",
+                       "fbsql_fetch_object",
+                       "fbsql_fetch_row",
+                       "fbsql_field_flags",
+                       "fbsql_field_len",
+                       "fbsql_field_name",
+                       "fbsql_field_seek",
+                       "fbsql_field_table",
+                       "fbsql_field_type",
+                       "fbsql_free_result",
+                       "fbsql_hostname",
+                       "fbsql_insert_id",
+                       "fbsql_list_dbs",
+                       "fbsql_list_fields",
+                       "fbsql_list_tables",
+                       "fbsql_next_result",
+                       "fbsql_num_fields",
+                       "fbsql_num_rows",
+                       "fbsql_password",
+                       "fbsql_pconnect",
+                       "fbsql_query",
+                       "fbsql_result",
+                       "fbsql_rollback",
+                       "fbsql_select_db",
+                       "fbsql_start_db",
+                       "fbsql_stop_db",
+                       "fbsql_username",
+                       "fbsql_warnings",
+                       "fclose",
+                       "fd_alloc",
+                       "fd_clear",
+                       "fd_dealloc",
+                       "fd_isset",
+                       "fd_set",
+                       "fd_zero",
+                       "fdf_add_template",
+                       "fdf_close",
+                       "fdf_create",
+                       "fdf_get_file",
+                       "fdf_get_status",
+                       "fdf_get_value",
+                       "fdf_next_field_name",
+                       "fdf_open",
+                       "fdf_save",
+                       "fdf_set_ap",
+                       "fdf_set_file",
+                       "fdf_set_flags",
+                       "fdf_set_javascript_action",
+                       "fdf_set_opt",
+                       "fdf_set_status",
+                       "fdf_set_submit_form_action",
+                       "fdf_set_value",
+                       "feof",
+                       "fetch_iovec",
+                       "fflush",
+                       "fgetc",
+                       "fgetcsv",
+                       "fgets",
+                       "fgetss",
+                       "file",
+                       "file_exists",
+                       "fileatime",
+                       "filectime",
+                       "filegroup",
+                       "fileinode",
+                       "filemtime",
+                       "fileowner",
+                       "fileperms",
+                       "filepro",
+                       "filepro_fieldcount",
+                       "filepro_fieldname",
+                       "filepro_fieldtype",
+                       "filepro_fieldwidth",
+                       "filepro_retrieve",
+                       "filepro_rowcount",
+                       "filesize",
+                       "filetype",
+                       "flock",
+                       "floor",
+                       "flush",
+                       "fopen",
+                       "fopenstream",
+                       "fopenstream",
+                       "fpassthru",
+                       "fputs",
+                       "fread",
+                       "free_iovec",
+                       "frenchtojd",
+                       "fribidi_log2vis",
+                       "fscanf",
+                       "fseek",
+                       "fsockopen",
+                       "fstat",
+                       "ftell",
+                       "ftp_cdup",
+                       "ftp_chdir",
+                       "ftp_connect",
+                       "ftp_delete",
+                       "ftp_exec",
+                       "ftp_fget",
+                       "ftp_fput",
+                       "ftp_get",
+                       "ftp_login",
+                       "ftp_mdtm",
+                       "ftp_mkdir",
+                       "ftp_nlist",
+                       "ftp_pasv",
+                       "ftp_put",
+                       "ftp_pwd",
+                       "ftp_quit",
+                       "ftp_rawlist",
+                       "ftp_rename",
+                       "ftp_rmdir",
+                       "ftp_site",
+                       "ftp_size",
+                       "ftp_systype",
+                       "ftruncate",
+                       "func_get_arg",
+                       "func_get_args",
+                       "func_num_args",
+                       "function_exists",
+                       "fwrite",
+                       "get_all_headers",
+                       "get_browser",
+                       "get_cfg_var",
+                       "get_class",
+                       "get_class_methods",
+                       "get_class_vars",
+                       "get_current_user",
+                       "get_declared_classes",
+                       "get_defined_functions",
+                       "get_defined_vars",
+                       "get_extension_funcs",
+                       "get_html_translation_table",
+                       "get_included_files",
+                       "get_loaded_extensions",
+                       "get_magic_quotes_gpc",
+                       "get_magic_quotes_runtime",
+                       "get_meta_tags",
+                       "get_object_vars",
+                       "get_parent_class",
+                       "get_required_files",
+                       "get_resource_type",
+                       "getallheaders",
+                       "getallheaders",
+                       "getascent",
+                       "getascent",
+                       "getcwd",
+                       "getdate",
+                       "getdescent",
+                       "getdescent",
+                       "getenv",
+                       "getheight",
+                       "gethostbyaddr",
+                       "gethostbyaddr",
+                       "gethostbyname",
+                       "gethostbyname",
+                       "gethostbynamel",
+                       "getimagesize",
+                       "getlastmod",
+                       "getleading",
+                       "getleading",
+                       "getmxrr",
+                       "getmxrr",
+                       "getmyinode",
+                       "getmypid",
+                       "getmyuid",
+                       "getpeername",
+                       "getprotobyname",
+                       "getprotobynumber",
+                       "getrandmax",
+                       "getrusage",
+                       "getrusage",
+                       "getservbyname",
+                       "getservbyport",
+                       "getshape1",
+                       "getshape2",
+                       "getsockname",
+                       "getsockopt",
+                       "gettext",
+                       "gettimeofday",
+                       "gettype",
+                       "getwidth",
+                       "getwidth",
+                       "getwidth",
+                       "gmdate",
+                       "gmmktime",
+                       "gmp_abs",
+                       "gmp_add",
+                       "gmp_and",
+                       "gmp_clrbit",
+                       "gmp_cmp",
+                       "gmp_com",
+                       "gmp_div",
+                       "gmp_div_q",
+                       "gmp_div_qr",
+                       "gmp_div_r",
+                       "gmp_divexact",
+                       "gmp_fact",
+                       "gmp_gcd",
+                       "gmp_gcdext",
+                       "gmp_hamdist",
+                       "gmp_init",
+                       "gmp_intval",
+                       "gmp_invert",
+                       "gmp_jacobi",
+                       "gmp_legendre",
+                       "gmp_mod",
+                       "gmp_mul",
+                       "gmp_neg",
+                       "gmp_or",
+                       "gmp_perfect_square",
+                       "gmp_popcount",
+                       "gmp_pow",
+                       "gmp_powm",
+                       "gmp_prob_prime",
+                       "gmp_random",
+                       "gmp_scan0",
+                       "gmp_scan1",
+                       "gmp_setbit",
+                       "gmp_sign",
+                       "gmp_sqrt",
+                       "gmp_sqrtrem",
+                       "gmp_strval",
+                       "gmp_sub",
+                       "gmp_xor",
+                       "gmstrftime",
+                       "gmstrftime",
+                       "gregoriantojd",
+                       "gzclose",
+                       "gzcompress",
+                       "gzdeflate",
+                       "gzencode",
+                       "gzeof",
+                       "gzfile",
+                       "gzgetc",
+                       "gzgets",
+                       "gzgetss",
+                       "gzinflate",
+                       "gzopen",
+                       "gzpassthru",
+                       "gzputs",
+                       "gzread",
+                       "gzrewind",
+                       "gzseek",
+                       "gztell",
+                       "gzuncompress",
+                       "gzwrite",
+                       "header",
+                       "headers_sent",
+                       "hebrev",
+                       "hebrevc",
+                       "hexdec",
+                       "highlight_file",
+                       "highlight_string",
+                       "htmlentities",
+                       "htmlspecialchars",
+                       "hw_array2objrec",
+                       "hw_changeobject",
+                       "hw_children",
+                       "hw_childrenobj",
+                       "hw_close",
+                       "hw_connect",
+                       "hw_connection_info",
+                       "hw_cp",
+                       "hw_deleteobject",
+                       "hw_docbyanchor",
+                       "hw_docbyanchorobj",
+                       "hw_document_attributes",
+                       "hw_document_bodytag",
+                       "hw_document_content",
+                       "hw_document_setcontent",
+                       "hw_document_size",
+                       "hw_dummy",
+                       "hw_edittext",
+                       "hw_error",
+                       "hw_errormsg",
+                       "hw_free_document",
+                       "hw_getanchors",
+                       "hw_getanchorsobj",
+                       "hw_getandlock",
+                       "hw_getcgi",
+                       "hw_getchildcoll",
+                       "hw_getchildcollobj",
+                       "hw_getchilddoccoll",
+                       "hw_getchilddoccollobj",
+                       "hw_getobject",
+                       "hw_getobjectbyftquery",
+                       "hw_getobjectbyftquerycoll",
+                       "hw_getobjectbyftquerycollobj",
+                       "hw_getobjectbyftqueryobj",
+                       "hw_getobjectbyquery",
+                       "hw_getobjectbyquerycoll",
+                       "hw_getobjectbyquerycollobj",
+                       "hw_getobjectbyqueryobj",
+                       "hw_getparents",
+                       "hw_getparentsobj",
+                       "hw_getrellink",
+                       "hw_getremote",
+                       "hw_getremotechildren",
+                       "hw_getsrcbydestobj",
+                       "hw_gettext",
+                       "hw_getusername",
+                       "hw_identify",
+                       "hw_incollections",
+                       "hw_info",
+                       "hw_inscoll",
+                       "hw_insdoc",
+                       "hw_insertanchors",
+                       "hw_insertdocument",
+                       "hw_insertobject",
+                       "hw_mapid",
+                       "hw_modifyobject",
+                       "hw_mv",
+                       "hw_new_document",
+                       "hw_new_document_from_file",
+                       "hw_objrec2array",
+                       "hw_output_document",
+                       "hw_pconnect",
+                       "hw_pipecgi",
+                       "hw_pipedocument",
+                       "hw_root",
+                       "hw_setlinkroot",
+                       "hw_stat",
+                       "hw_unlock",
+                       "hw_who",
+                       "ibase_blob_add",
+                       "ibase_blob_cancel",
+                       "ibase_blob_close",
+                       "ibase_blob_create",
+                       "ibase_blob_echo",
+                       "ibase_blob_get",
+                       "ibase_blob_import",
+                       "ibase_blob_info",
+                       "ibase_blob_open",
+                       "ibase_close",
+                       "ibase_commit",
+                       "ibase_connect",
+                       "ibase_errmsg",
+                       "ibase_execute",
+                       "ibase_fetch_object",
+                       "ibase_fetch_row",
+                       "ibase_field_info",
+                       "ibase_free_query",
+                       "ibase_free_result",
+                       "ibase_num_fields",
+                       "ibase_pconnect",
+                       "ibase_prepare",
+                       "ibase_query",
+                       "ibase_rollback",
+                       "ibase_timefmt",
+                       "ibase_trans",
+                       "icap_create_calendar",
+                       "icap_delete_calendar",
+                       "icap_delete_event",
+                       "icap_fetch_event",
+                       "icap_list_alarms",
+                       "icap_list_events",
+                       "icap_open",
+                       "icap_popen",
+                       "icap_rename_calendar",
+                       "icap_reopen",
+                       "icap_snooze",
+                       "icap_store_event",
+                       "iconv",
+                       "iconv_get_encoding",
+                       "iconv_set_encoding",
+                       "ifx_affected_rows",
+                       "ifx_blobinfile_mode",
+                       "ifx_byteasvarchar",
+                       "ifx_close",
+                       "ifx_connect",
+                       "ifx_copy_blob",
+                       "ifx_create_blob",
+                       "ifx_create_char",
+                       "ifx_do",
+                       "ifx_error",
+                       "ifx_errormsg",
+                       "ifx_fetch_row",
+                       "ifx_fieldproperties",
+                       "ifx_fieldtypes",
+                       "ifx_free_blob",
+                       "ifx_free_char",
+                       "ifx_free_result",
+                       "ifx_get_blob",
+                       "ifx_get_char",
+                       "ifx_getsqlca",
+                       "ifx_htmltbl_result",
+                       "ifx_nullformat",
+                       "ifx_num_fields",
+                       "ifx_num_rows",
+                       "ifx_pconnect",
+                       "ifx_prepare",
+                       "ifx_query",
+                       "ifx_textasvarchar",
+                       "ifx_update_blob",
+                       "ifx_update_char",
+                       "ifxus_close_slob",
+                       "ifxus_create_slob",
+                       "ifxus_free_slob",
+                       "ifxus_open_slob",
+                       "ifxus_read_slob",
+                       "ifxus_seek_slob",
+                       "ifxus_tell_slob",
+                       "ifxus_write_slob",
+                       "ignore_user_abort",
+                       "iis_addserver",
+                       "iis_getdirsecurity",
+                       "iis_getscriptmap",
+                       "iis_getserverbycomment",
+                       "iis_getserverbypath",
+                       "iis_getserverright",
+                       "iis_getservicestate",
+                       "iis_removeserver",
+                       "iis_setappsettings",
+                       "iis_setdirsecurity",
+                       "iis_setscriptmap",
+                       "iis_setserverright",
+                       "iis_startserver",
+                       "iis_startservice",
+                       "iis_stopserver",
+                       "iis_stopservice",
+                       "image2wbmp",
+                       "imagealphablending",
+                       "imagearc",
+                       "imagechar",
+                       "imagecharup",
+                       "imagecolorallocate",
+                       "imagecolorat",
+                       "imagecolorclosest",
+                       "imagecolorclosestalpha",
+                       "imagecolorclosesthwb",
+                       "imagecolordeallocate",
+                       "imagecolorexact",
+                       "imagecolorexactalpha",
+                       "imagecolorresolve",
+                       "imagecolorresolvealpha",
+                       "imagecolorset",
+                       "imagecolorsforindex",
+                       "imagecolorstotal",
+                       "imagecolortransparent",
+                       "imagecopy",
+                       "imagecopymerge",
+                       "imagecopymergegray",
+                       "imagecopyresampled",
+                       "imagecopyresized",
+                       "imagecreate",
+                       "imagecreatefromgif",
+                       "imagecreatefromjpeg",
+                       "imagecreatefrompng",
+                       "imagecreatefromstring",
+                       "imagecreatefromwbmp",
+                       "imagecreatefromxbm",
+                       "imagecreatefromxpm",
+                       "imagecreatetruecolor",
+                       "imagedashedline",
+                       "imagedestroy",
+                       "imageellipse",
+                       "imagefill",
+                       "imagefilledarc",
+                       "imagefilledellipse",
+                       "imagefilledpolygon",
+                       "imagefilledrectangle",
+                       "imagefilltoborder",
+                       "imagefontheight",
+                       "imagefontwidth",
+                       "imagegammacorrect",
+                       "imagegif",
+                       "imageinterlace",
+                       "imagejpeg",
+                       "imageline",
+                       "imageloadfont",
+                       "imagepalettecopy",
+                       "imagepng",
+                       "imagepolygon",
+                       "imagepsbbox",
+                       "imagepscopyfont",
+                       "imagepsencodefont",
+                       "imagepsextendfont",
+                       "imagepsfreefont",
+                       "imagepsloadfont",
+                       "imagepsslantfont",
+                       "imagepstext",
+                       "imagerectangle",
+                       "imagesetbrush",
+                       "imagesetpixel",
+                       "imagesetstyle",
+                       "imagesetthickness",
+                       "imagesettile",
+                       "imagestring",
+                       "imagestringup",
+                       "imagesx",
+                       "imagesy",
+                       "imagetruecolortopalette",
+                       "imagettfbbox",
+                       "imagettftext",
+                       "imagetypes",
+                       "imagewbmp",
+                       "imap_8bit",
+                       "imap_alerts",
+                       "imap_append",
+                       "imap_base64",
+                       "imap_binary",
+                       "imap_body",
+                       "imap_bodystruct",
+                       "imap_check",
+                       "imap_clearflag_full",
+                       "imap_close",
+                       "imap_create",
+                       "imap_createmailbox",
+                       "imap_delete",
+                       "imap_deletemailbox",
+                       "imap_errors",
+                       "imap_expunge",
+                       "imap_fetch_overview",
+                       "imap_fetchbody",
+                       "imap_fetchheader",
+                       "imap_fetchstructure",
+                       "imap_fetchtext",
+                       "imap_get_quota",
+                       "imap_getmailboxes",
+                       "imap_getsubscribed",
+                       "imap_header",
+                       "imap_headerinfo",
+                       "imap_headers",
+                       "imap_last_error",
+                       "imap_list",
+                       "imap_listmailbox",
+                       "imap_listsubscribed",
+                       "imap_lsub",
+                       "imap_mail",
+                       "imap_mail",
+                       "imap_mail_compose",
+                       "imap_mail_copy",
+                       "imap_mail_move",
+                       "imap_mailboxmsginfo",
+                       "imap_mime_header_decode",
+                       "imap_msgno",
+                       "imap_num_msg",
+                       "imap_num_recent",
+                       "imap_open",
+                       "imap_ping",
+                       "imap_popen",
+                       "imap_qprint",
+                       "imap_rename",
+                       "imap_renamemailbox",
+                       "imap_reopen",
+                       "imap_rfc822_parse_adrlist",
+                       "imap_rfc822_parse_headers",
+                       "imap_rfc822_write_address",
+                       "imap_scan",
+                       "imap_scanmailbox",
+                       "imap_search",
+                       "imap_set_quota",
+                       "imap_setflag_full",
+                       "imap_sort",
+                       "imap_status",
+                       "imap_subscribe",
+                       "imap_uid",
+                       "imap_undelete",
+                       "imap_unsubscribe",
+                       "imap_utf7_decode",
+                       "imap_utf7_encode",
+                       "imap_utf8",
+                       "implode",
+                       "in_array",
+                       "ingres_autocommit",
+                       "ingres_close",
+                       "ingres_commit",
+                       "ingres_connect",
+                       "ingres_fetch_array",
+                       "ingres_fetch_object",
+                       "ingres_fetch_row",
+                       "ingres_field_length",
+                       "ingres_field_name",
+                       "ingres_field_nullable",
+                       "ingres_field_precision",
+                       "ingres_field_scale",
+                       "ingres_field_type",
+                       "ingres_num_fields",
+                       "ingres_num_rows",
+                       "ingres_pconnect",
+                       "ingres_query",
+                       "ingres_rollback",
+                       "ini_alter",
+                       "ini_get",
+                       "ini_restore",
+                       "ini_set",
+                       "intval",
+                       "ip2long",
+                       "iptcembed",
+                       "iptcparse",
+                       "ircg_channel_mode",
+                       "ircg_disconnect",
+                       "ircg_html_encode",
+                       "ircg_ignore_add",
+                       "ircg_ignore_del",
+                       "ircg_is_conn_alive",
+                       "ircg_join",
+                       "ircg_kick",
+                       "ircg_lookup_format_messages",
+                       "ircg_msg",
+                       "ircg_nick",
+                       "ircg_nickname_escape",
+                       "ircg_nickname_unescape",
+                       "ircg_notice",
+                       "ircg_part",
+                       "ircg_pconnect",
+                       "ircg_register_format_messages",
+                       "ircg_set_current",
+                       "ircg_topic",
+                       "ircg_whois",
+                       "is_array",
+                       "is_bool",
+                       "is_dir",
+                       "is_double",
+                       "is_executable",
+                       "is_file",
+                       "is_float",
+                       "is_int",
+                       "is_integer",
+                       "is_link",
+                       "is_long",
+                       "is_null",
+                       "is_numeric",
+                       "is_object",
+                       "is_readable",
+                       "is_real",
+                       "is_resource",
+                       "is_scalar",
+                       "is_string",
+                       "is_subclass_of",
+                       "is_uploaded_file",
+                       "is_writable",
+                       "is_writeable",
+                       "java_last_exception_clear",
+                       "java_last_exception_get",
+                       "jddayofweek",
+                       "jdmonthname",
+                       "jdtofrench",
+                       "jdtogregorian",
+                       "jdtojewish",
+                       "jdtojulian",
+                       "jdtounix",
+                       "jewishtojd",
+                       "join",
+                       "jpeg2wbmp",
+                       "juliantojd",
+                       "key",
+                       "krsort",
+                       "ksort",
+                       "labelframe",
+                       "labelframe",
+                       "lcg_value",
+                       "ldap_8859_to_t61",
+                       "ldap_add",
+                       "ldap_bind",
+                       "ldap_close",
+                       "ldap_compare",
+                       "ldap_connect",
+                       "ldap_count_entries",
+                       "ldap_delete",
+                       "ldap_dn2ufn",
+                       "ldap_err2str",
+                       "ldap_errno",
+                       "ldap_error",
+                       "ldap_explode_dn",
+                       "ldap_first_attribute",
+                       "ldap_first_entry",
+                       "ldap_first_reference",
+                       "ldap_free_result",
+                       "ldap_get_attributes",
+                       "ldap_get_dn",
+                       "ldap_get_entries",
+                       "ldap_get_option",
+                       "ldap_get_values",
+                       "ldap_get_values_len",
+                       "ldap_list",
+                       "ldap_mod_add",
+                       "ldap_mod_del",
+                       "ldap_mod_replace",
+                       "ldap_modify",
+                       "ldap_next_attribute",
+                       "ldap_next_entry",
+                       "ldap_next_reference",
+                       "ldap_parse_reference",
+                       "ldap_parse_result",
+                       "ldap_read",
+                       "ldap_rename",
+                       "ldap_search",
+                       "ldap_set_option",
+                       "ldap_t61_to_8859",
+                       "ldap_unbind",
+                       "leak",
+                       "levenshtein",
+                       "link",
+                       "link",
+                       "linkinfo",
+                       "linkinfo",
+                       "listen",
+                       "localeconv",
+                       "localtime",
+                       "log",
+                       "log10",
+                       "long2ip",
+                       "lstat",
+                       "ltrim",
+                       "magic_quotes_runtime",
+                       "mail",
+                       "mail",
+                       "max",
+                       "mcal_append_event",
+                       "mcal_close",
+                       "mcal_create_calendar",
+                       "mcal_date_compare",
+                       "mcal_date_valid",
+                       "mcal_day_of_week",
+                       "mcal_day_of_year",
+                       "mcal_days_in_month",
+                       "mcal_delete_calendar",
+                       "mcal_delete_event",
+                       "mcal_event_add_attribute",
+                       "mcal_event_init",
+                       "mcal_event_set_alarm",
+                       "mcal_event_set_category",
+                       "mcal_event_set_class",
+                       "mcal_event_set_description",
+                       "mcal_event_set_end",
+                       "mcal_event_set_recur_daily",
+                       "mcal_event_set_recur_monthly_mday",
+                       "mcal_event_set_recur_monthly_wday",
+                       "mcal_event_set_recur_none",
+                       "mcal_event_set_recur_weekly",
+                       "mcal_event_set_recur_yearly",
+                       "mcal_event_set_start",
+                       "mcal_event_set_title",
+                       "mcal_fetch_current_stream_event",
+                       "mcal_fetch_event",
+                       "mcal_is_leap_year",
+                       "mcal_list_alarms",
+                       "mcal_list_events",
+                       "mcal_next_recurrence",
+                       "mcal_open",
+                       "mcal_popen",
+                       "mcal_rename_calendar",
+                       "mcal_reopen",
+                       "mcal_snooze",
+                       "mcal_store_event",
+                       "mcal_time_valid",
+                       "mcal_week_of_year",
+                       "mcrypt_cbc",
+                       "mcrypt_cfb",
+                       "mcrypt_create_iv",
+                       "mcrypt_decrypt",
+                       "mcrypt_ecb",
+                       "mcrypt_enc_get_algorithms_name",
+                       "mcrypt_enc_get_block_size",
+                       "mcrypt_enc_get_iv_size",
+                       "mcrypt_enc_get_key_size",
+                       "mcrypt_enc_get_modes_name",
+                       "mcrypt_enc_get_supported_key_sizes",
+                       "mcrypt_enc_is_block_algorithm",
+                       "mcrypt_enc_is_block_algorithm_mode",
+                       "mcrypt_enc_is_block_mode",
+                       "mcrypt_enc_self_test",
+                       "mcrypt_encrypt",
+                       "mcrypt_generic",
+                       "mcrypt_generic_end",
+                       "mcrypt_generic_init",
+                       "mcrypt_get_block_size",
+                       "mcrypt_get_cipher_name",
+                       "mcrypt_get_iv_size",
+                       "mcrypt_get_key_size",
+                       "mcrypt_list_algorithms",
+                       "mcrypt_list_modes",
+                       "mcrypt_module_close",
+                       "mcrypt_module_get_algo_block_size",
+                       "mcrypt_module_get_algo_key_size",
+                       "mcrypt_module_get_supported_key_sizes",
+                       "mcrypt_module_is_block_algorithm",
+                       "mcrypt_module_is_block_algorithm_mode",
+                       "mcrypt_module_is_block_mode",
+                       "mcrypt_module_open",
+                       "mcrypt_module_self_test",
+                       "mcrypt_ofb",
+                       "md5",
+                       "mdecrypt_generic",
+                       "metaphone",
+                       "method_exists",
+                       "mhash",
+                       "mhash_count",
+                       "mhash_get_block_size",
+                       "mhash_get_hash_name",
+                       "mhash_keygen_s2k",
+                       "microtime",
+                       "min",
+                       "ming_setcubicthreshold",
+                       "ming_setscale",
+                       "mkdir",
+                       "mktime",
+                       "move",
+                       "move_uploaded_file",
+                       "movepen",
+                       "movepento",
+                       "moveto",
+                       "moveto",
+                       "moveto",
+                       "msql",
+                       "msql_affected_rows",
+                       "msql_close",
+                       "msql_connect",
+                       "msql_create_db",
+                       "msql_createdb",
+                       "msql_data_seek",
+                       "msql_db_query",
+                       "msql_dbname",
+                       "msql_drop_db",
+                       "msql_dropdb",
+                       "msql_error",
+                       "msql_fetch_array",
+                       "msql_fetch_field",
+                       "msql_fetch_object",
+                       "msql_fetch_row",
+                       "msql_field_flags",
+                       "msql_field_len",
+                       "msql_field_name",
+                       "msql_field_seek",
+                       "msql_field_table",
+                       "msql_field_type",
+                       "msql_fieldflags",
+                       "msql_fieldlen",
+                       "msql_fieldname",
+                       "msql_fieldtable",
+                       "msql_fieldtype",
+                       "msql_free_result",
+                       "msql_freeresult",
+                       "msql_list_dbs",
+                       "msql_list_fields",
+                       "msql_list_tables",
+                       "msql_listdbs",
+                       "msql_listfields",
+                       "msql_listtables",
+                       "msql_num_fields",
+                       "msql_num_rows",
+                       "msql_numfields",
+                       "msql_numrows",
+                       "msql_pconnect",
+                       "msql_query",
+                       "msql_regcase",
+                       "msql_result",
+                       "msql_select_db",
+                       "msql_selectdb",
+                       "msql_tablename",
+                       "mssql_affected_rows",
+                       "mssql_affected_rows",
+                       "mssql_close",
+                       "mssql_close",
+                       "mssql_close",
+                       "mssql_connect",
+                       "mssql_connect",
+                       "mssql_connect",
+                       "mssql_data_seek",
+                       "mssql_data_seek",
+                       "mssql_data_seek",
+                       "mssql_fetch_array",
+                       "mssql_fetch_array",
+                       "mssql_fetch_array",
+                       "mssql_fetch_batch",
+                       "mssql_fetch_field",
+                       "mssql_fetch_field",
+                       "mssql_fetch_field",
+                       "mssql_fetch_object",
+                       "mssql_fetch_object",
+                       "mssql_fetch_object",
+                       "mssql_fetch_row",
+                       "mssql_fetch_row",
+                       "mssql_fetch_row",
+                       "mssql_field_length",
+                       "mssql_field_name",
+                       "mssql_field_seek",
+                       "mssql_field_seek",
+                       "mssql_field_seek",
+                       "mssql_field_type",
+                       "mssql_free_result",
+                       "mssql_free_result",
+                       "mssql_free_result",
+                       "mssql_get_last_message",
+                       "mssql_get_last_message",
+                       "mssql_get_last_message",
+                       "mssql_min_client_severity",
+                       "mssql_min_error_severity",
+                       "mssql_min_error_severity",
+                       "mssql_min_message_severity",
+                       "mssql_min_message_severity",
+                       "mssql_min_server_severity",
+                       "mssql_next_result",
+                       "mssql_num_fields",
+                       "mssql_num_fields",
+                       "mssql_num_fields",
+                       "mssql_num_rows",
+                       "mssql_num_rows",
+                       "mssql_num_rows",
+                       "mssql_pconnect",
+                       "mssql_pconnect",
+                       "mssql_pconnect",
+                       "mssql_query",
+                       "mssql_query",
+                       "mssql_query",
+                       "mssql_result",
+                       "mssql_result",
+                       "mssql_result",
+                       "mssql_rows_affected",
+                       "mssql_select_db",
+                       "mssql_select_db",
+                       "mssql_select_db",
+                       "mt_getrandmax",
+                       "mt_rand",
+                       "mt_srand",
+                       "multcolor",
+                       "muscat_close",
+                       "muscat_get",
+                       "muscat_give",
+                       "muscat_setup",
+                       "muscat_setup_net",
+                       "mysql",
+                       "mysql_affected_rows",
+                       "mysql_close",
+                       "mysql_connect",
+                       "mysql_create_db",
+                       "mysql_createdb",
+                       "mysql_data_seek",
+                       "mysql_db_name",
+                       "mysql_db_query",
+                       "mysql_dbname",
+                       "mysql_drop_db",
+                       "mysql_dropdb",
+                       "mysql_errno",
+                       "mysql_error",
+                       "mysql_escape_string",
+                       "mysql_fetch_array",
+                       "mysql_fetch_assoc",
+                       "mysql_fetch_field",
+                       "mysql_fetch_lengths",
+                       "mysql_fetch_object",
+                       "mysql_fetch_row",
+                       "mysql_field_flags",
+                       "mysql_field_len",
+                       "mysql_field_name",
+                       "mysql_field_seek",
+                       "mysql_field_table",
+                       "mysql_field_type",
+                       "mysql_fieldflags",
+                       "mysql_fieldlen",
+                       "mysql_fieldname",
+                       "mysql_fieldtable",
+                       "mysql_fieldtype",
+                       "mysql_free_result",
+                       "mysql_freeresult",
+                       "mysql_get_client_info",
+                       "mysql_get_host_info",
+                       "mysql_get_proto_info",
+                       "mysql_get_server_info",
+                       "mysql_insert_id",
+                       "mysql_list_dbs",
+                       "mysql_list_fields",
+                       "mysql_list_tables",
+                       "mysql_listdbs",
+                       "mysql_listfields",
+                       "mysql_listtables",
+                       "mysql_num_fields",
+                       "mysql_num_rows",
+                       "mysql_numfields",
+                       "mysql_numrows",
+                       "mysql_pconnect",
+                       "mysql_query",
+                       "mysql_result",
+                       "mysql_select_db",
+                       "mysql_selectdb",
+                       "mysql_tablename",
+                       "mysql_unbuffered_query",
+                       "natcasesort",
+                       "natsort",
+                       "new_xmldoc",
+                       "next",
+                       "nextframe",
+                       "nextframe",
+                       "nl2br",
+                       "notes_body",
+                       "notes_copy_db",
+                       "notes_create_db",
+                       "notes_create_note",
+                       "notes_drop_db",
+                       "notes_find_note",
+                       "notes_header_info",
+                       "notes_list_msgs",
+                       "notes_mark_read",
+                       "notes_mark_unread",
+                       "notes_nav_create",
+                       "notes_search",
+                       "notes_unread",
+                       "notes_version",
+                       "number_format",
+                       "ob_end_clean",
+                       "ob_end_flush",
+                       "ob_get_contents",
+                       "ob_get_length",
+                       "ob_gzhandler",
+                       "ob_iconv_handler",
+                       "ob_implicit_flush",
+                       "ob_start",
+                       "ocibindbyname",
+                       "ocicancel",
+                       "ocicollappend",
+                       "ocicollassign",
+                       "ocicollassignelem",
+                       "ocicolldateappendelem",
+                       "ocicolldateassignelem",
+                       "ocicolldategetelem",
+                       "ocicollgetelem",
+                       "ocicollmax",
+                       "ocicollsize",
+                       "ocicolltrim",
+                       "ocicolumnisnull",
+                       "ocicolumnname",
+                       "ocicolumnprecision",
+                       "ocicolumnscale",
+                       "ocicolumnsize",
+                       "ocicolumntype",
+                       "ocicolumntyperaw",
+                       "ocicommit",
+                       "ocidefinebyname",
+                       "ocierror",
+                       "ociexecute",
+                       "ocifetch",
+                       "ocifetchinto",
+                       "ocifetchstatement",
+                       "ocifreecoll",
+                       "ocifreecursor",
+                       "ocifreedesc",
+                       "ocifreestatement",
+                       "ociinternaldebug",
+                       "ociloadlob",
+                       "ocilogoff",
+                       "ocilogon",
+                       "ocinewcollection",
+                       "ocinewcursor",
+                       "ocinewdescriptor",
+                       "ocinlogon",
+                       "ocinumcols",
+                       "ociparse",
+                       "ociplogon",
+                       "ociresult",
+                       "ocirollback",
+                       "ocirowcount",
+                       "ocisavelob",
+                       "ocisavelobfile",
+                       "ociserverversion",
+                       "ocisetprefetch",
+                       "ocistatementtype",
+                       "ociwritelobtofile",
+                       "octdec",
+                       "odbc_autocommit",
+                       "odbc_binmode",
+                       "odbc_close",
+                       "odbc_close_all",
+                       "odbc_columnprivileges",
+                       "odbc_columns",
+                       "odbc_commit",
+                       "odbc_connect",
+                       "odbc_cursor",
+                       "odbc_do",
+                       "odbc_error",
+                       "odbc_errormsg",
+                       "odbc_exec",
+                       "odbc_execute",
+                       "odbc_fetch_array",
+                       "odbc_fetch_into",
+                       "odbc_fetch_object",
+                       "odbc_fetch_row",
+                       "odbc_field_len",
+                       "odbc_field_name",
+                       "odbc_field_num",
+                       "odbc_field_precision",
+                       "odbc_field_scale",
+                       "odbc_field_type",
+                       "odbc_foreignkeys",
+                       "odbc_free_result",
+                       "odbc_gettypeinfo",
+                       "odbc_longreadlen",
+                       "odbc_next_result",
+                       "odbc_num_fields",
+                       "odbc_num_rows",
+                       "odbc_pconnect",
+                       "odbc_prepare",
+                       "odbc_primarykeys",
+                       "odbc_procedurecolumns",
+                       "odbc_procedures",
+                       "odbc_result",
+                       "odbc_result_all",
+                       "odbc_rollback",
+                       "odbc_setoption",
+                       "odbc_specialcolumns",
+                       "odbc_statistics",
+                       "odbc_tableprivileges",
+                       "odbc_tables",
+                       "open_listen_sock",
+                       "opendir",
+                       "openlog",
+                       "openssl_error_string",
+                       "openssl_free_key",
+                       "openssl_get_privatekey",
+                       "openssl_get_publickey",
+                       "openssl_open",
+                       "openssl_pkcs7_decrypt",
+                       "openssl_pkcs7_encrypt",
+                       "openssl_pkcs7_sign",
+                       "openssl_pkcs7_verify",
+                       "openssl_seal",
+                       "openssl_sign",
+                       "openssl_verify",
+                       "openssl_x509_checkpurpose",
+                       "openssl_x509_free",
+                       "openssl_x509_parse",
+                       "openssl_x509_read",
+                       "ora_bind",
+                       "ora_close",
+                       "ora_columnname",
+                       "ora_columnsize",
+                       "ora_columntype",
+                       "ora_commit",
+                       "ora_commitoff",
+                       "ora_commiton",
+                       "ora_do",
+                       "ora_error",
+                       "ora_errorcode",
+                       "ora_exec",
+                       "ora_fetch",
+                       "ora_fetch_into",
+                       "ora_getcolumn",
+                       "ora_logoff",
+                       "ora_logon",
+                       "ora_numcols",
+                       "ora_numrows",
+                       "ora_open",
+                       "ora_parse",
+                       "ora_plogon",
+                       "ora_rollback",
+                       "orbit_caught_exception",
+                       "orbit_exception_id",
+                       "orbit_exception_value",
+                       "orbit_get_repository_id",
+                       "orbit_load_idl",
+                       "ord",
+                       "output",
+                       "ovrimos_close",
+                       "ovrimos_close_all",
+                       "ovrimos_commit",
+                       "ovrimos_connect",
+                       "ovrimos_cursor",
+                       "ovrimos_exec",
+                       "ovrimos_execute",
+                       "ovrimos_fetch_into",
+                       "ovrimos_fetch_row",
+                       "ovrimos_field_len",
+                       "ovrimos_field_name",
+                       "ovrimos_field_num",
+                       "ovrimos_field_type",
+                       "ovrimos_free_result",
+                       "ovrimos_longreadlen",
+                       "ovrimos_num_fields",
+                       "ovrimos_num_rows",
+                       "ovrimos_prepare",
+                       "ovrimos_result",
+                       "ovrimos_result_all",
+                       "ovrimos_rollback",
+                       "pack",
+                       "parse_ini_file",
+                       "parse_str",
+                       "parse_url",
+                       "passthru",
+                       "pathinfo",
+                       "pclose",
+                       "pdf_add_annotation",
+                       "pdf_add_bookmark",
+                       "pdf_add_launchlink",
+                       "pdf_add_locallink",
+                       "pdf_add_note",
+                       "pdf_add_outline",
+                       "pdf_add_pdflink",
+                       "pdf_add_thumbnail",
+                       "pdf_add_weblink",
+                       "pdf_arc",
+                       "pdf_arcn",
+                       "pdf_attach_file",
+                       "pdf_begin_page",
+                       "pdf_begin_pattern",
+                       "pdf_begin_template",
+                       "pdf_circle",
+                       "pdf_clip",
+                       "pdf_close",
+                       "pdf_close_image",
+                       "pdf_close_pdi",
+                       "pdf_close_pdi_page",
+                       "pdf_closepath",
+                       "pdf_closepath_fill_stroke",
+                       "pdf_closepath_stroke",
+                       "pdf_concat",
+                       "pdf_continue_text",
+                       "pdf_curveto",
+                       "pdf_delete",
+                       "pdf_end_page",
+                       "pdf_end_pattern",
+                       "pdf_end_template",
+                       "pdf_endpath",
+                       "pdf_fill",
+                       "pdf_fill_stroke",
+                       "pdf_findfont",
+                       "pdf_get_buffer",
+                       "pdf_get_font",
+                       "pdf_get_fontname",
+                       "pdf_get_fontsize",
+                       "pdf_get_image_height",
+                       "pdf_get_image_width",
+                       "pdf_get_parameter",
+                       "pdf_get_pdi_parameter",
+                       "pdf_get_pdi_value",
+                       "pdf_get_value",
+                       "pdf_initgraphics",
+                       "pdf_lineto",
+                       "pdf_makespotcolor",
+                       "pdf_moveto",
+                       "pdf_new",
+                       "pdf_open",
+                       "pdf_open_ccitt",
+                       "pdf_open_file",
+                       "pdf_open_gif",
+                       "pdf_open_image",
+                       "pdf_open_image_file",
+                       "pdf_open_jpeg",
+                       "pdf_open_memory_image",
+                       "pdf_open_pdi",
+                       "pdf_open_pdi_page",
+                       "pdf_open_png",
+                       "pdf_open_tiff",
+                       "pdf_place_image",
+                       "pdf_place_pdi_page",
+                       "pdf_rect",
+                       "pdf_restore",
+                       "pdf_rotate",
+                       "pdf_save",
+                       "pdf_scale",
+                       "pdf_set_border_color",
+                       "pdf_set_border_dash",
+                       "pdf_set_border_style",
+                       "pdf_set_char_spacing",
+                       "pdf_set_duration",
+                       "pdf_set_font",
+                       "pdf_set_horiz_scaling",
+                       "pdf_set_info",
+                       "pdf_set_info_author",
+                       "pdf_set_info_creator",
+                       "pdf_set_info_keywords",
+                       "pdf_set_info_subject",
+                       "pdf_set_info_title",
+                       "pdf_set_leading",
+                       "pdf_set_parameter",
+                       "pdf_set_text_pos",
+                       "pdf_set_text_rendering",
+                       "pdf_set_text_rise",
+                       "pdf_set_transition",
+                       "pdf_set_value",
+                       "pdf_set_word_spacing",
+                       "pdf_setcolor",
+                       "pdf_setdash",
+                       "pdf_setflat",
+                       "pdf_setfont",
+                       "pdf_setgray",
+                       "pdf_setgray_fill",
+                       "pdf_setgray_stroke",
+                       "pdf_setlinecap",
+                       "pdf_setlinejoin",
+                       "pdf_setlinewidth",
+                       "pdf_setmatrix",
+                       "pdf_setmiterlimit",
+                       "pdf_setpolydash",
+                       "pdf_setrgbcolor",
+                       "pdf_setrgbcolor_fill",
+                       "pdf_setrgbcolor_stroke",
+                       "pdf_show",
+                       "pdf_show_boxed",
+                       "pdf_show_xy",
+                       "pdf_skew",
+                       "pdf_stringwidth",
+                       "pdf_stroke",
+                       "pdf_translate",
+                       "pfpro_cleanup",
+                       "pfpro_init",
+                       "pfpro_process",
+                       "pfpro_process_raw",
+                       "pfpro_version",
+                       "pfsockopen",
+                       "pg_client_encoding",
+                       "pg_clientencoding",
+                       "pg_close",
+                       "pg_cmdtuples",
+                       "pg_connect",
+                       "pg_dbname",
+                       "pg_end_copy",
+                       "pg_errormessage",
+                       "pg_exec",
+                       "pg_fetch_array",
+                       "pg_fetch_object",
+                       "pg_fetch_row",
+                       "pg_fieldisnull",
+                       "pg_fieldname",
+                       "pg_fieldnum",
+                       "pg_fieldprtlen",
+                       "pg_fieldsize",
+                       "pg_fieldtype",
+                       "pg_freeresult",
+                       "pg_getlastoid",
+                       "pg_host",
+                       "pg_loclose",
+                       "pg_locreate",
+                       "pg_loexport",
+                       "pg_loimport",
+                       "pg_loopen",
+                       "pg_loread",
+                       "pg_loreadall",
+                       "pg_lounlink",
+                       "pg_lowrite",
+                       "pg_numfields",
+                       "pg_numrows",
+                       "pg_options",
+                       "pg_pconnect",
+                       "pg_port",
+                       "pg_put_line",
+                       "pg_result",
+                       "pg_set_client_encoding",
+                       "pg_setclientencoding",
+                       "pg_trace",
+                       "pg_tty",
+                       "pg_untrace",
+                       "php_logo_guid",
+                       "php_sapi_name",
+                       "php_uname",
+                       "phpcredits",
+                       "phpinfo",
+                       "phpversion",
+                       "pi",
+                       "png2wbmp",
+                       "popen",
+                       "pos",
+                       "posix_ctermid",
+                       "posix_getcwd",
+                       "posix_getegid",
+                       "posix_geteuid",
+                       "posix_getgid",
+                       "posix_getgrgid",
+                       "posix_getgrnam",
+                       "posix_getgroups",
+                       "posix_getlogin",
+                       "posix_getpgid",
+                       "posix_getpgrp",
+                       "posix_getpid",
+                       "posix_getppid",
+                       "posix_getpwnam",
+                       "posix_getpwuid",
+                       "posix_getrlimit",
+                       "posix_getsid",
+                       "posix_getuid",
+                       "posix_isatty",
+                       "posix_kill",
+                       "posix_mkfifo",
+                       "posix_setegid",
+                       "posix_seteuid",
+                       "posix_setgid",
+                       "posix_setpgid",
+                       "posix_setsid",
+                       "posix_setuid",
+                       "posix_times",
+                       "posix_ttyname",
+                       "posix_uname",
+                       "pow",
+                       "preg_grep",
+                       "preg_match",
+                       "preg_match_all",
+                       "preg_quote",
+                       "preg_replace",
+                       "preg_replace_callback",
+                       "preg_split",
+                       "prev",
+                       "print_r",
+                       "printer_abort",
+                       "printer_close",
+                       "printer_create_brush",
+                       "printer_create_dc",
+                       "printer_create_font",
+                       "printer_create_pen",
+                       "printer_delete_brush",
+                       "printer_delete_dc",
+                       "printer_delete_font",
+                       "printer_delete_pen",
+                       "printer_draw_bmp",
+                       "printer_draw_chord",
+                       "printer_draw_elipse",
+                       "printer_draw_line",
+                       "printer_draw_pie",
+                       "printer_draw_rectangle",
+                       "printer_draw_roundrect",
+                       "printer_draw_text",
+                       "printer_end_doc",
+                       "printer_end_page",
+                       "printer_get_option",
+                       "printer_list",
+                       "printer_logical_fontheight",
+                       "printer_open",
+                       "printer_select_brush",
+                       "printer_select_font",
+                       "printer_select_pen",
+                       "printer_set_option",
+                       "printer_start_doc",
+                       "printer_start_page",
+                       "printer_write",
+                       "printf",
+                       "pspell_add_to_personal",
+                       "pspell_add_to_session",
+                       "pspell_check",
+                       "pspell_clear_session",
+                       "pspell_config_create",
+                       "pspell_config_ignore",
+                       "pspell_config_mode",
+                       "pspell_config_personal",
+                       "pspell_config_repl",
+                       "pspell_config_runtogether",
+                       "pspell_config_save_repl",
+                       "pspell_new",
+                       "pspell_new_config",
+                       "pspell_new_personal",
+                       "pspell_save_wordlist",
+                       "pspell_store_replacement",
+                       "pspell_suggest",
+                       "putenv",
+                       "putenv",
+                       "qdom_error",
+                       "qdom_tree",
+                       "quoted_printable_decode",
+                       "quotemeta",
+                       "rad2deg",
+                       "rand",
+                       "range",
+                       "rawurldecode",
+                       "rawurlencode",
+                       "read",
+                       "read_exif_data",
+                       "readdir",
+                       "readfile",
+                       "readgzfile",
+                       "readline",
+                       "readline_add_history",
+                       "readline_clear_history",
+                       "readline_completion_function",
+                       "readline_info",
+                       "readline_list_history",
+                       "readline_list_history",
+                       "readline_read_history",
+                       "readline_write_history",
+                       "readlink",
+                       "readlink",
+                       "readv",
+                       "realpath",
+                       "realpath",
+                       "recode",
+                       "recode_file",
+                       "recode_string",
+                       "recv",
+                       "recvfrom",
+                       "recvmsg",
+                       "register_shutdown_function",
+                       "register_tick_function",
+                       "remove",
+                       "remove",
+                       "rename",
+                       "reset",
+                       "restore_error_handler",
+                       "rewind",
+                       "rewinddir",
+                       "rmdir",
+                       "rotate",
+                       "rotateto",
+                       "rotateto",
+                       "round",
+                       "rsort",
+                       "rtrim",
+                       "satellite_caught_exception",
+                       "satellite_exception_id",
+                       "satellite_exception_value",
+                       "satellite_get_repository_id",
+                       "satellite_load_idl",
+                       "save",
+                       "savetofile",
+                       "scale",
+                       "scaleto",
+                       "scaleto",
+                       "select",
+                       "sem_acquire",
+                       "sem_get",
+                       "sem_release",
+                       "send",
+                       "sendmsg",
+                       "sendto",
+                       "serialize",
+                       "session_cache_limiter",
+                       "session_decode",
+                       "session_destroy",
+                       "session_encode",
+                       "session_get_cookie_params",
+                       "session_id",
+                       "session_is_registered",
+                       "session_module_name",
+                       "session_name",
+                       "session_register",
+                       "session_save_path",
+                       "session_set_cookie_params",
+                       "session_set_save_handler",
+                       "session_start",
+                       "session_unregister",
+                       "session_unset",
+                       "session_write_close",
+                       "set_content",
+                       "set_error_handler",
+                       "set_file_buffer",
+                       "set_iovec",
+                       "set_magic_quotes_runtime",
+                       "set_nonblock",
+                       "set_socket_blocking",
+                       "set_time_limit",
+                       "setaction",
+                       "setbackground",
+                       "setbounds",
+                       "setcolor",
+                       "setcolor",
+                       "setcookie",
+                       "setdepth",
+                       "setdimension",
+                       "setdown",
+                       "setfont",
+                       "setfont",
+                       "setframes",
+                       "setframes",
+                       "setheight",
+                       "setheight",
+                       "sethit",
+                       "setindentation",
+                       "setleftfill",
+                       "setleftmargin",
+                       "setline",
+                       "setlinespacing",
+                       "setlocale",
+                       "setmargins",
+                       "setmatrix",
+                       "setname",
+                       "setname",
+                       "setover",
+                       "setrate",
+                       "setratio",
+                       "setrightfill",
+                       "setrightmargin",
+                       "setsockopt",
+                       "setspacing",
+                       "settype",
+                       "setup",
+                       "shell_exec",
+                       "shm_attach",
+                       "shm_detach",
+                       "shm_get_var",
+                       "shm_put_var",
+                       "shm_remove",
+                       "shm_remove_var",
+                       "shmop_close",
+                       "shmop_delete",
+                       "shmop_open",
+                       "shmop_read",
+                       "shmop_size",
+                       "shmop_write",
+                       "show_source",
+                       "shuffle",
+                       "shutdown",
+                       "signal",
+                       "similar_text",
+                       "sin",
+                       "sizeof",
+                       "skewx",
+                       "skewxto",
+                       "skewxto",
+                       "skewy",
+                       "skewyto",
+                       "skewyto",
+                       "sleep",
+                       "snmp_get_quick_print",
+                       "snmp_set_quick_print",
+                       "snmpget",
+                       "snmpget",
+                       "snmprealwalk",
+                       "snmpset",
+                       "snmpwalk",
+                       "snmpwalk",
+                       "snmpwalkoid",
+                       "socket",
+                       "socket_get_status",
+                       "socket_set_blocking",
+                       "socket_set_timeout",
+                       "socket_set_timeout",
+                       "socketpair",
+                       "sort",
+                       "soundex",
+                       "split",
+                       "spliti",
+                       "sprintf",
+                       "sql_regcase",
+                       "sqrt",
+                       "srand",
+                       "sscanf",
+                       "stat",
+                       "str_pad",
+                       "str_repeat",
+                       "str_replace",
+                       "strcasecmp",
+                       "strchr",
+                       "strcmp",
+                       "strcoll",
+                       "strcoll",
+                       "strcspn",
+                       "streammp3",
+                       "strerror",
+                       "strftime",
+                       "strftime",
+                       "strip_tags",
+                       "stripcslashes",
+                       "stripslashes",
+                       "stristr",
+                       "strlen",
+                       "strnatcasecmp",
+                       "strnatcmp",
+                       "strncasecmp",
+                       "strncmp",
+                       "strpos",
+                       "strrchr",
+                       "strrev",
+                       "strrpos",
+                       "strspn",
+                       "strstr",
+                       "strtok",
+                       "strtolower",
+                       "strtotime",
+                       "strtoupper",
+                       "strtr",
+                       "strval",
+                       "substr",
+                       "substr_count",
+                       "substr_replace",
+                       "swf_actiongeturl",
+                       "swf_actiongotoframe",
+                       "swf_actiongotolabel",
+                       "swf_actionnextframe",
+                       "swf_actionplay",
+                       "swf_actionprevframe",
+                       "swf_actionsettarget",
+                       "swf_actionstop",
+                       "swf_actiontogglequality",
+                       "swf_actionwaitforframe",
+                       "swf_addbuttonrecord",
+                       "swf_addcolor",
+                       "swf_closefile",
+                       "swf_definebitmap",
+                       "swf_definefont",
+                       "swf_defineline",
+                       "swf_definepoly",
+                       "swf_definerect",
+                       "swf_definetext",
+                       "swf_endbutton",
+                       "swf_enddoaction",
+                       "swf_endshape",
+                       "swf_endsymbol",
+                       "swf_fontsize",
+                       "swf_fontslant",
+                       "swf_fonttracking",
+                       "swf_getbitmapinfo",
+                       "swf_getfontinfo",
+                       "swf_getframe",
+                       "swf_labelframe",
+                       "swf_lookat",
+                       "swf_modifyobject",
+                       "swf_mulcolor",
+                       "swf_nextid",
+                       "swf_oncondition",
+                       "swf_openfile",
+                       "swf_ortho",
+                       "swf_ortho2",
+                       "swf_perspective",
+                       "swf_placeobject",
+                       "swf_polarview",
+                       "swf_popmatrix",
+                       "swf_posround",
+                       "swf_pushmatrix",
+                       "swf_removeobject",
+                       "swf_rotate",
+                       "swf_scale",
+                       "swf_setfont",
+                       "swf_setframe",
+                       "swf_shapearc",
+                       "swf_shapecurveto",
+                       "swf_shapecurveto3",
+                       "swf_shapefillbitmapclip",
+                       "swf_shapefillbitmaptile",
+                       "swf_shapefilloff",
+                       "swf_shapefillsolid",
+                       "swf_shapelinesolid",
+                       "swf_shapelineto",
+                       "swf_shapemoveto",
+                       "swf_showframe",
+                       "swf_startbutton",
+                       "swf_startdoaction",
+                       "swf_startshape",
+                       "swf_startsymbol",
+                       "swf_textwidth",
+                       "swf_translate",
+                       "swf_viewport",
+                       "swfaction",
+                       "swfbitmap",
+                       "swfbutton",
+                       "swfbutton_keypress",
+                       "swffill",
+                       "swffont",
+                       "swfgradient",
+                       "swfmorph",
+                       "swfmovie",
+                       "swfshape",
+                       "swfsprite",
+                       "swftext",
+                       "swftextfield",
+                       "sybase_affected_rows",
+                       "sybase_affected_rows",
+                       "sybase_close",
+                       "sybase_close",
+                       "sybase_connect",
+                       "sybase_connect",
+                       "sybase_data_seek",
+                       "sybase_data_seek",
+                       "sybase_fetch_array",
+                       "sybase_fetch_array",
+                       "sybase_fetch_field",
+                       "sybase_fetch_field",
+                       "sybase_fetch_object",
+                       "sybase_fetch_object",
+                       "sybase_fetch_row",
+                       "sybase_fetch_row",
+                       "sybase_field_seek",
+                       "sybase_field_seek",
+                       "sybase_free_result",
+                       "sybase_free_result",
+                       "sybase_get_last_message",
+                       "sybase_get_last_message",
+                       "sybase_min_client_severity",
+                       "sybase_min_error_severity",
+                       "sybase_min_message_severity",
+                       "sybase_min_server_severity",
+                       "sybase_num_fields",
+                       "sybase_num_fields",
+                       "sybase_num_rows",
+                       "sybase_num_rows",
+                       "sybase_pconnect",
+                       "sybase_pconnect",
+                       "sybase_query",
+                       "sybase_query",
+                       "sybase_result",
+                       "sybase_result",
+                       "sybase_select_db",
+                       "sybase_select_db",
+                       "symlink",
+                       "symlink",
+                       "syslog",
+                       "system",
+                       "tan",
+                       "tempnam",
+                       "textdomain",
+                       "time",
+                       "tmpfile",
+                       "touch",
+                       "trigger_error",
+                       "trim",
+                       "uasort",
+                       "ucfirst",
+                       "ucwords",
+                       "udm_add_search_limit",
+                       "udm_alloc_agent",
+                       "udm_api_version",
+                       "udm_clear_search_limits",
+                       "udm_errno",
+                       "udm_error",
+                       "udm_find",
+                       "udm_free_agent",
+                       "udm_free_ispell_data",
+                       "udm_free_res",
+                       "udm_get_doc_count",
+                       "udm_get_res_field",
+                       "udm_get_res_param",
+                       "udm_load_ispell_data",
+                       "udm_set_agent_param",
+                       "uksort",
+                       "umask",
+                       "uniqid",
+                       "uniqid",
+                       "unixtojd",
+                       "unlink",
+                       "unpack",
+                       "unregister_tick_function",
+                       "unserialize",
+                       "urldecode",
+                       "urlencode",
+                       "user_error",
+                       "usleep",
+                       "usort",
+                       "utf8_decode",
+                       "utf8_encode",
+                       "var_dump",
+                       "velocis_autocommit",
+                       "velocis_close",
+                       "velocis_commit",
+                       "velocis_connect",
+                       "velocis_exec",
+                       "velocis_fetch",
+                       "velocis_fieldname",
+                       "velocis_fieldnum",
+                       "velocis_freeresult",
+                       "velocis_off_autocommit",
+                       "velocis_result",
+                       "velocis_rollback",
+                       "virtual",
+                       "vpopmail_add_alias_domain",
+                       "vpopmail_add_alias_domain_ex",
+                       "vpopmail_add_domain",
+                       "vpopmail_add_domain_ex",
+                       "vpopmail_add_user",
+                       "vpopmail_auth_user",
+                       "vpopmail_del_domain",
+                       "vpopmail_del_domain_ex",
+                       "vpopmail_del_user",
+                       "vpopmail_error",
+                       "vpopmail_passwd",
+                       "vpopmail_set_user_quota",
+                       "wddx_add_vars",
+                       "wddx_deserialize",
+                       "wddx_packet_end",
+                       "wddx_packet_start",
+                       "wddx_serialize_value",
+                       "wddx_serialize_vars",
+                       "wordwrap",
+                       "write",
+                       "writev",
+                       "xml_error_string",
+                       "xml_get_current_byte_index",
+                       "xml_get_current_column_number",
+                       "xml_get_current_line_number",
+                       "xml_get_error_code",
+                       "xml_parse",
+                       "xml_parse_into_struct",
+                       "xml_parser_create",
+                       "xml_parser_create_ns",
+                       "xml_parser_free",
+                       "xml_parser_get_option",
+                       "xml_parser_set_option",
+                       "xml_set_character_data_handler",
+                       "xml_set_default_handler",
+                       "xml_set_element_handler",
+                       "xml_set_end_namespace_decl_handler",
+                       "xml_set_external_entity_ref_handler",
+                       "xml_set_notation_decl_handler",
+                       "xml_set_object",
+                       "xml_set_processing_instruction_handler",
+                       "xml_set_start_namespace_decl_handler",
+                       "xml_set_unparsed_entity_decl_handler",
+                       "xmldoc",
+                       "xmldocfile",
+                       "xmltree",
+                       "xpath_eval",
+                       "xpath_eval_expression",
+                       "xptr_eval",
+                       "xslt_closelog",
+                       "xslt_create",
+                       "xslt_errno",
+                       "xslt_error",
+                       "xslt_fetch_result",
+                       "xslt_free",
+                       "xslt_openlog",
+                       "xslt_output_begintransform",
+                       "xslt_output_endtransform",
+                       "xslt_process",
+                       "xslt_run",
+                       "xslt_set_base",
+                       "xslt_set_encoding",
+                       "xslt_set_error_handler",
+                       "xslt_set_sax_handler",
+                       "xslt_set_scheme_handler",
+                       "xslt_transform",
+                       "yaz_addinfo",
+                       "yaz_ccl_conf",
+                       "yaz_ccl_parse",
+                       "yaz_close",
+                       "yaz_connect",
+                       "yaz_database",
+                       "yaz_element",
+                       "yaz_errno",
+                       "yaz_error",
+                       "yaz_hits",
+                       "yaz_itemorder",
+                       "yaz_present",
+                       "yaz_range",
+                       "yaz_record",
+                       "yaz_scan",
+                       "yaz_scan_result",
+                       "yaz_search",
+                       "yaz_syntax",
+                       "yaz_wait",
+                       "yp_all",
+                       "yp_cat",
+                       "yp_err_string",
+                       "yp_errno",
+                       "yp_first",
+                       "yp_get_default_domain",
+                       "yp_master",
+                       "yp_match",
+                       "yp_next",
+                       "yp_order",
+                       "zend_logo_guid",
+                       "zend_test_func",
+                       "zend_version",
+                       "zzip_close",
+                       "zzip_closedir",
+                       "zzip_entry_compressedsize",
+                       "zzip_entry_compressionmethod",
+                       "zzip_entry_filesize",
+                       "zzip_entry_name",
+                       "zzip_open",
+                       "zzip_opendir",
+                       "zzip_read",
+                       "zzip_readdir" };
+
+       private static String[] fgConstants = { "__LINE__", "__FILE__", "true", "false" };
+       private TextAttribute fComment;
+       private TextAttribute fKeyword;
+       private TextAttribute fType;
+       private TextAttribute fString;
+       private PHPColorProvider fColorProvider;
+
+       /**
+        * Creates a Java code scanner
+        */
+       public PHPCodeScanner(PHPColorProvider provider) {
+
+               IToken keyword = new Token(new TextAttribute(provider.getColor(PHPColorProvider.KEYWORD)));
+               IToken type = new Token(new TextAttribute(provider.getColor(PHPColorProvider.TYPE)));
+               IToken string = new Token(new TextAttribute(provider.getColor(PHPColorProvider.STRING)));
+               IToken comment = new Token(new TextAttribute(provider.getColor(PHPColorProvider.SINGLE_LINE_COMMENT)));
+               IToken multi_comment = new Token(new TextAttribute(provider.getColor(PHPColorProvider.MULTI_LINE_COMMENT)));
+    IToken other = new Token(new TextAttribute(provider.getColor(PHPColorProvider.DEFAULT)));
+
+               List rules = new ArrayList();
+
+               // Add rule for single line comments.
+               rules.add(new EndOfLineRule("//", comment)); //$NON-NLS-1$
+    EndOfLineRule endOfLine = new EndOfLineRule("#", comment);
+    endOfLine.setColumnConstraint(0);
+    rules.add(endOfLine);
+    
+               // Add rule for strings and character constants.
+               rules.add(new SingleLineRule("\"", "\"", string, '\\')); //$NON-NLS-2$ //$NON-NLS-1$
+               rules.add(new SingleLineRule("'", "'", string, '\\')); //$NON-NLS-2$ //$NON-NLS-1$
+
+   // rules.add(new SingleLineRule("//", "//", php_comment));
+    rules.add(new MultiLineRule("/*", "*/", multi_comment));
+    
+               // Add generic whitespace rule.
+               rules.add(new WhitespaceRule(new PHPWhitespaceDetector()));
+
+               // Add word rule for keywords, types, and constants.
+               WordRule wordRule = new WordRule(new PHPWordDetector(), other);
+               for (int i = 0; i < fgKeywords.length; i++)
+                       wordRule.addWord(fgKeywords[i], keyword);
+               for (int i = 0; i < fgTypes.length; i++)
+                       wordRule.addWord(fgTypes[i], type);
+               for (int i = 0; i < fgConstants.length; i++)
+                       wordRule.addWord(fgConstants[i], type);
+               rules.add(wordRule);
+
+               IRule[] result = new IRule[rules.size()];
+               rules.toArray(result);
+               setRules(result);
+       }
+}
diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPCompletionProcessor.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPCompletionProcessor.java
new file mode 100644 (file)
index 0000000..601db7f
--- /dev/null
@@ -0,0 +1,151 @@
+/**********************************************************************
+Copyright (c) 2000, 2002 IBM Corp. and others.
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Common Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/cpl-v10.html
+
+Contributors:
+    IBM Corporation - Initial implementation
+    Klaus Hartlage - www.eclipseproject.de
+**********************************************************************/
+package net.sourceforge.phpeclipse.phpeditor.php;
+
+import java.text.MessageFormat;
+
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.TextPresentation;
+import org.eclipse.jface.text.contentassist.CompletionProposal;
+import org.eclipse.jface.text.contentassist.ContextInformation;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.text.contentassist.IContextInformation;
+import org.eclipse.jface.text.contentassist.IContextInformationPresenter;
+import org.eclipse.jface.text.contentassist.IContextInformationValidator;
+
+/**
+ * Example PHP completion processor.
+ */
+public class PHPCompletionProcessor implements IContentAssistProcessor {
+
+       /**
+        * Simple content assist tip closer. The tip is valid in a range
+        * of 5 characters around its popup location.
+        */
+       protected static class Validator implements IContextInformationValidator, IContextInformationPresenter {
+
+               protected int fInstallOffset;
+
+               /*
+                * @see IContextInformationValidator#isContextInformationValid(int)
+                */
+               public boolean isContextInformationValid(int offset) {
+                       return Math.abs(fInstallOffset - offset) < 5;
+               }
+
+               /*
+                * @see IContextInformationValidator#install(IContextInformation, ITextViewer, int)
+                */
+               public void install(IContextInformation info, ITextViewer viewer, int offset) {
+                       fInstallOffset = offset;
+               }
+
+               /*
+                * @see org.eclipse.jface.text.contentassist.IContextInformationPresenter#updatePresentation(int, TextPresentation)
+                */
+               public boolean updatePresentation(int documentPosition, TextPresentation presentation) {
+                       return false;
+               }
+       };
+
+       protected final static String[] fgProposals =
+       {
+               
+               "elseif",
+               "else",
+               "endif",
+    "endfor",
+               "for",
+    "if",
+               "while",
+               "endwhile",
+               "switch",
+               "case",
+               "endswitch",
+               "break",
+               "continue",
+               "return",
+               "define",
+               "include",
+               "include_once",
+               "require",
+               "require_once",
+               "function",
+               "class",
+               "new",
+               "do",
+               "old_function",
+               "default",
+               "global",
+               "static",
+               "foreach",
+               "endforeach",
+               "extends",
+               "empty",
+               "array",
+               "isset",
+               "echo",
+               "var" };
+       protected IContextInformationValidator fValidator = new Validator();
+
+       /* (non-Javadoc)
+        * Method declared on IContentAssistProcessor
+        */
+       public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int documentOffset) {
+               ICompletionProposal[] result = new ICompletionProposal[fgProposals.length];
+               for (int i = 0; i < fgProposals.length; i++) {
+                       IContextInformation info = new ContextInformation(fgProposals[i], MessageFormat.format(PHPEditorMessages.getString("CompletionProcessor.Proposal.ContextInfo.pattern"), new Object[] { fgProposals[i] })); //$NON-NLS-1$
+                       result[i] = new CompletionProposal(fgProposals[i], documentOffset, 0, fgProposals[i].length(), null, fgProposals[i], info, MessageFormat.format(PHPEditorMessages.getString("CompletionProcessor.Proposal.hoverinfo.pattern"), new Object[] { fgProposals[i] })); //$NON-NLS-1$
+               }
+               return result;
+       }
+
+       /* (non-Javadoc)
+        * Method declared on IContentAssistProcessor
+        */
+       public IContextInformation[] computeContextInformation(ITextViewer viewer, int documentOffset) {
+               IContextInformation[] result = new IContextInformation[5];
+               for (int i = 0; i < result.length; i++)
+                       result[i] = new ContextInformation(MessageFormat.format(PHPEditorMessages.getString("CompletionProcessor.ContextInfo.display.pattern"), new Object[] { new Integer(i), new Integer(documentOffset)}), //$NON-NLS-1$
+                       MessageFormat.format(PHPEditorMessages.getString("CompletionProcessor.ContextInfo.value.pattern"), new Object[] { new Integer(i), new Integer(documentOffset - 5), new Integer(documentOffset + 5)})); //$NON-NLS-1$
+               return result;
+       }
+
+       /* (non-Javadoc)
+        * Method declared on IContentAssistProcessor
+        */
+       public char[] getCompletionProposalAutoActivationCharacters() {
+               return new char[] { '.', '(' };
+       }
+
+       /* (non-Javadoc)
+        * Method declared on IContentAssistProcessor
+        */
+       public char[] getContextInformationAutoActivationCharacters() {
+               return new char[] { '#' };
+       }
+
+       /* (non-Javadoc)
+        * Method declared on IContentAssistProcessor
+        */
+       public IContextInformationValidator getContextInformationValidator() {
+               return fValidator;
+       }
+
+       /* (non-Javadoc)
+        * Method declared on IContentAssistProcessor
+        */
+       public String getErrorMessage() {
+               return null;
+       }
+}
diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPDoubleClickSelector.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPDoubleClickSelector.java
new file mode 100644 (file)
index 0000000..a45a352
--- /dev/null
@@ -0,0 +1,244 @@
+/**********************************************************************
+Copyright (c) 2000, 2002 IBM Corp. and others.
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Common Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/cpl-v10.html
+
+Contributors:
+    IBM Corporation - Initial implementation
+    Klaus Hartlage - www.eclipseproject.de
+**********************************************************************/
+package net.sourceforge.phpeclipse.phpeditor.php;
+
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITextDoubleClickStrategy;
+import org.eclipse.jface.text.ITextViewer;
+
+/**
+ * Double click strategy aware of PHP identifier syntax rules.
+ */
+public class PHPDoubleClickSelector implements ITextDoubleClickStrategy {
+
+       protected ITextViewer fText;
+       protected int fPos;
+       protected int fStartPos;
+       protected int fEndPos;
+
+       protected static char[] fgBrackets = { '{', '}', '(', ')', '[', ']', '"', '"' };
+
+       /* 
+        * Create a JavaDoubleClickSelector.
+        */
+       public PHPDoubleClickSelector() {
+               super();
+       }
+
+       /* (non-Javadoc)
+        * Method declared on ITextDoubleClickStrategy
+        */
+       public void doubleClicked(ITextViewer text) {
+
+               fPos = text.getSelectedRange().x;
+
+               if (fPos < 0)
+                       return;
+
+               fText = text;
+
+               if (!selectBracketBlock())
+                       selectWord();
+       }
+
+       /**
+        * Match the brackets at the current selection. Return true if successful,
+        * false otherwise.
+        */
+       protected boolean matchBracketsAt() {
+
+               char prevChar, nextChar;
+
+               int i;
+               int bracketIndex1 = fgBrackets.length;
+               int bracketIndex2 = fgBrackets.length;
+
+               fStartPos = -1;
+               fEndPos = -1;
+
+               // get the chars preceding and following the start position
+               try {
+
+                       IDocument doc = fText.getDocument();
+
+                       prevChar = doc.getChar(fPos - 1);
+                       nextChar = doc.getChar(fPos);
+
+                       // is the char either an open or close bracket?
+                       for (i = 0; i < fgBrackets.length; i = i + 2) {
+                               if (prevChar == fgBrackets[i]) {
+                                       fStartPos = fPos - 1;
+                                       bracketIndex1 = i;
+                               }
+                       }
+                       for (i = 1; i < fgBrackets.length; i = i + 2) {
+                               if (nextChar == fgBrackets[i]) {
+                                       fEndPos = fPos;
+                                       bracketIndex2 = i;
+                               }
+                       }
+
+                       if (fStartPos > -1 && bracketIndex1 < bracketIndex2) {
+                               fEndPos = searchForClosingBracket(fStartPos, prevChar, fgBrackets[bracketIndex1 + 1], doc);
+                               if (fEndPos > -1)
+                                       return true;
+                               else
+                                       fStartPos = -1;
+                       } else if (fEndPos > -1) {
+                               fStartPos = searchForOpenBracket(fEndPos, fgBrackets[bracketIndex2 - 1], nextChar, doc);
+                               if (fStartPos > -1)
+                                       return true;
+                               else
+                                       fEndPos = -1;
+                       }
+
+               } catch (BadLocationException x) {
+               }
+
+               return false;
+       }
+
+       /**
+        * Select the word at the current selection. Return true if successful,
+        * false otherwise.
+        */
+       protected boolean matchWord() {
+
+               IDocument doc = fText.getDocument();
+
+               try {
+
+                       int pos = fPos;
+                       char c;
+
+                       while (pos >= 0) {
+                               c = doc.getChar(pos);
+                               if (!Character.isJavaIdentifierPart(c) && (c != '$')) {
+                                       break;
+                               }
+                               --pos;
+                       }
+
+                       fStartPos = pos;
+
+                       pos = fPos;
+                       int length = doc.getLength();
+
+                       while (pos < length) {
+                               c = doc.getChar(pos);
+                               if (!Character.isJavaIdentifierPart(c) && (c != '$'))
+                                       break;
+                               ++pos;
+                       }
+
+                       fEndPos = pos;
+
+                       return true;
+
+               } catch (BadLocationException x) {
+               }
+
+               return false;
+       }
+
+       /**
+        * Returns the position of the closing bracket after startPosition.
+        * @returns the location of the closing bracket.
+        * @param startPosition - the beginning position
+        * @param openBracket - the character that represents the open bracket
+        * @param closeBracket - the character that represents the close bracket
+        * @param document - the document being searched
+        */
+       protected int searchForClosingBracket(int startPosition, char openBracket, char closeBracket, IDocument document)
+               throws BadLocationException {
+               int stack = 1;
+               int closePosition = startPosition + 1;
+               int length = document.getLength();
+               char nextChar;
+
+               while (closePosition < length && stack > 0) {
+                       nextChar = document.getChar(closePosition);
+                       if (nextChar == openBracket && nextChar != closeBracket)
+                               stack++;
+                       else if (nextChar == closeBracket)
+                               stack--;
+                       closePosition++;
+               }
+
+               if (stack == 0)
+                       return closePosition - 1;
+               else
+                       return -1;
+
+       }
+
+       /**
+        * Returns the position of the open bracket before startPosition.
+        * @returns the location of the starting bracket.
+        * @param startPosition - the beginning position
+        * @param openBracket - the character that represents the open bracket
+        * @param closeBracket - the character that represents the close bracket
+        * @param document - the document being searched
+        */
+       protected int searchForOpenBracket(int startPosition, char openBracket, char closeBracket, IDocument document)
+               throws BadLocationException {
+               int stack = 1;
+               int openPos = startPosition - 1;
+               char nextChar;
+
+               while (openPos >= 0 && stack > 0) {
+                       nextChar = document.getChar(openPos);
+                       if (nextChar == closeBracket && nextChar != openBracket)
+                               stack++;
+                       else if (nextChar == openBracket)
+                               stack--;
+                       openPos--;
+               }
+
+               if (stack == 0)
+                       return openPos + 1;
+               else
+                       return -1;
+       }
+
+       /**
+        * Select the area between the selected bracket and the closing bracket. Return
+        * true if successful.
+        */
+       protected boolean selectBracketBlock() {
+               if (matchBracketsAt()) {
+
+                       if (fStartPos == fEndPos)
+                               fText.setSelectedRange(fStartPos, 0);
+                       else
+                               fText.setSelectedRange(fStartPos + 1, fEndPos - fStartPos - 1);
+
+                       return true;
+               }
+               return false;
+       }
+
+       /**
+        * Select the word at the current selection. 
+        */
+       protected void selectWord() {
+               if (matchWord()) {
+
+                       if (fStartPos == fEndPos)
+                               fText.setSelectedRange(fStartPos, 0);
+                       else
+                               fText.setSelectedRange(fStartPos + 1, fEndPos - fStartPos - 1);
+               }
+       }
+}
diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPEditorMessages.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPEditorMessages.java
new file mode 100644 (file)
index 0000000..f8970bf
--- /dev/null
@@ -0,0 +1,41 @@
+/**********************************************************************
+Copyright (c) 2000, 2002 IBM Corp. and others.
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Common Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/cpl-v10.html
+
+Contributors:
+    IBM Corporation - Initial implementation
+    Klaus Hartlage - www.eclipseproject.de
+**********************************************************************/
+package net.sourceforge.phpeclipse.phpeditor.php;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class PHPEditorMessages {
+
+       private static final String RESOURCE_BUNDLE = "org.eclipse.ui.examples.javaeditor.JavaEditorMessages"; //$NON-NLS-1$
+
+       private static ResourceBundle fgResourceBundle = null;
+       // ResourceBundle.getBundle(RESOURCE_BUNDLE);
+
+       private PHPEditorMessages() {
+               if (fgResourceBundle == null) {
+                       try {
+                               fgResourceBundle = ResourceBundle.getBundle(RESOURCE_BUNDLE);
+                       } catch (MissingResourceException x) {
+                               fgResourceBundle = null;
+                       }
+               }
+       }
+
+       public static String getString(String key) {
+               try {
+                       return fgResourceBundle.getString(key);
+               } catch (MissingResourceException e) {
+                       return "!" + key + "!"; //$NON-NLS-2$ //$NON-NLS-1$
+               }
+       }
+}
diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPPartitionScanner.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPPartitionScanner.java
new file mode 100644 (file)
index 0000000..b96202a
--- /dev/null
@@ -0,0 +1,121 @@
+/**********************************************************************
+Copyright (c) 2000, 2002 IBM Corp. and others.
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Common Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/cpl-v10.html
+
+Contributors:
+    IBM Corporation - Initial implementation
+    Klaus Hartlage - www.eclipseproject.de
+**********************************************************************/
+package net.sourceforge.phpeclipse.phpeditor.php;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.eclipse.jface.text.rules.EndOfLineRule;
+import org.eclipse.jface.text.rules.ICharacterScanner;
+import org.eclipse.jface.text.rules.IPredicateRule;
+import org.eclipse.jface.text.rules.IRule;
+import org.eclipse.jface.text.rules.IToken;
+import org.eclipse.jface.text.rules.IWordDetector;
+import org.eclipse.jface.text.rules.MultiLineRule;
+import org.eclipse.jface.text.rules.RuleBasedPartitionScanner;
+import org.eclipse.jface.text.rules.RuleBasedScanner;
+import org.eclipse.jface.text.rules.SingleLineRule;
+import org.eclipse.jface.text.rules.Token;
+import org.eclipse.jface.text.rules.WordRule;
+
+/**
+ * This scanner recognizes the JavaDoc comments and Java multi line comments.
+ */
+public class PHPPartitionScanner extends RuleBasedPartitionScanner {
+
+       private final static String SKIP= "__skip"; //$NON-NLS-1$
+       public final static String JAVA_MULTILINE_COMMENT= "__html_multiline_comment"; //$NON-NLS-1$
+//     public final static String JAVA_DOC= "__java_javadoc"; //$NON-NLS-1$
+  public final static String PHP= "__php";
+       /**
+        * Detector for empty comments.
+        */
+       static class EmptyCommentDetector implements IWordDetector {
+
+               /* (non-Javadoc)
+               * Method declared on IWordDetector
+               */
+               public boolean isWordStart(char c) {
+                       return (c == '/');
+               }
+
+               /* (non-Javadoc)
+               * Method declared on IWordDetector
+               */
+               public boolean isWordPart(char c) {
+                       return (c == '*' || c == '/');
+               }
+       };
+       
+       /**
+        * 
+        */
+       static class WordPredicateRule extends WordRule implements IPredicateRule {
+               
+               private IToken fSuccessToken;
+               
+               public WordPredicateRule(IToken successToken) {
+                       super(new EmptyCommentDetector());
+                       fSuccessToken= successToken;
+                       addWord("/**/", fSuccessToken);
+               }
+               
+               /*
+                * @see org.eclipse.jface.text.rules.IPredicateRule#evaluate(ICharacterScanner, boolean)
+                */
+               public IToken evaluate(ICharacterScanner scanner, boolean resume) {
+                       return super.evaluate(scanner);
+               }
+
+               /*
+                * @see org.eclipse.jface.text.rules.IPredicateRule#getSuccessToken()
+                */
+               public IToken getSuccessToken() {
+                       return fSuccessToken;
+               }
+       };
+
+       /**
+        * Creates the partitioner and sets up the appropriate rules.
+        */
+       public PHPPartitionScanner() {
+               super();
+
+//             IToken javaDoc= new Token(JAVA_DOC);
+               IToken comment= new Token(JAVA_MULTILINE_COMMENT);
+    IToken php = new Token(PHP);
+               List rules= new ArrayList();
+
+               // Add rule for single line comments.
+       //      rules.add(new EndOfLineRule("//", Token.UNDEFINED));
+
+               // Add rule for strings and character constants.
+  //           rules.add(new SingleLineRule("\"", "\"", Token.UNDEFINED, '\\'));
+       //      rules.add(new SingleLineRule("'", "'", Token.UNDEFINED, '\\')); 
+
+               // Add special case word rule.
+               rules.add(new WordPredicateRule(comment));
+
+               // Add rules for multi-line comments and javadoc.
+               //rules.add(new MultiLineRule("/**", "*/", javaDoc));
+               rules.add(new MultiLineRule("<!--", "-->", comment)); 
+    rules.add(new MultiLineRule("<? ", "?>", php)); 
+    rules.add(new MultiLineRule("<?php", "?>", php)); 
+    rules.add(new MultiLineRule("<?PHP", "?>", php)); 
+    //Add rule for processing instructions
+
+
+               IPredicateRule[] result= new IPredicateRule[rules.size()];
+               rules.toArray(result);
+               setPredicateRules(result);
+       }
+}
diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPWordDetector.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPWordDetector.java
new file mode 100644 (file)
index 0000000..b0c471b
--- /dev/null
@@ -0,0 +1,69 @@
+/**********************************************************************
+Copyright (c) 2000, 2002 IBM Corp. and others.
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Common Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/cpl-v10.html
+
+Contributors:
+    IBM Corporation - Initial implementation
+    Klaus Hartlage - www.eclipseproject.de
+**********************************************************************/
+package net.sourceforge.phpeclipse.phpeditor.php;
+
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+
+/**
+ * Detects PHP words in documents.
+ */
+public class PHPWordDetector {
+
+       /**
+        * Find the location of the word at offset in document.
+        * @returns Point - x is the start position, y is the end position.
+        *      Return null if it is not found.
+        * @param document the document being searched.
+        * @param offset - the position to start searching from.
+        */
+       public static Point findWord(IDocument document, int offset) {
+
+               int start = -1;
+               int end = -1;
+
+               try {
+
+                       int position = offset;
+                       char character;
+
+                       while (position >= 0) {
+                               character = document.getChar(position);
+                               if (!Character.isJavaIdentifierPart(character) && (character != '$'))
+                                       break;
+                               --position;
+                       }
+
+                       start = position;
+
+                       position = offset;
+                       int length = document.getLength();
+
+                       while (position < length) {
+                               character = document.getChar(position);
+                               if (!Character.isJavaIdentifierPart(character) && (character != '$'))
+                                       break;
+                               ++position;
+                       }
+
+                       end = position;
+
+                       if (end > start)
+                               return new Point(start, end - start);
+
+               } catch (BadLocationException x) {
+               }
+
+               return null;
+       }
+}
diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/util/PHPColorProvider.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/util/PHPColorProvider.java
new file mode 100644 (file)
index 0000000..30b61f9
--- /dev/null
@@ -0,0 +1,57 @@
+/**********************************************************************
+Copyright (c) 2000, 2002 IBM Corp. and others.
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Common Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/cpl-v10.html
+
+Contributors:
+    IBM Corporation - Initial implementation
+    Klaus Hartlage - www.eclipseproject.de
+**********************************************************************/
+package net.sourceforge.phpeclipse.phpeditor.util;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * Manager for colors used in the Java editor
+ */
+public class PHPColorProvider {
+
+       public static final RGB MULTI_LINE_COMMENT= new RGB(128, 0, 0);
+       public static final RGB SINGLE_LINE_COMMENT= new RGB(128, 128, 0);
+       public static final RGB KEYWORD= new RGB(0, 0, 128);
+       public static final RGB TYPE= new RGB(0, 0, 128);
+       public static final RGB STRING= new RGB(0, 128, 0);
+       public static final RGB DEFAULT= new RGB(0, 0, 0);
+  public static final RGB HTML_DEFAULT= new RGB(0, 128, 128);
+
+
+       protected Map fColorTable= new HashMap(10);
+
+       /**
+        * Release all of the color resources held onto by the receiver.
+        */     
+       public void dispose() {
+               Iterator e= fColorTable.values().iterator();
+               while (e.hasNext())
+                        ((Color) e.next()).dispose();
+       }
+       
+       /**
+        * Return the Color that is stored in the Color table as rgb.
+        */
+       public Color getColor(RGB rgb) {
+               Color color= (Color) fColorTable.get(rgb);
+               if (color == null) {
+                       color= new Color(Display.getCurrent(), rgb);
+                       fColorTable.put(rgb, color);
+               }
+               return color;
+       }
+}
diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/util/PHPWhitespaceDetector.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/util/PHPWhitespaceDetector.java
new file mode 100644 (file)
index 0000000..1d2c944
--- /dev/null
@@ -0,0 +1,27 @@
+/**********************************************************************
+Copyright (c) 2000, 2002 IBM Corp. and others.
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Common Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/cpl-v10.html
+
+Contributors:
+    IBM Corporation - Initial implementation
+    Klaus Hartlage - www.eclipseproject.de
+**********************************************************************/
+package net.sourceforge.phpeclipse.phpeditor.util;
+
+import org.eclipse.jface.text.rules.IWhitespaceDetector;
+
+/**
+ * A java aware white space detector.
+ */
+public class PHPWhitespaceDetector implements IWhitespaceDetector {
+
+       /* (non-Javadoc)
+        * Method declared on IWhitespaceDetector
+        */
+       public boolean isWhitespace(char character) {
+               return Character.isWhitespace(character);
+       }
+}
diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/util/PHPWordDetector.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/util/PHPWordDetector.java
new file mode 100644 (file)
index 0000000..99e036f
--- /dev/null
@@ -0,0 +1,34 @@
+/**********************************************************************
+Copyright (c) 2000, 2002 IBM Corp. and others.
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Common Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/cpl-v10.html
+
+Contributors:
+    IBM Corporation - Initial implementation
+    Klaus Hartlage - www.eclipseproject.de
+**********************************************************************/
+package net.sourceforge.phpeclipse.phpeditor.util;
+
+import org.eclipse.jface.text.rules.IWordDetector;
+
+/**
+ * A Java aware word detector.
+ */
+public class PHPWordDetector implements IWordDetector {
+
+       /* (non-Javadoc)
+        * Method declared on IWordDetector.
+        */
+       public boolean isWordPart(char character) {
+               return Character.isJavaIdentifierPart(character);
+       }
+       
+       /* (non-Javadoc)
+        * Method declared on IWordDetector.
+        */
+       public boolean isWordStart(char character) {
+               return (character=='$')||Character.isJavaIdentifierStart(character);
+       }
+}