Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Prigogin2012-03-13 21:42:16 -0400
committerSergey Prigogin2012-03-13 21:42:16 -0400
commitada23a9a2f553630410d3765c9086b8b163ee815 (patch)
tree87137ada1645f93c582dbbb658c9ed3e5a4972bc /codan/org.eclipse.cdt.codan.checkers
parentc510e7ad5b2edf4fa6d1a80eee209caa4a10f275 (diff)
downloadorg.eclipse.cdt-ada23a9a2f553630410d3765c9086b8b163ee815.tar.gz
org.eclipse.cdt-ada23a9a2f553630410d3765c9086b8b163ee815.tar.xz
org.eclipse.cdt-ada23a9a2f553630410d3765c9086b8b163ee815.zip
Bug 372551. Removed the external tool checker support until all design
issues are resolved.
Diffstat (limited to 'codan/org.eclipse.cdt.codan.checkers')
-rw-r--r--codan/org.eclipse.cdt.codan.checkers/META-INF/MANIFEST.MF3
-rw-r--r--codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/externaltool/CppcheckOutputParser.java83
2 files changed, 1 insertions, 85 deletions
diff --git a/codan/org.eclipse.cdt.codan.checkers/META-INF/MANIFEST.MF b/codan/org.eclipse.cdt.codan.checkers/META-INF/MANIFEST.MF
index d68fd3ab0e..1854c74cc4 100644
--- a/codan/org.eclipse.cdt.codan.checkers/META-INF/MANIFEST.MF
+++ b/codan/org.eclipse.cdt.codan.checkers/META-INF/MANIFEST.MF
@@ -15,5 +15,4 @@ Bundle-Vendor: %Bundle-Vendor
Export-Package: org.eclipse.cdt.codan.checkers,
org.eclipse.cdt.codan.internal.checkers;
x-friends:="org.eclipse.cdt.codan.checkers.ui,
- org.eclipse.cdt.codan.core.test",
- org.eclipse.cdt.codan.internal.checkers.externaltool
+ org.eclipse.cdt.codan.core.test"
diff --git a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/externaltool/CppcheckOutputParser.java b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/externaltool/CppcheckOutputParser.java
deleted file mode 100644
index 05ef14e3a4..0000000000
--- a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/externaltool/CppcheckOutputParser.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Google, Inc 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Alex Ruiz (Google) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.codan.internal.checkers.externaltool;
-
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.eclipse.cdt.codan.core.CodanRuntime;
-import org.eclipse.cdt.codan.core.externaltool.AbstractOutputParser;
-import org.eclipse.cdt.codan.core.externaltool.IProblemDisplay;
-import org.eclipse.cdt.codan.core.externaltool.InvocationParameters;
-import org.eclipse.cdt.codan.core.model.IProblemLocation;
-import org.eclipse.cdt.codan.core.model.IProblemLocationFactory;
-import org.eclipse.core.resources.IFile;
-
-/**
- * Parses the output of Cppcheck.
- *
- * @author alruiz@google.com (Alex Ruiz)
- *
- * @since 1.1
- */
-public class CppcheckOutputParser extends AbstractOutputParser {
- // sample line to parse:
- //
- // [/src/HelloWorld.cpp:19]: (style) The scope of the variable 'i' can be reduced
- // ----------1--------- -2 --3-- ------------------4-------------------------
- //
- // groups:
- // 1: file path and name
- // 2: line where problem was found
- // 3: problem severity
- // 4: problem description
- private static Pattern pattern = Pattern.compile("\\[(.*):(\\d+)\\]:\\s*\\((.*)\\)\\s*(.*)"); //$NON-NLS-1$
-
- private final InvocationParameters parameters;
- private final IProblemDisplay problemDisplay;
-
- /**
- * Constructor.
- * @param parameters the parameters to pass to Cppcheck.
- * @param problemDisplay displays any problems reported by Cppcheck as markers.
- */
- public CppcheckOutputParser(InvocationParameters parameters, IProblemDisplay problemDisplay) {
- this.parameters = parameters;
- this.problemDisplay = problemDisplay;
- }
-
- @Override
- public boolean parse(String line) {
- Matcher matcher = pattern.matcher(line);
- if (!matcher.matches()) {
- return false;
- }
- String filePath = matcher.group(1);
- if (parameters.getActualFilePath().equals(filePath)) {
- int lineNumber = Integer.parseInt(matcher.group(2));
- String severity = matcher.group(3);
- String description = matcher.group(4);
- IProblemLocation location = createProblemLocation(lineNumber);
- problemDisplay.reportProblem(location, description, severity);
- }
- return true;
- }
-
- private IProblemLocation createProblemLocation(int lineNumber) {
- IProblemLocationFactory factory = CodanRuntime.getInstance().getProblemLocationFactory();
- IFile actualFile = (IFile) parameters.getActualFile();
- return factory.createProblemLocation(actualFile, -1, -1, lineNumber);
- }
-
- @Override
- public void reset() {
- }
-}

Back to the top