• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ErrorParserManager类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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);
}
 
开发者ID:15knots,项目名称:cmake4eclipse,代码行数:39,代码来源:CMakeErrorParser.java


示例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;
}
 
开发者ID:rungemar,项目名称:cmake4cdt,代码行数:20,代码来源:CMakeErrorParserStdOut.java


示例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;
}
 
开发者ID:rungemar,项目名称:cmake4cdt,代码行数:21,代码来源:CMakeErrorParserStdErr.java


示例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;
}
 
开发者ID:wangzw,项目名称:CppStyle,代码行数:40,代码来源:CpplintErrorParser.java


示例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());
}
 
开发者ID:wangzw,项目名称:CppStyle,代码行数:6,代码来源:CpplintChecker.java



注:本文中的org.eclipse.cdt.core.ErrorParserManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java JsonRpcWebSocketClient类代码示例发布时间:2022-05-16
下一篇:
Java DescriptorUtils类代码示例发布时间:2022-05-16
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap