//private boolean phpMode;
protected int modifiers;
protected int modifiersSourceStart;
- protected IdentifierIndexManager indexManager;
+// protected IdentifierIndexManager indexManager;
protected Parser(ProblemReporter problemReporter) {
this.problemReporter = problemReporter;
this.currentPHPString = 0;
// PHPParserSuperclass.fileToParse = fileToParse;
this.phpList = null;
- this.indexManager = null;
+// this.indexManager = null;
this.str = "";
this.token = TokenNameEOF;
// this.chIndx = 0;
this.currentPHPString = 0;
// PHPParserSuperclass.fileToParse = fileToParse;
this.phpList = null;
- this.indexManager = null;
+// this.indexManager = null;
this.str = "";
this.token = TokenNameEOF;
this.phpEnd = false;
compilationUnit = null;
referenceContext = null;
includesList = new ArrayList();
- this.indexManager = indexManager;
+// this.indexManager = indexManager;
this.str = "";
this.token = TokenNameEOF;
// this.chIndx = 0;
// | class_variable_declaration ',' T_VARIABLE '=' static_scalar
// | T_VARIABLE
// | T_VARIABLE '=' static_scalar
+ char[] classVariable;
do {
if (token == TokenNameVariable) {
- FieldDeclaration fieldDeclaration = new FieldDeclaration(scanner.getCurrentIdentifierSource(), scanner
+ classVariable = scanner.getCurrentIdentifierSource();
+ // indexManager.addIdentifierInformation('v', classVariable, buf, -1, -1);
+ FieldDeclaration fieldDeclaration = new FieldDeclaration(classVariable, scanner
.getCurrentTokenStartPosition(), scanner.getCurrentTokenEndPosition());
fieldDeclaration.modifiers = this.modifiers;
fieldDeclaration.declarationSourceStart = declarationSourceStart;
if (token == TokenNameAND) {
getNextToken();
}
- if (token == TokenNameIdentifier) {
- methodDecl.sourceStart = scanner.getCurrentTokenStartPosition();
- methodDecl.sourceEnd = scanner.getCurrentTokenEndPosition();
+ methodDecl.sourceStart = scanner.getCurrentTokenStartPosition();
+ methodDecl.sourceEnd = scanner.getCurrentTokenEndPosition();
+ if (Scanner.isIdentifierOrKeyword(token)) {
methodDecl.selector = scanner.getCurrentIdentifierSource();
+ if (token > TokenNameKEYWORD) {
+ reportSyntaxWarning("Don't use keyword for function declaration [" + scanner.toStringAction(token) + "].",
+ scanner.getCurrentTokenStartPosition(), scanner.getCurrentTokenEndPosition());
+// throwSyntaxError("Don't use keyword for function declaration [" + scanner.toStringAction(token) + "].");
+ }
getNextToken();
if (token == TokenNameLPAREN) {
getNextToken();
getNextToken();
}
} else {
- if (token > TokenNameKEYWORD) {
- throwSyntaxError("Don't use keyword for function declaration [" + token + "].");
- }
+ methodDecl.selector = "<undefined>".toCharArray();
throwSyntaxError("Function name expected after keyword 'function'.");
}
}