misc changes
authorkhartlage <khartlage>
Wed, 28 Apr 2004 20:32:15 +0000 (20:32 +0000)
committerkhartlage <khartlage>
Wed, 28 Apr 2004 20:32:15 +0000 (20:32 +0000)
net.sourceforge.phpeclipse/.project
net.sourceforge.phpeclipse/plugin.xml
net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/Compiler.java
net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/Parser.java
net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/builder/AdditionalTypeCollection.java [deleted file]
net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/builder/IncrementalImageBuilder.java
net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/builder/ReferenceCollection.java [deleted file]
net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/text/template/SQLProposal.java
net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/ui/PreferenceConstants.java

index 6487cef..6aa6c77 100644 (file)
@@ -4,7 +4,6 @@
        <comment></comment>
        <projects>
                <project>net.sourceforge.phpeclipse</project>
-               <project>net.sourceforge.phpeclipse.quantum</project>
                <project>net.sourceforge.phpeclipse.quantum.sql</project>
        </projects>
        <buildSpec>
index 67dadcc..4342e98 100644 (file)
@@ -3,7 +3,7 @@
 <plugin
    id="net.sourceforge.phpeclipse"
    name="%pluginName"
-   version="1.0.10"
+   version="1.1.0"
    provider-name="%providerName"
    class="net.sourceforge.phpeclipse.PHPeclipsePlugin">
 
@@ -17,7 +17,7 @@
       <import plugin="org.eclipse.ui"/>
       <import plugin="org.eclipse.ui.console"/>
       <import plugin="org.eclipse.core.resources"/>
-      <import plugin="org.eclipse.search"/>
+      <import plugin="org.eclipse.search"/> 
       <import plugin="org.eclipse.debug.core"/>
       <import plugin="org.eclipse.debug.ui"/>
       <import plugin="org.eclipse.compare"/>
@@ -33,7 +33,7 @@
       <import plugin="org.eclipse.search"/>
       <import plugin="org.apache.xerces"/>
       <import plugin="org.eclipse.update.ui"/>
-      <import plugin="com.quantum.Quantum"/>
+      <import plugin="net.sourceforge.phpeclipse.quantum.sql"/> 
    </requires>
 
    <extension
index b34f91a..a8f006c 100644 (file)
@@ -292,7 +292,7 @@ public class Compiler implements ITypeRequestor, ProblemSeverities {
         //                                                             new String(sourceUnits[i].getFileName())}));
         //                             }
         // initial type binding creation
-        lookupEnvironment.buildTypeBindings(parsedUnit);
+//        lookupEnvironment.buildTypeBindings(parsedUnit);
         this.addCompilationUnit(sourceUnits[i], parsedUnit);
         //} catch (AbortCompilationUnit e) {
         //requestor.acceptResult(unitResult.tagAsAccepted());
@@ -482,12 +482,12 @@ public class Compiler implements ITypeRequestor, ProblemSeverities {
    */
   public void process(CompilationUnitDeclaration unit, int i) {
     getMethodBodies(unit, i);
-    // fault in fields & methods
-    if (unit.scope != null)
+    // fault in fields & methods  
+    if (unit.scope != null)  
       unit.scope.faultInTypes();
     // verify inherited methods
-    if (unit.scope != null)
-      unit.scope.verifyMethods(lookupEnvironment.methodVerifier());
+//    if (unit.scope != null)
+//      unit.scope.verifyMethods(lookupEnvironment.methodVerifier());
     // type checking
     unit.resolve();
     // flow analysis
index ab95c81..8cf9f7e 100644 (file)
@@ -20,6 +20,7 @@ import net.sourceforge.phpdt.internal.compiler.problem.ProblemReporter;
 import net.sourceforge.phpeclipse.internal.compiler.ast.AbstractMethodDeclaration;
 import net.sourceforge.phpeclipse.internal.compiler.ast.AstNode;
 import net.sourceforge.phpeclipse.internal.compiler.ast.CompilationUnitDeclaration;
+import net.sourceforge.phpeclipse.internal.compiler.ast.FieldDeclaration;
 import net.sourceforge.phpeclipse.internal.compiler.ast.MethodDeclaration;
 import net.sourceforge.phpeclipse.internal.compiler.ast.SingleTypeReference;
 import net.sourceforge.phpeclipse.internal.compiler.ast.TypeDeclaration;
@@ -135,7 +136,7 @@ public class Parser //extends PHPParserSuperclass
   private void throwSyntaxError(String error) {
     int problemStartPosition = scanner.getCurrentTokenStartPosition();
     int problemEndPosition = scanner.getCurrentTokenEndPosition();
-    throwSyntaxError(error, problemStartPosition, problemEndPosition+1);
+    throwSyntaxError(error, problemStartPosition, problemEndPosition + 1);
   }
   /**
    * This method will throw the SyntaxError. It will add the good lines and
@@ -660,16 +661,16 @@ public class Parser //extends PHPParserSuperclass
       getNextToken();
       if (token == TokenNameLBRACE) {
         getNextToken();
+        if (token != TokenNameRBRACE) {
+          statementList();
+        }
+        if (token == TokenNameRBRACE) {
+          getNextToken();
+        } else {
+          throwSyntaxError("'}' expected after 'do' keyword.");
+        }
       } else {
-        throwSyntaxError("'{' expected after 'do' keyword.");
-      }
-      if (token != TokenNameRBRACE) {
-        statementList();
-      }
-      if (token == TokenNameRBRACE) {
-        getNextToken();
-      } else {
-        throwSyntaxError("'}' expected after 'do' keyword.");
+        statement(TokenNameEOF);
       }
       if (token == TokenNamewhile) {
         getNextToken();
@@ -850,9 +851,11 @@ public class Parser //extends PHPParserSuperclass
         throwSyntaxError("'{' expected in 'catch' statement.");
       }
       getNextToken();
-      statementList();
       if (token != TokenNameRBRACE) {
-        throwSyntaxError("'}' expected in 'catch' statement.");
+        statementList();
+        if (token != TokenNameRBRACE) {
+          throwSyntaxError("'}' expected in 'catch' statement.");
+        }
       }
       getNextToken();
       additional_catches();
@@ -1354,6 +1357,10 @@ public class Parser //extends PHPParserSuperclass
     // | T_VARIABLE '=' static_scalar
     do {
       if (token == TokenNameVariable) {
+        FieldDeclaration fieldDeclaration = new FieldDeclaration(null, scanner
+            .getCurrentIdentifierSource(), scanner
+            .getCurrentTokenStartPosition(), scanner
+            .getCurrentTokenEndPosition());
         getNextToken();
         if (token == TokenNameEQUAL) {
           getNextToken();
@@ -1532,10 +1539,8 @@ public class Parser //extends PHPParserSuperclass
         expr(); //constant();
         if (token == TokenNameCOLON || token == TokenNameSEMICOLON) {
           getNextToken();
-          if (token == TokenNamecase || token == TokenNamedefault) { // empty
-            // case
-            // statement
-            // ?
+          if (token == TokenNamecase || token == TokenNamedefault) { 
+            // empty case statement ?
             continue;
           }
           statementList();
@@ -1561,6 +1566,10 @@ public class Parser //extends PHPParserSuperclass
         getNextToken();
         if (token == TokenNameCOLON) {
           getNextToken();
+          if (token==TokenNameRBRACE) {
+            // empty default case
+            break;
+          }
           statementList();
         } else {
           throwSyntaxError("':' character after 'default' expected.");
diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/builder/AdditionalTypeCollection.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/builder/AdditionalTypeCollection.java
deleted file mode 100644 (file)
index 1979871..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation 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 API and implementation
- *******************************************************************************/
-package net.sourceforge.phpdt.internal.core.builder;
-
-public class AdditionalTypeCollection extends ReferenceCollection {
-
-char[][] definedTypeNames;
-
-protected AdditionalTypeCollection(char[][] definedTypeNames, char[][][] qualifiedReferences, char[][] simpleNameReferences) {
-       super(qualifiedReferences, simpleNameReferences);
-       this.definedTypeNames = definedTypeNames; // do not bother interning member type names (ie. 'A$M')
-}
-}
-
index ffbe886..91e2b85 100644 (file)
@@ -162,15 +162,15 @@ public class IncrementalImageBuilder extends AbstractImageBuilder {
       return;
     // the qualifiedStrings are of the form 'p1/p2' & the simpleStrings are
     // just 'X'
-    char[][][] qualifiedNames = ReferenceCollection
-        .internQualifiedNames(qualifiedStrings);
+//    char[][][] qualifiedNames = ReferenceCollection
+//        .internQualifiedNames(qualifiedStrings);
     // if a well known qualified name was found then we can skip over these
-    if (qualifiedNames.length < qualifiedStrings.size())
-      qualifiedNames = null;
-    char[][] simpleNames = ReferenceCollection.internSimpleNames(simpleStrings);
+//    if (qualifiedNames.length < qualifiedStrings.size())
+//      qualifiedNames = null;
+//    char[][] simpleNames = ReferenceCollection.internSimpleNames(simpleStrings);
     // if a well known name was found then we can skip over these
-    if (simpleNames.length < simpleStrings.size())
-      simpleNames = null;
+//    if (simpleNames.length < simpleStrings.size())
+//      simpleNames = null;
 //    Object[] keyTable = newState.references.keyTable;
 //    Object[] valueTable = newState.references.valueTable;
 //    next : for (int i = 0, l = valueTable.length; i < l; i++) {
diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/builder/ReferenceCollection.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/builder/ReferenceCollection.java
deleted file mode 100644 (file)
index 0691a69..0000000
+++ /dev/null
@@ -1,226 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation 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 API and implementation
- *******************************************************************************/
-package net.sourceforge.phpdt.internal.core.builder;
-
-import java.util.ArrayList;
-
-import net.sourceforge.phpdt.core.compiler.CharOperation;
-import net.sourceforge.phpdt.internal.compiler.lookup.TypeConstants;
-
-public class ReferenceCollection {
-
-char[][][] qualifiedNameReferences; // contains no simple names as in just 'a' which is kept in simpleNameReferences instead
-char[][] simpleNameReferences;
-
-protected ReferenceCollection(char[][][] qualifiedNameReferences, char[][] simpleNameReferences) {
-       this.qualifiedNameReferences = internQualifiedNames(qualifiedNameReferences);
-       this.simpleNameReferences = internSimpleNames(simpleNameReferences, true);
-}
-
-boolean includes(char[] simpleName) {
-       for (int i = 0, l = simpleNameReferences.length; i < l; i++)
-               if (simpleName == simpleNameReferences[i]) return true;
-       return false;
-}
-
-boolean includes(char[][] qualifiedName) {
-       for (int i = 0, l = qualifiedNameReferences.length; i < l; i++)
-               if (qualifiedName == qualifiedNameReferences[i]) return true;
-       return false;
-}
-
-boolean includes(char[][][] qualifiedNames, char[][] simpleNames) {
-       // if either collection of names is null, it means it contained a well known name so we know it already has a match
-       if (simpleNames == null || qualifiedNames == null) {
-               if (simpleNames == null && qualifiedNames == null) {
-                       if (PHPBuilder.DEBUG)
-                               System.out.println("Found well known match"); //$NON-NLS-1$
-                       return true;
-               } else if (qualifiedNames == null) {
-                       for (int i = 0, l = simpleNames.length; i < l; i++) {
-                               if (includes(simpleNames[i])) {
-                                       if (PHPBuilder.DEBUG)
-                                               System.out.println("Found match in well known package to " + new String(simpleNames[i])); //$NON-NLS-1$
-                                       return true;
-                               }
-                       }
-               } else {
-                       for (int i = 0, l = qualifiedNames.length; i < l; i++) {
-                               char[][] qualifiedName = qualifiedNames[i];
-                               if (qualifiedName.length == 1 ? includes(qualifiedName[0]) : includes(qualifiedName)) {
-                                       if (PHPBuilder.DEBUG)
-                                               System.out.println("Found well known match in " + CharOperation.toString(qualifiedName)); //$NON-NLS-1$
-                                       return true;
-                               }
-                       }
-               }
-       } else {
-               for (int i = 0, l = simpleNames.length; i < l; i++) {
-                       if (includes(simpleNames[i])) {
-                               for (int j = 0, m = qualifiedNames.length; j < m; j++) {
-                                       char[][] qualifiedName = qualifiedNames[j];
-                                       if (qualifiedName.length == 1 ? includes(qualifiedName[0]) : includes(qualifiedName)) {
-                                               if (PHPBuilder.DEBUG)
-                                                       System.out.println("Found match in " + CharOperation.toString(qualifiedName) //$NON-NLS-1$
-                                                               + " to " + new String(simpleNames[i])); //$NON-NLS-1$
-                                               return true;
-                                       }
-                               }
-                               return false;
-                       }
-               }
-       }
-       return false;
-}
-
-
-// When any type is compiled, its methods are verified for certain problems
-// the MethodVerifier requests 3 well known types which end up in the reference collection
-// having WellKnownQualifiedNames & WellKnownSimpleNames, saves every type 40 bytes
-// NOTE: These collections are sorted by length
-static final char[][][] WellKnownQualifiedNames = new char[][][] {
-       TypeConstants.JAVA_LANG_RUNTIMEEXCEPTION,
-       TypeConstants.JAVA_LANG_THROWABLE,
-       TypeConstants.JAVA_LANG_OBJECT,
-       TypeConstants.JAVA_LANG,
-       new char[][] {TypeConstants.JAVA},
-       new char[][] {new char[] {'o', 'r', 'g'}},
-       new char[][] {new char[] {'c', 'o', 'm'}},
-       CharOperation.NO_CHAR_CHAR}; // default package
-static final char[][] WellKnownSimpleNames = new char[][] {
-       TypeConstants.JAVA_LANG_RUNTIMEEXCEPTION[2],
-       TypeConstants.JAVA_LANG_THROWABLE[2],
-       TypeConstants.JAVA_LANG_OBJECT[2],
-       TypeConstants.JAVA,
-       TypeConstants.LANG,
-       new char[] {'o', 'r', 'g'},
-       new char[] {'c', 'o', 'm'}};
-
-static final char[][][] EmptyQualifiedNames = new char[0][][];
-static final char[][] EmptySimpleNames = CharOperation.NO_CHAR_CHAR;
-
-// each array contains qualified char[][], one for size 2, 3, 4, 5, 6, 7 & the rest
-static final int MaxQualifiedNames = 7;
-static ArrayList[] InternedQualifiedNames = new ArrayList[MaxQualifiedNames];
-// each array contains simple char[], one for size 1 to 29 & the rest
-static final int MaxSimpleNames = 30;
-static ArrayList[] InternedSimpleNames = new ArrayList[MaxSimpleNames];
-static {
-       for (int i = 0; i < MaxQualifiedNames; i++)
-               InternedQualifiedNames[i] = new ArrayList(37);
-       for (int i = 0; i < MaxSimpleNames; i++)
-               InternedSimpleNames[i] = new ArrayList(11);
-}
-
-static char[][][] internQualifiedNames(ArrayList qualifiedStrings) {
-       if (qualifiedStrings == null) return EmptyQualifiedNames;
-       int length = qualifiedStrings.size();
-       if (length == 0) return EmptyQualifiedNames;
-
-       char[][][] result = new char[length][][];
-       for (int i = 0; i < length; i++)
-               result[i] = CharOperation.splitOn('/', ((String) qualifiedStrings.get(i)).toCharArray());
-       return internQualifiedNames(result);
-}
-
-static char[][][] internQualifiedNames(char[][][] qualifiedNames) {
-       if (qualifiedNames == null) return EmptyQualifiedNames;
-       int length = qualifiedNames.length;
-       if (length == 0) return EmptyQualifiedNames;
-
-       char[][][] keepers = new char[length][][];
-       int index = 0;
-       next : for (int i = 0; i < length; i++) {
-               char[][] qualifiedName = qualifiedNames[i];
-               int qLength = qualifiedName.length;
-               for (int j = 0, m = WellKnownQualifiedNames.length; j < m; j++) {
-                       char[][] wellKnownName = WellKnownQualifiedNames[j];
-                       if (qLength > wellKnownName.length)
-                               break; // all remaining well known names are shorter
-                       if (CharOperation.equals(qualifiedName, wellKnownName))
-                               continue next;
-               }
-
-               // InternedQualifiedNames[0] is for the rest (> 7 & 1)
-               // InternedQualifiedNames[1] is for size 2...
-               // InternedQualifiedNames[6] is for size 7
-               ArrayList internedNames = InternedQualifiedNames[qLength <= MaxQualifiedNames ? qLength - 1 : 0];
-               for (int j = 0, m = internedNames.size(); j < m; j++) {
-                       char[][] internedName = (char[][]) internedNames.get(j);
-                       if (CharOperation.equals(qualifiedName, internedName)) {
-                               keepers[index++] = internedName;
-                               continue next;
-                       }
-               }
-               qualifiedName = internSimpleNames(qualifiedName, false);
-               internedNames.add(qualifiedName);
-               keepers[index++] = qualifiedName;
-       }
-       if (length > index) {
-               if (length == 0) return EmptyQualifiedNames;
-               System.arraycopy(keepers, 0, keepers = new char[index][][], 0, index);
-       }
-       return keepers;
-}
-
-static char[][] internSimpleNames(ArrayList simpleStrings) {
-       if (simpleStrings == null) return EmptySimpleNames;
-       int length = simpleStrings.size();
-       if (length == 0) return EmptySimpleNames;
-
-       char[][] result = new char[length][];
-       for (int i = 0; i < length; i++)
-               result[i] = ((String) simpleStrings.get(i)).toCharArray();
-       return internSimpleNames(result, true);
-}
-
-static char[][] internSimpleNames(char[][] simpleNames, boolean removeWellKnown) {
-       if (simpleNames == null) return EmptySimpleNames;
-       int length = simpleNames.length;
-       if (length == 0) return EmptySimpleNames;
-
-       char[][] keepers = new char[length][];
-       int index = 0;
-       next : for (int i = 0; i < length; i++) {
-               char[] name = simpleNames[i];
-               int sLength = name.length;
-               for (int j = 0, m = WellKnownSimpleNames.length; j < m; j++) {
-                       char[] wellKnownName = WellKnownSimpleNames[j];
-                       if (sLength > wellKnownName.length)
-                               break; // all remaining well known names are shorter
-                       if (CharOperation.equals(name, wellKnownName)) {
-                               if (!removeWellKnown)
-                                       keepers[index++] = WellKnownSimpleNames[j];
-                               continue next;
-                       }
-               }
-
-               // InternedSimpleNames[0] is for the rest (> 29)
-               // InternedSimpleNames[1] is for size 1...
-               // InternedSimpleNames[29] is for size 29
-               ArrayList internedNames = InternedSimpleNames[sLength < MaxSimpleNames ? sLength : 0];
-               for (int j = 0, m = internedNames.size(); j < m; j++) {
-                       char[] internedName = (char[]) internedNames.get(j);
-                       if (CharOperation.equals(name, internedName)) {
-                               keepers[index++] = internedName;
-                               continue next;
-                       }
-               }
-               internedNames.add(name);
-               keepers[index++] = name;
-       }
-       if (length > index) {
-               if (index == 0) return EmptySimpleNames;
-               System.arraycopy(keepers, 0, keepers = new char[index][], 0, index);
-       }
-       return keepers;
-}
-}
index 0ac931d..605de48 100644 (file)
@@ -4,7 +4,6 @@
  */
 package net.sourceforge.phpdt.internal.ui.text.template;
 import net.sourceforge.phpdt.internal.corext.template.TemplateContext;
-import net.sourceforge.phpdt.internal.corext.template.php.PHPUnitContext;
 import net.sourceforge.phpdt.internal.ui.text.link.LinkedPositionManager;
 import net.sourceforge.phpdt.internal.ui.text.link.LinkedPositionUI;
 import net.sourceforge.phpeclipse.PHPeclipsePlugin;
index 3dd481b..1110caa 100644 (file)
@@ -1846,7 +1846,7 @@ public class PreferenceConstants {
     store.setDefault(PreferenceConstants.EDITOR_LINE_NUMBER_RULER, false);
     PreferenceConverter.setDefault(store, PreferenceConstants.EDITOR_LINE_NUMBER_RULER_COLOR, new RGB(0, 0, 0));
 
-    WorkbenchChainedTextFontFieldEditor.startPropagate(store, JFaceResources.TEXT_FONT);
+//    WorkbenchChainedTextFontFieldEditor.startPropagate(store, JFaceResources.TEXT_FONT);
 
     PreferenceConverter.setDefault(store, PreferenceConstants.EDITOR_LINKED_POSITION_COLOR, new RGB(0, 200, 100));
     PreferenceConverter.setDefault(store, PreferenceConstants.EDITOR_LINK_COLOR, new RGB(0, 0, 255));