![]() |
P4C
The P4 Compiler
|
#include <options.h>
Public Member Functions | |
std::optional< ICompileContext * > | process (const std::vector< const char * > &args) |
std::vector< const char * > * | process (int argc, char *const argv[]) override |
Hook for customizing options processing. | |
Protected Member Functions | |
AbstractP4cToolOptions (AbstractP4cToolOptions &&)=default | |
AbstractP4cToolOptions (const AbstractP4cToolOptions &)=default | |
AbstractP4cToolOptions (std::string_view toolName, std::string_view message) | |
const std::string & | getToolName () const |
The name of the tool associated with these options. | |
AbstractP4cToolOptions & | operator= (const AbstractP4cToolOptions &)=default |
bool | validateOptions () const override |
![]() | |
Options (std::string_view message) | |
void | registerOption (const char *option, const char *argName, OptionProcessor processor, const char *description, OptionFlags flags=OptionFlags::Default) |
void | registerUsage (const char *msg) |
void | setOutStream (std::ostream *out) |
cstring | getBinaryName () |
cstring | getBuildDate () |
cstring | getCompileCommand () |
virtual const char * | getIncludePath () const =0 |
virtual void | usage () |
Additional Inherited Members | |
![]() | |
enum | OptionFlags { Default = 0 , Hide = 1 << 0 , OptionalArgument = 1 << 1 } |
using | OptionProcessor = std::function<bool(const char *)> |
![]() | |
std::vector< const char * > | additionalUsage |
const char * | binaryName |
cstring | buildDate |
bool | collectUnknownOptions = false |
cstring | compileCommand |
cstring | message |
std::vector< cstring > | optionOrder |
std::map< cstring, const Option * > | options |
std::ostream * | outStream = &std::cerr |
std::vector< const char * > | remainingOptions |
Encapsulates and processes command-line options for a compiler-based tool. Implementations should use the singleton pattern and define a static get() for obtaining the singleton instance.
std::optional< ICompileContext * > P4::P4Tools::AbstractP4cToolOptions::process | ( | const std::vector< const char * > & | args | ) |
Processes options.
|
overridevirtual |
Hook for customizing options processing.
Reimplemented from P4::Util::Options.
|
nodiscardoverrideprotectedvirtual |
Checks if parsed options make sense with respect to each-other.
Reimplemented from P4::Util::Options.
Reimplemented in P4::P4Tools::P4Testgen::TestgenOptions.