P4C
The P4 Compiler
|
Classes | |
struct | Option |
Public Types | |
enum | OptionFlags { Default = 0 , Hide = 1 << 0 , OptionalArgument = 1 << 1 } |
using | OptionProcessor = std::function<bool(const char *)> |
Public Member Functions | |
cstring | getBinaryName () |
cstring | getBuildDate () |
cstring | getCompileCommand () |
virtual const char * | getIncludePath () const =0 |
virtual std::vector< const char * > * | process (int argc, char *const argv[]) |
virtual void | usage () |
Protected Member Functions | |
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) |
virtual bool | validateOptions () const |
Protected Attributes | |
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 |
struct P4::Util::Options::Option |
Class Members | ||
---|---|---|
const char * | argName | |
const char * | description | |
OptionFlags | flags | |
cstring | option | |
OptionProcessor | processor |
|
nodiscardpure virtual |
Implemented in P4::ParserOptions.
|
virtual |
Process options; return list of remaining options.
If subclasses override this method, they should call the superclass implementation.
Reimplemented in P4::BMV2::PortableOptions, P4::DPDK::DpdkOptions, P4::P4Tools::AbstractP4cToolOptions, and P4::ParserOptions.
|
nodiscardprotectedvirtual |
Checks if parsed options make sense with respect to each-other.
Reimplemented in P4::CompilerOptions, P4::P4Tools::AbstractP4cToolOptions, and P4::P4Tools::P4Testgen::TestgenOptions.