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;
private ArrayList fProposals = new ArrayList();
/** Token determines last which declarations are allowed for proposal */
- private int fLastSignificantToken;
+ private TokenName fLastSignificantToken;
private IProject fProject;
* <code>TemplateContext</code> 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;
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
// continue; // for loop
// }
break;
- case ITerminalSymbols.TokenNamethis_PHP_COMPLETION:
+ case THIS_PHP_COMPLETION:
if (type != PHPIdentifierLocation.METHOD
&& type != PHPIdentifierLocation.VARIABLE) {
continue; // for loop
// continue; // for loop
// }
break;
- case ITerminalSymbols.TokenNamenew:
+ case NEW:
if (type != PHPIdentifierLocation.CLASS
&& type != PHPIdentifierLocation.CONSTRUCTOR) {
continue; // for loop
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
continue; // for loop
}
break;
- case ITerminalSymbols.TokenNamethis_PHP_COMPLETION:
+ case THIS_PHP_COMPLETION:
if (type != PHPIdentifierLocation.METHOD
&& type != PHPIdentifierLocation.VARIABLE) {
continue; // for loop
continue; // for loop
}
break;
- case ITerminalSymbols.TokenNamenew:
+ case NEW:
if (type != PHPIdentifierLocation.CLASS
&& type != PHPIdentifierLocation.CONSTRUCTOR) {
continue; // for loop