1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Patch for bug 193280 - Add more patterns to the make error parser to catch additional errors.

This commit is contained in:
Doug Schaefer 2007-09-08 03:04:17 +00:00
parent f1dcaf70a2
commit 1c8bdeab65

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2005, 2006 IBM Corporation and others.
* Copyright (c) 2005, 2007 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@ -19,9 +19,8 @@ import org.eclipse.cdt.core.IMarkerGenerator;
import org.eclipse.core.runtime.Path;
public class MakeErrorParser extends AbstractErrorParser {
private static final ErrorPattern[] patterns = {
new ErrorPattern(Messages.MakeErrorParser_error_entering, 0, 0) { //$NON-NLS-1
new ErrorPattern("make\\[(.*)\\]: Entering directory `(.*)'", 0, 0) { //$NON-NLS-1
protected boolean recordError(Matcher matcher, ErrorParserManager eoParser) {
int level;
try {
@ -42,23 +41,218 @@ public class MakeErrorParser extends AbstractErrorParser {
return true;
}
},
new ErrorPattern(Messages.MakeErrorParser_error_leaving, 0, 0) { //$NON-NLS-1
new ErrorPattern("make\\[.*\\]: Leaving directory", 0, 0) { //$NON-NLS-1
protected boolean recordError(Matcher matcher, ErrorParserManager eoParser) {
eoParser.popDirectory();
return true;
}
},
new ErrorPattern(Messages.MakeErrorParser_error_general, 1, IMarkerGenerator.SEVERITY_ERROR_RESOURCE) { //$NON-NLS-1
new ErrorPattern("(make: \\*\\*\\* \\[.*\\] Error .*)", 1, IMarkerGenerator.SEVERITY_ERROR_RESOURCE) { //$NON-NLS-1
protected boolean recordError(Matcher matcher, ErrorParserManager eoParser) {
super.recordError(matcher, eoParser);
return true;
}
},
//make [foo] Error NN
new ErrorPattern("(make.*\\[.*\\] Error [-]{0,1}\\d*.*)", 1, IMarkerGenerator.SEVERITY_ERROR_RESOURCE) { //$NON-NLS-1
protected boolean recordError(Matcher matcher, ErrorParserManager eoParser) {
super.recordError(matcher, eoParser);
return true;
}
},
//[foo] signal description
new ErrorPattern("(make.*\\d+\\s+\\w+.*)", 1, IMarkerGenerator.SEVERITY_ERROR_RESOURCE) { //$NON-NLS-1
protected boolean recordError(Matcher matcher, ErrorParserManager eoParser) {
super.recordError(matcher, eoParser);
return true;
}
},
//missing separator. Stop.
new ErrorPattern("(make.*missing separator.\\s*Stop.)", 1, IMarkerGenerator.SEVERITY_ERROR_RESOURCE) { //$NON-NLS-1
protected boolean recordError(Matcher matcher, ErrorParserManager eoParser) {
super.recordError(matcher, eoParser);
return true;
}
},
//missing separator (did you mean TAB instead of 8 spaces?\\). Stop.
new ErrorPattern("(make.*missing separator \\(did you mean TAB instead of 8 spaces?\\).\\s*Stop.)", 1, IMarkerGenerator.SEVERITY_ERROR_RESOURCE) { //$NON-NLS-1
protected boolean recordError(Matcher matcher, ErrorParserManager eoParser) {
super.recordError(matcher, eoParser);
return true;
}
},
//commands commence before first target. Stop.
new ErrorPattern("(make.*commands commence before first target.\\s*Stop.)", 1, IMarkerGenerator.SEVERITY_ERROR_RESOURCE) { //$NON-NLS-1
protected boolean recordError(Matcher matcher, ErrorParserManager eoParser) {
super.recordError(matcher, eoParser);
return true;
}
},
//commands commence before first target. Stop.
new ErrorPattern("(make.*commands commence before first target.\\s*Stop.)", 1, IMarkerGenerator.SEVERITY_ERROR_RESOURCE) { //$NON-NLS-1
protected boolean recordError(Matcher matcher, ErrorParserManager eoParser) {
if (!eoParser.hasErrors())
super.recordError(matcher, eoParser);
super.recordError(matcher, eoParser);
return true;
}
},
//missing rule before commands. Stop.
new ErrorPattern("(make.*missing rule before commands.\\s*Stop.)", 1, IMarkerGenerator.SEVERITY_ERROR_RESOURCE) { //$NON-NLS-1
protected boolean recordError(Matcher matcher, ErrorParserManager eoParser) {
super.recordError(matcher, eoParser);
return true;
}
},
//missing rule before commands. Stop.
new ErrorPattern("(make.*missing rule before commands.\\s*Stop.)", 1, IMarkerGenerator.SEVERITY_ERROR_RESOURCE) { //$NON-NLS-1
protected boolean recordError(Matcher matcher, ErrorParserManager eoParser) {
super.recordError(matcher, eoParser);
return true;
}
},
//No rule to make target `xxx'.
new ErrorPattern("(make.*No rule to make target `.*'.)", 1, IMarkerGenerator.SEVERITY_ERROR_RESOURCE) { //$NON-NLS-1
protected boolean recordError(Matcher matcher, ErrorParserManager eoParser) {
super.recordError(matcher, eoParser);
return true;
}
},
//No rule to make target `xxx', needed by `yyy'.
new ErrorPattern("(make.*No rule to make target `.*', needed by `.*'.)", 1, IMarkerGenerator.SEVERITY_ERROR_RESOURCE) { //$NON-NLS-1
protected boolean recordError(Matcher matcher, ErrorParserManager eoParser) {
super.recordError(matcher, eoParser);
return true;
}
},
//No targets specified and no makefile found. Stop.
new ErrorPattern("(make.*No targets specified and no makefile found.\\s*Stop.)", 1, IMarkerGenerator.SEVERITY_ERROR_RESOURCE) { //$NON-NLS-1
protected boolean recordError(Matcher matcher, ErrorParserManager eoParser) {
super.recordError(matcher, eoParser);
return true;
}
},
//No targets. Stop.
new ErrorPattern("(make.*No targets.\\s*Stop.)", 1, IMarkerGenerator.SEVERITY_ERROR_RESOURCE) { //$NON-NLS-1
protected boolean recordError(Matcher matcher, ErrorParserManager eoParser) {
super.recordError(matcher, eoParser);
return true;
}
},
//Makefile `xxx' was not found.
new ErrorPattern("(make.*Makefile `.*' was not found.)", 1, IMarkerGenerator.SEVERITY_ERROR_RESOURCE) { //$NON-NLS-1
protected boolean recordError(Matcher matcher, ErrorParserManager eoParser) {
super.recordError(matcher, eoParser);
return true;
}
},
//Included makefile `xxx' was not found.
new ErrorPattern("(make.*Included makefile `.*' was not found.)", 1, IMarkerGenerator.SEVERITY_ERROR_RESOURCE) { //$NON-NLS-1
protected boolean recordError(Matcher matcher, ErrorParserManager eoParser) {
super.recordError(matcher, eoParser);
return true;
}
},
//warning: overriding commands for target `xxx'
new ErrorPattern("(make.*warning: overriding commands for target `.*')", 1, IMarkerGenerator.SEVERITY_WARNING) { //$NON-NLS-1
protected boolean recordError(Matcher matcher, ErrorParserManager eoParser) {
super.recordError(matcher, eoParser);
return false;
}
},
//warning: ignoring old commands for target `xxx'
new ErrorPattern("(make.*warning: ignoring old commands for target `.*')", 1, IMarkerGenerator.SEVERITY_WARNING) { //$NON-NLS-1
protected boolean recordError(Matcher matcher, ErrorParserManager eoParser) {
super.recordError(matcher, eoParser);
return false;
}
},
//Circular .+ <- .+ dependency dropped.
new ErrorPattern("(make.*Circular .+ <- .+ dependency dropped.)", 1, IMarkerGenerator.SEVERITY_ERROR_RESOURCE) { //$NON-NLS-1
protected boolean recordError(Matcher matcher, ErrorParserManager eoParser) {
super.recordError(matcher, eoParser);
return true;
}
},
//Recursive variable `xxx' references itself (eventually). Stop.
new ErrorPattern("(make.*Recursive variable `.*' references itself \\(eventually\\).\\s*Stop.)", 1, IMarkerGenerator.SEVERITY_ERROR_RESOURCE) { //$NON-NLS-1
protected boolean recordError(Matcher matcher, ErrorParserManager eoParser) {
super.recordError(matcher, eoParser);
return true;
}
},
//Unterminated variable reference. Stop.
new ErrorPattern("(make.*[uU]nterminated variable reference.\\s*Stop.)", 1, IMarkerGenerator.SEVERITY_ERROR_RESOURCE) { //$NON-NLS-1
protected boolean recordError(Matcher matcher, ErrorParserManager eoParser) {
super.recordError(matcher, eoParser);
return true;
}
},
//insufficient arguments to function `.*'. Stop.
new ErrorPattern("(make.*insufficient arguments to function `.*'.\\s*Stop.)", 1, IMarkerGenerator.SEVERITY_ERROR_RESOURCE) { //$NON-NLS-1
protected boolean recordError(Matcher matcher, ErrorParserManager eoParser) {
super.recordError(matcher, eoParser);
return true;
}
},
//missing target pattern. Stop.
new ErrorPattern("(make.*missing target pattern.\\s*Stop.)", 1, IMarkerGenerator.SEVERITY_ERROR_RESOURCE) { //$NON-NLS-1
protected boolean recordError(Matcher matcher, ErrorParserManager eoParser) {
super.recordError(matcher, eoParser);
return true;
}
},
//multiple target patterns. Stop.
new ErrorPattern("(make.*multiple target patterns.\\s*Stop.)", 1, IMarkerGenerator.SEVERITY_ERROR_RESOURCE) { //$NON-NLS-1
protected boolean recordError(Matcher matcher, ErrorParserManager eoParser) {
super.recordError(matcher, eoParser);
return true;
}
},
//target pattern contains no `%'. Stop.
new ErrorPattern("(make.*target pattern contains no `%'.\\s*Stop.)", 1, IMarkerGenerator.SEVERITY_ERROR_RESOURCE) { //$NON-NLS-1
protected boolean recordError(Matcher matcher, ErrorParserManager eoParser) {
super.recordError(matcher, eoParser);
return true;
}
},
//mixed implicit and static pattern rules. Stop.
new ErrorPattern("(make.*mixed implicit and static pattern rules.\\s*Stop.)", 1, IMarkerGenerator.SEVERITY_ERROR_RESOURCE) { //$NON-NLS-1
protected boolean recordError(Matcher matcher, ErrorParserManager eoParser) {
super.recordError(matcher, eoParser);
return true;
}
},
//mixed implicit and static pattern rules. Stop.
new ErrorPattern("(make.*mixed implicit and static pattern rules.\\s*Stop.)", 1, IMarkerGenerator.SEVERITY_ERROR_RESOURCE) { //$NON-NLS-1
protected boolean recordError(Matcher matcher, ErrorParserManager eoParser) {
super.recordError(matcher, eoParser);
return true;
}
},
//warning: -jN forced in submake: disabling jobserver mode.
new ErrorPattern("(make.*warning: -jN forced in submake: disabling jobserver mode.)", 1, IMarkerGenerator.SEVERITY_WARNING) { //$NON-NLS-1
protected boolean recordError(Matcher matcher, ErrorParserManager eoParser) {
super.recordError(matcher, eoParser);
return false;
}
},
//warning: jobserver unavailable: using -j1. Add `+' to parent make rule.
new ErrorPattern("(make.*warning: jobserver unavailable: using -j1. Add `+' to parent make rule.)", 1, IMarkerGenerator.SEVERITY_WARNING) { //$NON-NLS-1
protected boolean recordError(Matcher matcher, ErrorParserManager eoParser) {
super.recordError(matcher, eoParser);
return false;
}
},
//target `abc' doesn't match the target pattern
new ErrorPattern("(make.*target `.*' doesn't match the target pattern)", 1, IMarkerGenerator.SEVERITY_ERROR_RESOURCE) { //$NON-NLS-1
protected boolean recordError(Matcher matcher, ErrorParserManager eoParser) {
super.recordError(matcher, eoParser);
return true;
}
}
};
};
public MakeErrorParser() {
super(patterns);
}
}
}
};