clang API Documentation

Classes | Public Types | Public Member Functions
clang::ast_matchers::dynamic::Diagnostics Class Reference

Helper class to manage error messages. More...

#include <Diagnostics.h>

List of all members.

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_ParserUnsignedError = 109, ET_ParserOverloadedType = 110
}
 All errors from the system. More...

Public Member Functions

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

Detailed Description

Helper class to manage error messages.

Definition at line 51 of file Diagnostics.h.


Member Enumeration Documentation

Parser context types.

Enumerator:
CT_MatcherArg 
CT_MatcherConstruct 

Definition at line 54 of file Diagnostics.h.

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_ParserUnsignedError 
ET_ParserOverloadedType 

Definition at line 60 of file Diagnostics.h.


Member Function Documentation

Definition at line 159 of file Diagnostics.h.

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().

Referenced by toString().

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::diag::Error, clang::ast_matchers::dynamic::printContextFrameToStream(), and clang::ast_matchers::dynamic::printErrorContentToStream().

Referenced by toStringFull().

Definition at line 194 of file Diagnostics.cpp.

References printToStream(), and S.

Definition at line 213 of file Diagnostics.cpp.

References printToStreamFull(), and S.


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