X-Git-Url: http://secure.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/text/template/DeclarationEngine.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/text/template/DeclarationEngine.java index f393c18..69781c9 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/text/template/DeclarationEngine.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/text/template/DeclarationEngine.java @@ -10,6 +10,7 @@ import java.util.SortedMap; import net.sourceforge.phpdt.core.ICompilationUnit; import net.sourceforge.phpdt.core.compiler.ITerminalSymbols; +import net.sourceforge.phpdt.core.compiler.ITerminalSymbols.TokenName; import net.sourceforge.phpdt.internal.corext.template.php.CompilationUnitContextType; import net.sourceforge.phpdt.internal.corext.template.php.JavaContext; import net.sourceforge.phpdt.internal.corext.template.php.JavaContextType; @@ -35,7 +36,7 @@ public class DeclarationEngine { private ArrayList fProposals = new ArrayList(); /** Token determines last which declarations are allowed for proposal */ - private int fLastSignificantToken; + private TokenName fLastSignificantToken; private IProject fProject; @@ -47,7 +48,7 @@ public class DeclarationEngine { * TemplateContext for supported context types. */ public DeclarationEngine(IProject project, JavaContextType contextType, - int lastSignificantToken, IFile file) { + TokenName lastSignificantToken, IFile file) { // Assert.isNotNull(contextType); fProject = project; fContextType = contextType; @@ -135,13 +136,13 @@ public class DeclarationEngine { location = (PHPIdentifierLocation) list.get(i); int type = location.getType(); switch (fLastSignificantToken) { - case ITerminalSymbols.TokenNameMINUS_GREATER: + case MINUS_GREATER: if (type != PHPIdentifierLocation.METHOD && type != PHPIdentifierLocation.VARIABLE) { continue; // for loop } break; - case ITerminalSymbols.TokenNameVariable: + case VARIABLE: if (type != PHPIdentifierLocation.METHOD && type != PHPIdentifierLocation.VARIABLE) { continue; // for loop @@ -151,7 +152,7 @@ public class DeclarationEngine { // continue; // for loop // } break; - case ITerminalSymbols.TokenNamethis_PHP_COMPLETION: + case THIS_PHP_COMPLETION: if (type != PHPIdentifierLocation.METHOD && type != PHPIdentifierLocation.VARIABLE) { continue; // for loop @@ -161,7 +162,7 @@ public class DeclarationEngine { // continue; // for loop // } break; - case ITerminalSymbols.TokenNamenew: + case NEW: if (type != PHPIdentifierLocation.CLASS && type != PHPIdentifierLocation.CONSTRUCTOR) { continue; // for loop @@ -245,13 +246,13 @@ public class DeclarationEngine { location = (PHPIdentifierLocation) list.get(i); int type = location.getType(); switch (fLastSignificantToken) { - case ITerminalSymbols.TokenNameMINUS_GREATER: + case MINUS_GREATER: if (type != PHPIdentifierLocation.METHOD && type != PHPIdentifierLocation.VARIABLE) { continue; // for loop } break; - case ITerminalSymbols.TokenNameVariable: + case VARIABLE: if (type != PHPIdentifierLocation.METHOD && type != PHPIdentifierLocation.VARIABLE) { continue; // for loop @@ -261,7 +262,7 @@ public class DeclarationEngine { continue; // for loop } break; - case ITerminalSymbols.TokenNamethis_PHP_COMPLETION: + case THIS_PHP_COMPLETION: if (type != PHPIdentifierLocation.METHOD && type != PHPIdentifierLocation.VARIABLE) { continue; // for loop @@ -271,7 +272,7 @@ public class DeclarationEngine { continue; // for loop } break; - case ITerminalSymbols.TokenNamenew: + case NEW: if (type != PHPIdentifierLocation.CLASS && type != PHPIdentifierLocation.CONSTRUCTOR) { continue; // for loop