![]() |
P4C
The P4 Compiler
|
Classes | |
| struct | Option |
Public Types | |
| enum | OptionFlags { Default = 0 , Hide = 1 << 0 , OptionalArgument = 1 << 1 } |
| typedef std::function< bool(const char *optarg)> | OptionProcessor |
Public Member Functions | |
| cstring | getBinaryName () |
| cstring | getBuildDate () |
| cstring | getCompileCommand () |
| virtual const char * | getIncludePath ()=0 |
| virtual std::vector< const char * > * | process (int argc, char *const argv[]) |
| virtual void | usage () |
Protected Member Functions | |
| Options (cstring 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) |
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 Util::Options::Option |
| Class Members | ||
|---|---|---|
| const char * | argName | |
| const char * | description | |
| OptionFlags | flags | |
| cstring | option | |
| OptionProcessor | processor | |
| Enumerator | |
|---|---|
| Default | The default option flags. |
| Hide | Hide this option from –help message. |
| OptionalArgument | If this option requires an argument, it may be omitted. Options with this flag set can only accept their argument with the syntax |
|
virtual |
Process options; return list of remaining options.
If subclasses override this method, they should call the superclass implementation.
Reimplemented in ParserOptions, P4Tools::AbstractP4cToolOptions, DPDK::DpdkOptions, and BMV2::PsaSwitchOptions.