line.append('\t');
line.append(typeOfIdentifier);
line.append(identifier);
- // line.append("\to"); // Offset
- // line.append(fScanner.getCurrentTokenStartPosition());
}
/**
System.out.println(fScanner.toStringAction(fToken));
}
return;
- // } catch (InvalidInputException e) {
- // // ignore errors
- // // e.printStackTrace();
- // }
- // fToken = TokenNameERROR;
}
private void parseDeclarations(char[] parent, StringBuffer buf,
StringBuffer buf) {
char[] ident;
String identifier;
- int counter = 0;
boolean hasModifiers = false;
int phpdocOffset = -1;
int phpdocLength = -1;
try {
getNextToken();
while (fToken != TokenNameEOF) { // && fToken !=
- // TokenNameERROR) {
+ // TokenNameERROR) {
phpdocOffset = -1;
hasModifiers = false;
if (fToken == TokenNameCOMMENT_PHPDOC) {
*
*/
public void addFile(IFile fileToParse) {
- // InputStream iStream;
LineCreator lineCreator = createLineCreator();
try {
addInputStream(new BufferedInputStream(fileToParse.getContents()),
fileToParse.getProjectRelativePath().toString(),
- lineCreator);
+ lineCreator, fileToParse.getCharset());
} catch (CoreException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
* @throws CoreException
*/
public void addInputStream(InputStream stream, String filePath,
- LineCreator lineCreator) throws CoreException {
+ LineCreator lineCreator, String charset) throws CoreException {
try {
StringBuffer lineBuffer = new StringBuffer();
lineBuffer.append(filePath);
- int lineLength = lineBuffer.length();
lineCreator.parseIdentifiers(Util.getInputStreamAsCharArray(stream,
- -1, null), lineBuffer);
- // if (lineLength != lineBuffer.length()) {
- // always add the file for Open Include Action
+ -1, charset), lineBuffer);
addLine(lineBuffer.toString());
- // }
} catch (IOException e) {
e.printStackTrace();
} finally {
stream.close();
}
} catch (IOException e) {
+ // do nothing
}
}
}