clang  6.0.0svn
Classes | Public Types | Public Member Functions | List of all members
clang::ast_matchers::dynamic::Diagnostics Class Reference

Helper class to manage error messages. More...

#include "clang/ASTMatchers/Dynamic/Diagnostics.h"

Classes

class  ArgStream
 Helper stream class. More...
 
struct  Context
 Class defining a parser context. More...
 
struct  ContextFrame
 Information stored for one frame of the context. More...
 
struct  ErrorContent
 Information stored for each error found. More...
 
struct  OverloadContext
 Context for overloaded matcher construction. More...
 

Public Types

enum  ContextType { CT_MatcherArg = 0, CT_MatcherConstruct = 1 }
 Parser context types. More...
 
enum  ErrorType {
  ET_None = 0, ET_RegistryMatcherNotFound = 1, ET_RegistryWrongArgCount = 2, ET_RegistryWrongArgType = 3,
  ET_RegistryNotBindable = 4, ET_RegistryAmbiguousOverload = 5, ET_RegistryValueNotFound = 6, ET_ParserStringError = 100,
  ET_ParserNoOpenParen = 101, ET_ParserNoCloseParen = 102, ET_ParserNoComma = 103, ET_ParserNoCode = 104,
  ET_ParserNotAMatcher = 105, ET_ParserInvalidToken = 106, ET_ParserMalformedBindExpr = 107, ET_ParserTrailingCode = 108,
  ET_ParserNumberError = 109, ET_ParserOverloadedType = 110
}
 All errors from the system. More...
 

Public Member Functions

ArgStream addError (SourceRange Range, ErrorType Error)
 Add an error to the diagnostics. More...
 
ArrayRef< ErrorContenterrors () const
 
void printToStream (llvm::raw_ostream &OS) const
 Returns a simple string representation of each error. More...
 
std::string toString () const
 
void printToStreamFull (llvm::raw_ostream &OS) const
 Returns the full string representation of each error. More...
 
std::string toStringFull () const
 

Detailed Description

Helper class to manage error messages.

Definition at line 51 of file Diagnostics.h.

Member Enumeration Documentation

◆ ContextType

Parser context types.

Enumerator
CT_MatcherArg 
CT_MatcherConstruct 

Definition at line 54 of file Diagnostics.h.

◆ ErrorType

All errors from the system.

Enumerator
ET_None 
ET_RegistryMatcherNotFound 
ET_RegistryWrongArgCount 
ET_RegistryWrongArgType 
ET_RegistryNotBindable 
ET_RegistryAmbiguousOverload 
ET_RegistryValueNotFound 
ET_ParserStringError 
ET_ParserNoOpenParen 
ET_ParserNoCloseParen 
ET_ParserNoComma 
ET_ParserNoCode 
ET_ParserNotAMatcher 
ET_ParserInvalidToken 
ET_ParserMalformedBindExpr 
ET_ParserTrailingCode 
ET_ParserNumberError 
ET_ParserOverloadedType 

Definition at line 60 of file Diagnostics.h.

Member Function Documentation

◆ addError()

Diagnostics::ArgStream clang::ast_matchers::dynamic::Diagnostics::addError ( SourceRange  Range,
ErrorType  Error 
)

◆ errors()

ArrayRef<ErrorContent> clang::ast_matchers::dynamic::Diagnostics::errors ( ) const
inline

Definition at line 159 of file Diagnostics.h.

References clang::threadSafety::sx::toString().

◆ printToStream()

void clang::ast_matchers::dynamic::Diagnostics::printToStream ( llvm::raw_ostream &  OS) const

Returns a simple string representation of each error.

Each error only shows the error message without any context.

Definition at line 187 of file Diagnostics.cpp.

References clang::ast_matchers::dynamic::printErrorContentToStream().

◆ printToStreamFull()

void clang::ast_matchers::dynamic::Diagnostics::printToStreamFull ( llvm::raw_ostream &  OS) const

Returns the full string representation of each error.

Each error message contains the full context.

Definition at line 201 of file Diagnostics.cpp.

References clang::ast_matchers::dynamic::Diagnostics::ErrorContent::ContextStack, clang::ast_matchers::dynamic::printContextFrameToStream(), and clang::ast_matchers::dynamic::printErrorContentToStream().

◆ toString()

std::string clang::ast_matchers::dynamic::Diagnostics::toString ( ) const

Definition at line 194 of file Diagnostics.cpp.

◆ toStringFull()

std::string clang::ast_matchers::dynamic::Diagnostics::toStringFull ( ) const

Definition at line 213 of file Diagnostics.cpp.


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