this.initializeScanner();
}
- public void setFileToParse(IFile fileToParse) {
- this.token = TokenNameEOF;
- this.initializeScanner();
- }
+// public void setFileToParse(IFile fileToParse) {
+// this.token = TokenNameEOF;
+// this.initializeScanner();
+// }
/**
* ClassDeclaration Constructor.
* Description of Parameter
* @see
*/
- public Parser(IFile fileToParse) {
- // if (keywordMap == null) {
- // keywordMap = new HashMap();
- // for (int i = 0; i < PHP_KEYWORS.length; i++) {
- // keywordMap.put(PHP_KEYWORS[i], new Integer(PHP_KEYWORD_TOKEN[i]));
- // }
- // }
- // this.currentPHPString = 0;
- // PHPParserSuperclass.fileToParse = fileToParse;
- // this.phpList = null;
- this.includesList = null;
- // this.str = "";
- this.token = TokenNameEOF;
- // this.chIndx = 0;
- // this.rowCount = 1;
- // this.columnCount = 0;
- // this.phpEnd = false;
- // getNextToken();
- this.initializeScanner();
- }
+// public Parser(IFile fileToParse) {
+// // if (keywordMap == null) {
+// // keywordMap = new HashMap();
+// // for (int i = 0; i < PHP_KEYWORS.length; i++) {
+// // keywordMap.put(PHP_KEYWORS[i], new Integer(PHP_KEYWORD_TOKEN[i]));
+// // }
+// // }
+// // this.currentPHPString = 0;
+// // PHPParserSuperclass.fileToParse = fileToParse;
+// // this.phpList = null;
+// this.includesList = null;
+// // this.str = "";
+// this.token = TokenNameEOF;
+// // this.chIndx = 0;
+// // this.rowCount = 1;
+// // this.columnCount = 0;
+// // this.phpEnd = false;
+// // getNextToken();
+// this.initializeScanner();
+// }
public void initializeScanner() {
this.scanner = new Scanner(
// fully_qualified_class_name
do {
if (token == TokenNameIdentifier) {
- char[] ident = scanner.getCurrentIdentifierSource();
+ //char[] ident = scanner.getCurrentIdentifierSource();
// TODO make this code working better:
// SingleTypeReference ref =
// ParserUtil.getTypeReference(scanner,
}
}
- private void optional_class_type() {
- // /* empty */
- // | T_STRING
- }
+// private void optional_class_type() {
+// // /* empty */
+// // | T_STRING
+// }
// private void parameterDeclaration() {
// //variable
return false;
}
- private void scalar() {
- // scalar:
- // T_STRING
- // | T_STRING_VARNAME
- // | class_constant
- // | common_scalar
- // | '"' encaps_list '"'
- // | '\'' encaps_list '\''
- // | T_START_HEREDOC encaps_list T_END_HEREDOC
- throwSyntaxError("Not yet implemented (scalar).");
- }
+// private void scalar() {
+// // scalar:
+// // T_STRING
+// // | T_STRING_VARNAME
+// // | class_constant
+// // | common_scalar
+// // | '"' encaps_list '"'
+// // | '\'' encaps_list '\''
+// // | T_START_HEREDOC encaps_list T_END_HEREDOC
+// throwSyntaxError("Not yet implemented (scalar).");
+// }
private void static_scalar() {
// static_scalar: /* compile-time evaluated scalars */
// return anomaliesDetected;
// }
// }
- protected void pushOnAstLengthStack(int pos) {
- try {
- astLengthStack[++astLengthPtr] = pos;
- } catch (IndexOutOfBoundsException e) {
- int oldStackLength = astLengthStack.length;
- int[] oldPos = astLengthStack;
- astLengthStack = new int[oldStackLength + StackIncrement];
- System.arraycopy(oldPos, 0, astLengthStack, 0, oldStackLength);
- astLengthStack[astLengthPtr] = pos;
- }
- }
+// protected void pushOnAstLengthStack(int pos) {
+// try {
+// astLengthStack[++astLengthPtr] = pos;
+// } catch (IndexOutOfBoundsException e) {
+// int oldStackLength = astLengthStack.length;
+// int[] oldPos = astLengthStack;
+// astLengthStack = new int[oldStackLength + StackIncrement];
+// System.arraycopy(oldPos, 0, astLengthStack, 0, oldStackLength);
+// astLengthStack[astLengthPtr] = pos;
+// }
+// }
protected void pushOnAstStack(ASTNode node) {
/*
// incastrix
//String projectPath = ProjectPrefUtil.getDocumentRoot(file.getProject())
// .toString();
- String filePath = file.getFullPath().toString();
+ //String filePath = file.getFullPath().toString();
String ext = file.getFileExtension();
int fileExtensionLength = ext == null ? 0 : ext.length() + 1;