1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-16 04:35:45 +02:00

Check for the occurenc of column.

This commit is contained in:
Alain Magloire 2002-11-13 22:04:58 +00:00
parent 60a60db5dd
commit bcb903febb

View file

@ -13,7 +13,7 @@ import org.eclipse.core.resources.IFile;
public class GCCErrorParser implements IErrorParser {
public boolean processLine(String line, ErrorParserManager eoParser) {
// gcc: "filename:linenumber: error_desc"
// gcc: "filename:linenumber:column: error_desc"
int firstColon = line.indexOf(':');
/* Guard against drive in Windows platform. */
@ -41,14 +41,15 @@ public class GCCErrorParser implements IErrorParser {
String varName = null;
String desc = line.substring(secondColon + 1).trim();
int severity = IMarkerGenerator.SEVERITY_ERROR_RESOURCE;
int num = 0;
int num = -1;
int col = -1;
try {
num = Integer.parseInt(lineNumber);
} catch (NumberFormatException e) {
}
if (num == 0) {
if (num == -1) {
// Maybe a bad option error or cc1(plus) error
if (fileName.startsWith("cc") || fileName.startsWith("gcc")
|| fileName.startsWith("qcc") || fileName.startsWith("QCC")) {
@ -59,6 +60,18 @@ public class GCCErrorParser implements IErrorParser {
} else {
return false;
}
} else {
/* Then check for the column */
int thirdColon= line.indexOf(':', secondColon + 1);
if (thirdColon != -1) {
try {
col = Integer.parseInt(lineNumber);
} catch (NumberFormatException e) {
}
}
if (col != -1) {
desc = line.substring(thirdColon + 1).trim();
}
}
// gnu c: filename:no: (Each undeclared identifier is reported