Patterns

Coverity Documentation

Version
latest

The main method that checkers use to inspect the AST is through the use of patterns, which are fragments of syntax with pattern variables (holes) that can match arbitrary subtrees. The basic approach is to define a pattern with named holes, test to see if the pattern matches some input syntax, and then use the named holes to examine the parts of the patterns that match.