} else if (token == TokenNamefinal || token == TokenNameabstract || token == TokenNameclass || token == TokenNameinterface) {
TypeDeclaration typeDecl = new TypeDeclaration(this.compilationUnit.compilationResult);
typeDecl.declarationSourceStart = scanner.getCurrentTokenStartPosition();
+ typeDecl.declarationSourceEnd = scanner.getCurrentTokenEndPosition();
+ typeDecl.name = new char[]{' '};
// default super class
typeDecl.superclass = new SingleTypeReference(TypeConstants.OBJECT, 0);
compilationUnit.types.add(typeDecl);
checkAndSetModifiers(AccInterface);
getNextToken();
typeDecl.modifiers = this.modifiers;
+ typeDecl.sourceStart = scanner.getCurrentTokenStartPosition();
+ typeDecl.sourceEnd = scanner.getCurrentTokenEndPosition();
if (token == TokenNameIdentifier || token > TokenNameKEYWORD) {
- typeDecl.sourceStart = scanner.getCurrentTokenStartPosition();
- typeDecl.sourceEnd = scanner.getCurrentTokenEndPosition();
typeDecl.name = scanner.getCurrentIdentifierSource();
if (token > TokenNameKEYWORD) {
- throwSyntaxError("Don't use a keyword for interface declaration [" + scanner.toStringAction(token) + "].",
- typeDecl.sourceStart, typeDecl.sourceEnd);
+ problemReporter.phpKeywordWarning(new String[]{scanner.toStringAction(token)}, scanner.getCurrentTokenStartPosition(), scanner.getCurrentTokenEndPosition(),
+ referenceContext, compilationUnit.compilationResult);
+// throwSyntaxError("Don't use a keyword for interface declaration [" + scanner.toStringAction(token) + "].",
+// typeDecl.sourceStart, typeDecl.sourceEnd);
}
getNextToken();
interface_extends_list();
} else {
- typeDecl.sourceStart = scanner.getCurrentTokenStartPosition();
- typeDecl.sourceEnd = scanner.getCurrentTokenEndPosition();
typeDecl.name = new char[]{' '};
throwSyntaxError("Interface name expected after keyword 'interface'.", typeDecl.sourceStart, typeDecl.sourceEnd);
return;
// '{' class_statement_list'}'
class_entry_type();
typeDecl.modifiers = this.modifiers;
+ typeDecl.sourceStart = scanner.getCurrentTokenStartPosition();
+ typeDecl.sourceEnd = scanner.getCurrentTokenEndPosition();
//identifier
//identifier 'extends' identifier
if (token == TokenNameIdentifier || token > TokenNameKEYWORD) {
- typeDecl.sourceStart = scanner.getCurrentTokenStartPosition();
- typeDecl.sourceEnd = scanner.getCurrentTokenEndPosition();
typeDecl.name = scanner.getCurrentIdentifierSource();
if (token > TokenNameKEYWORD) {
- throwSyntaxError("Don't use a keyword for class declaration [" + scanner.toStringAction(token) + "].",
- typeDecl.sourceStart, typeDecl.sourceEnd);
+ problemReporter.phpKeywordWarning(new String[]{scanner.toStringAction(token)}, scanner.getCurrentTokenStartPosition(), scanner.getCurrentTokenEndPosition(),
+ referenceContext, compilationUnit.compilationResult);
+// throwSyntaxError("Don't use a keyword for class declaration [" + scanner.toStringAction(token) + "].",
+// typeDecl.sourceStart, typeDecl.sourceEnd);
}
getNextToken();
// extends_from:
}
implements_list();
} else {
- typeDecl.sourceStart = scanner.getCurrentTokenStartPosition();
- typeDecl.sourceEnd = scanner.getCurrentTokenEndPosition();
typeDecl.name = new char[]{' '};
throwSyntaxError("Class name expected after keyword 'class'.", typeDecl.sourceStart, typeDecl.sourceEnd);
return;