@Extension public class PcLintWarningParser extends WarningParser
WarningParser.CommentProperties, WarningParser.MisraVersion, WarningParser.Suppression, WarningParser.Violation
ERR_COULD_NOT_DETERMINE_SUPPRESSED_GUIDELINE, ERR_GRP_ERROR, ERR_GUIDELINE_NOT_FOUND, ERR_ILLEGAL_DEVIATION, ERR_READ_FILE, ERR_WRITE_FILE, errorCode, out
Constructor and Description |
---|
PcLintWarningParser() |
Modifier and Type | Method and Description |
---|---|
protected List<String> |
findSuppressionComments(String fileContent)
Parse the contents of a source code file, and return a list of all
suppression comments in the file.
|
protected Set<String> |
getGuidelineIdsFromComment(String comment)
For a single suppression comment, find each MISRA violation that is
suppressed by this comment.
|
String |
name() |
protected List<WarningParser.Violation> |
parseWarningLine(String line)
Parse a line from the output of the MISRA checker tool (e.g.
|
void |
setMisraVersion(WarningParser.MisraVersion misraVersion)
Resets this parser and sets a specific MISRA version.
|
Set<WarningParser.MisraVersion> |
supportedMisraVersions()
Returns the set of all MISRA-guideline versions supported by this warning
parser.
|
all, getDeviationPattern, getErrorCode, getFalsePositivePattern, getGuidelinePattern, getGuidelines, getLogFilePath, getMisraLintFileContent, getMisraVersion, getNonMisraPattern, getWorkspace, initialize, isCompliant, log, parseSourceFile, parseSourceFiles, parseWarnings, readGrp, setDeviationPattern, setFalsePositivePattern, setGuidelinePattern, setGuidelines, setLogFilePath, setLogger, setNonMisraPattern, setWorkspace, summary
public void setMisraVersion(WarningParser.MisraVersion misraVersion)
WarningParser
setMisraVersion
in class WarningParser
misraVersion
- Version of MISRA rules to use.protected List<WarningParser.Violation> parseWarningLine(String line)
WarningParser
parseWarningLine
in class WarningParser
line
- A single line of text from the parser tools output. The parser
should be configured so that a violation does not cover more than
one line.protected List<String> findSuppressionComments(String fileContent)
WarningParser
findSuppressionComments
in class WarningParser
fileContent
- The full contents of the source file as a stringprotected Set<String> getGuidelineIdsFromComment(String comment)
WarningParser
Note: This is likely the most difficult method to implement, since it may have to map tool error codes to MISRA guidelines. If this mapping is too complex, you can implement this method to always return null. This will force the user to always add a GUIDELINE(...) tag to suppression comments, or end up with an invalid report.
getGuidelineIdsFromComment
in class WarningParser
comment
- A suppression comment from the source filepublic String name()
name
in class WarningParser
public Set<WarningParser.MisraVersion> supportedMisraVersions()
WarningParser
supportedMisraVersions
in class WarningParser
Copyright © 2016–2019. All rights reserved.