P4C
The P4 Compiler
Loading...
Searching...
No Matches
P4::ErrorCatalog Class Reference

Public Member Functions

template<MessageType type, int errorCode>
bool add (const char *name, bool forceReplace=false)
 
cstring getName (int errorCode)
 retrieve the name for errorCode
 
bool isError (int errorCode)
 
bool isError (std::string_view name)
 return true if the given diagnostic can only be an error; false otherwise
 

Static Public Member Functions

static ErrorCataloggetCatalog ()
 Return the singleton object.
 

Member Function Documentation

◆ add()

template<MessageType type, int errorCode>
bool P4::ErrorCatalog::add ( const char * name,
bool forceReplace = false )
inline

add to the catalog returns false if the code already exists and forceReplace was not set to true

Parameters
type- error/warning/info message
errorCode- integer value for the error/warning
name- name for the error. Used to enable/disable all errors of that type
forceReplace- override an existing error type in the catalog