![]() |
P4C
The P4 Compiler
|
#include <options.h>
Public Member Functions | |
| AbstractP4cToolOptions (const AbstractP4cToolOptions &)=delete | |
| AbstractP4cToolOptions & | operator= (const AbstractP4cToolOptions &)=delete |
| std::optional< ICompileContext * > | process (const std::vector< const char * > &args) |
Public Attributes | |
| bool | disableInformationLogging = false |
| Disable information logging. | |
| std::optional< uint32_t > | seed = std::nullopt |
| A seed for the PRNG. | |
Protected Member Functions | |
| AbstractP4cToolOptions (std::string_view toolName, std::string_view message) | |
| const std::string & | getToolName () const |
| The name of the tool associated with these options. | |
| std::vector< const char * > * | process (int argc, char *const argv[]) override |
| Hook for customizing options processing. | |
| bool | validateOptions () const override |
Protected Member Functions inherited from Util::Options | |
| 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 () |
Protected Attributes | |
| std::vector< const char * > | compilerArgs |
| Command-line arguments to be sent to the compiler. Populated by @process. | |
Protected Attributes inherited from Util::Options | |
| 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 |
Additional Inherited Members | |
Protected Types inherited from Util::Options | |
| enum | OptionFlags { Default = 0 , Hide = 1 << 0 , OptionalArgument = 1 << 1 } |
| using | OptionProcessor = std::function<bool(const char *)> |
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 * > P4Tools::AbstractP4cToolOptions::process | ( | const std::vector< const char * > & | args | ) |
Processes options.
|
overrideprotectedvirtual |
Hook for customizing options processing.
Reimplemented from Util::Options.
|
nodiscardoverrideprotectedvirtual |
Checks if parsed options make sense with respect to each-other.
Reimplemented from Util::Options.
Reimplemented in P4Tools::P4Testgen::TestgenOptions.