clang  10.0.0svn
Public Member Functions | Protected Member Functions | List of all members
clang::transformer::StencilPartInterface Class Referenceabstract

A stencil is represented as a sequence of "parts" that can each individually generate a code string based on a match result. More...

#include "clang/Tooling/Transformer/Stencil.h"

Public Member Functions

virtual ~StencilPartInterface ()=default
 
virtual llvm::Error eval (const ast_matchers::MatchFinder::MatchResult &Match, std::string *Result) const =0
 Evaluates this part to a string and appends it to Result. More...
 
virtual std::string toString () const =0
 Constructs a string representation of the StencilPart. More...
 

Protected Member Functions

 StencilPartInterface ()=default
 
 StencilPartInterface (const StencilPartInterface &)=default
 
StencilPartInterfaceoperator= (const StencilPartInterface &)=default
 

Detailed Description

A stencil is represented as a sequence of "parts" that can each individually generate a code string based on a match result.

The different kinds of parts include (raw) text, references to bound nodes and assorted operations on bound nodes.

Users can create custom Stencil operations by implementing this interface.

Definition at line 41 of file Stencil.h.

Constructor & Destructor Documentation

◆ ~StencilPartInterface()

virtual clang::transformer::StencilPartInterface::~StencilPartInterface ( )
virtualdefault

◆ StencilPartInterface() [1/2]

clang::transformer::StencilPartInterface::StencilPartInterface ( )
protecteddefault

◆ StencilPartInterface() [2/2]

clang::transformer::StencilPartInterface::StencilPartInterface ( const StencilPartInterface )
protecteddefault

Member Function Documentation

◆ eval()

virtual llvm::Error clang::transformer::StencilPartInterface::eval ( const ast_matchers::MatchFinder::MatchResult Match,
std::string *  Result 
) const
pure virtual

Evaluates this part to a string and appends it to Result.

Result is undefined in the case of an error.

Referenced by clang::transformer::Stencil::operator()().

◆ operator=()

StencilPartInterface& clang::transformer::StencilPartInterface::operator= ( const StencilPartInterface )
protecteddefault

◆ toString()

virtual std::string clang::transformer::StencilPartInterface::toString ( ) const
pure virtual

Constructs a string representation of the StencilPart.

StencilParts generated by the selection and run functions do not have a unique string representation.


The documentation for this class was generated from the following file: