[cfe-dev] What is a "predicate" in the AST matcher?

Artem Dergachev via cfe-dev cfe-dev at lists.llvm.org
Thu Jul 2 23:21:59 PDT 2020


The word "predicate" here is used in its mathematical sense: 
https://en.wikipedia.org/wiki/Predicate_(mathematical_logic)

All this really means is that each individual matcher is a function that 
accept an AST node and return either true ("matches") or false ("doesn't 
match").

On 7/2/20 11:03 PM, Yafei Liu via cfe-dev wrote:
> For example in this sentence:
> AST matchers are predicates on nodes in the AST.
> Or this:
> LibASTMatchers provides a domain specific language to create 
> predicates on Clang’s AST.
>
> Can someone help to explain what predicates are?
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20200702/23f32ca4/attachment-0001.html>


More information about the cfe-dev mailing list