本文整理汇总了Java中org.eclipse.cdt.core.ErrorParserManager类的典型用法代码示例。如果您正苦于以下问题:Java ErrorParserManager类的具体用法?Java ErrorParserManager怎么用?Java ErrorParserManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ErrorParserManager类属于org.eclipse.cdt.core包,在下文中一共展示了ErrorParserManager类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createMarker
import org.eclipse.cdt.core.ErrorParserManager; //导入依赖的package包/类
/**
* Creates a problem marker.
*
* @param fileName
* the file where the problem has occurred
* @param epm
* @param lineNo
* the line number of the problem
* @param severity
* the severity of the problem, see {@link IMarkerGenerator} for
* acceptable severity values
* @param varName
* the name of the variable involved in the error or {@code null} if
* unknown
*/
private void createMarker(String fileName, ErrorParserManager epm,
String lineNo, int severity, String varName) {
int lineNumber = Integer.parseInt(lineNo);
// cmake reports the file relative to source entry
final IProject project = epm.getProject();
IConfiguration cfg = ManagedBuildManager.getBuildInfo(project, true)
.getDefaultConfiguration();
ICConfigurationDescription cfgDes = ManagedBuildManager
.getDescriptionForConfiguration(cfg);
ICSourceEntry[] srcEntriesR = cfgDes.getResolvedSourceEntries();
ICSourceEntry[] srcEntries = cfg.getSourceEntries();
srcEntries = CDataUtil.resolveEntries(srcEntries, cfgDes);
IPath srcPath = srcEntries[0].getFullPath(); // project-relative path!
IPath filePath = srcPath.append(fileName);
IFile file2 = project.getFile(filePath);
IFile file = epm.findFileName(filePath.toString());
this.markerInfo = new ProblemMarkerInfo(file2, lineNumber, null, severity,
varName);
markerInfo.setType(CMAKE_PROBLEM_MARKER_ID);
}
示例2: processLine
import org.eclipse.cdt.core.ErrorParserManager; //导入依赖的package包/类
@Override
public boolean processLine(String line, ErrorParserManager eoParser) {
Matcher seeAlsoMatcher = seeAlso.matcher(line);
if (seeAlsoMatcher.matches()) {
String message = seeAlsoMatcher.group();
String path = seeAlsoMatcher.group(1);
IPath externalPath = new Path(path);
IFile[] foundFiles = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocationURI(URIUtil.toURI(externalPath));
IFile resource = foundFiles.length > 0 && foundFiles[0] != null && foundFiles[0].exists() ? foundFiles[0] : null;
if (resource != null) {
externalPath = null;
}
eoParser.generateExternalMarker(resource, lineNumber, message, IMarkerGenerator.SEVERITY_INFO, "", externalPath);
return true;
}
return false;
}
示例3: toURI
import org.eclipse.cdt.core.ErrorParserManager; //导入依赖的package包/类
/**
* Converts a location {@link IPath} to an {@link URI}.
* The returned URI uses the scheme and authority of the current working directory
* as returned by {@link #getWorkingDirectoryURI()}
*
* @param path - the path to convert to URI.
* @param errParserManager
* @return URI
*/
private URI toURI(IPath path, ErrorParserManager errParserManager) {
URI uri = null;
URI workingDirectoryURI = errParserManager.getWorkingDirectoryURI();
if (path.isAbsolute()) {
uri = EFSExtensionManager.getDefault().createNewURIFromPath(workingDirectoryURI, path.toString());
} else {
uri = EFSExtensionManager.getDefault().append(workingDirectoryURI, path.toString());
}
return uri;
}
示例4: processLine
import org.eclipse.cdt.core.ErrorParserManager; //导入依赖的package包/类
@Override
public boolean processLine(String line, ErrorParserManager parserManager) {
Matcher matcher = pattern.matcher(line);
if (!matcher.matches()) {
return false;
}
IFile fileName = parserManager.findFileName(matcher.group(CppStyleConstants.CPPLINT_OUTPUT_PATTERN_PATH_GROUP));
if (fileName != null) {
int lineNumber = Integer.parseInt(matcher.group(CppStyleConstants.CPPLINT_OUTPUT_PATTERN_LINE_NO_GROUP));
lineNumber = lineNumber > 0 ? lineNumber : 1;
String description = matcher.group(CppStyleConstants.CPPLINT_OUTPUT_PATTERN_MSG_GROUP);
int severity = findSeverityCode(matcher.group(CppStyleConstants.CPPLINT_OUTPUT_PATTERN_SEVERITY_GROUP));
ProblemMarkerInfo info = new ProblemMarkerInfo(fileName, lineNumber, description, severity, null);
String category = matcher.group(CppStyleConstants.CPPLINT_OUTPUT_PATTERN_CATEGORY_GROUP);
String subcate = matcher.group(CppStyleConstants.CPPLINT_OUTPUT_PATTERN_CATEGORY_SUBGROUP);
String problem = findProblemId(category, subcate);
int retry = 1;
do {
try {
if (problem != null) {
info.setAttribute(CppStyleConstants.CPPLINT_PROBLEM_ID_KEY, problem);
parserManager.addProblemMarker(info);
return true;
}
return false;
} catch (IllegalArgumentException e) {
CppStyle.log("Unexpected cpplint problem: " + category + "/" + subcate, e);
problem = CppStyleConstants.CPPLINT_ERROR_PROBLEM_ID;
}
} while (retry-- > 0);
}
return false;
}
示例5: createErrorParserManager
import org.eclipse.cdt.core.ErrorParserManager; //导入依赖的package包/类
private ErrorParserManager createErrorParserManager(InvocationParameters parameters) {
IProject project = parameters.getActualFile().getProject();
URI workingDirectory = URIUtil.toURI(parameters.getWorkingDirectory());
return new ErrorParserManager(project, workingDirectory, this, getParserIDs());
}