![]() |
P4C
The P4 Compiler
|
Public Member Functions | |
| 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 (const AbstractP4cToolOptions &)=delete | |
| AbstractP4cToolOptions (cstring message) | |
| AbstractP4cToolOptions & | operator= (const AbstractP4cToolOptions &)=delete |
| std::vector< const char * > * | process (int argc, char *const argv[]) override |
| Hook for customizing options processing. | |
| virtual bool | validateOptions () const |
Protected Member Functions inherited from Util::Options | |
| 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) |
| cstring | getBinaryName () |
| cstring | getBuildDate () |
| cstring | getCompileCommand () |
| virtual const char * | getIncludePath ()=0 |
| virtual void | usage () |
Static Protected Member Functions | |
| static std::tuple< int, char ** > | convertArgs (const std::vector< const char * > &args) |
| Converts a vector of command-line arguments into the traditional (argc, argv) format. | |
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 } |
| typedef std::function< bool(const char *optarg)> | OptionProcessor |
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.
|
inlineprotectedvirtual |
Checks if parsed options make sense with respect to each-other.
Reimplemented in P4Tools::P4Testgen::TestgenOptions.