P4C
The P4 Compiler
ParserOptions Class Reference
Inheritance diagram for ParserOptions:
[legend]

Public Types

enum class  FrontendVersion { P4_14 , P4_16 }
 
- Public Types inherited from Util::Options
enum  OptionFlags { Default = 0 , Hide = 1 << 0 , OptionalArgument = 1 << 1 }
 
typedef std::function< bool(const char *optarg)> OptionProcessor
 

Public Member Functions

void closePreprocessedInput (FILE *input) const
 
DebugHook getDebugHook () const
 
const char * getIncludePath () override
 
bool isAnnotationDisabled (const IR::Annotation *a) const
 
bool isv1 () const
 
FILE * preprocess ()
 
std::vector< const char * > * process (int argc, char *const argv[]) override
 
bool searchForIncludePath (const char *&includePathOut, std::vector< cstring > relativePaths, const char *)
 
void setInputFile ()
 
- Public Member Functions inherited from Util::Options
cstring getBinaryName ()
 
cstring getBuildDate ()
 
cstring getCompileCommand ()
 
virtual void usage ()
 

Public Attributes

cstring compilerVersion
 
bool doNotCompile = false
 
bool doNotPreprocess = false
 
cstring dumpFolder = "."
 
cstring exe_name
 
cstring file = nullptr
 
FrontendVersion langVersion = FrontendVersion::P4_16
 
bool noIncludes = false
 
bool optimizeParserInlining = false
 
cstring preprocessor_options = ""
 
std::vector< cstringtop4
 

Protected Member Functions

void dumpPass (const char *manager, unsigned seq, const char *pass, const IR::Node *node) const
 
virtual void 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)
 

Additional Inherited Members

- 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< cstringoptionOrder
 
std::map< cstring, const Option * > options
 
std::ostream * outStream = &std::cerr
 
std::vector< const char * > remainingOptions
 

Member Function Documentation

◆ process()

std::vector< const char * > * ParserOptions::process ( int  argc,
char *const  argv[] 
)
overridevirtual

Process options; return list of remaining options.

If subclasses override this method, they should call the superclass implementation.

Returns
'nullptr' if an error is signaled.

Reimplemented from Util::Options.

Reimplemented in DPDK::DpdkOptions, and BMV2::PsaSwitchOptions.

Member Data Documentation

◆ noIncludes

bool ParserOptions::noIncludes = false

If true do not generate #include statements. Used for debugging.