P4C
The P4 Compiler
Loading...
Searching...
No Matches
P4::P4Tools::AbstractP4cTool< Options, typename > Class Template Referenceabstract

#include <p4ctool.h>

Public Member Functions

int main (std::string_view toolName, const std::vector< const char * > &args)
 

Protected Member Functions

virtual int mainImpl (const CompilerResult &compilerResult)=0
 
virtual void registerTarget ()=0
 

Detailed Description

template<class Options, typename = std::enable_if_t<std::is_base_of_v<AbstractP4cToolOptions, Options>>>
class P4::P4Tools::AbstractP4cTool< Options, typename >

Abstract class for all compiler-based tools. Implementations should instantiate this template on a subclass of AbstractP4cToolOptions.

Member Function Documentation

◆ main()

template<class Options , typename = std::enable_if_t<std::is_base_of_v<AbstractP4cToolOptions, Options>>>
int P4::P4Tools::AbstractP4cTool< Options, typename >::main ( std::string_view toolName,
const std::vector< const char * > & args )
inline
Parameters
argsContains the path to the executable, followed by the command-line arguments for this tool.

◆ mainImpl()

template<class Options , typename = std::enable_if_t<std::is_base_of_v<AbstractP4cToolOptions, Options>>>
virtual int P4::P4Tools::AbstractP4cTool< Options, typename >::mainImpl ( const CompilerResult & compilerResult)
protectedpure virtual

Provides the implementation of the tool.

Parameters
programThe P4 program after mid-end processing.

Implemented in P4::P4Tools::P4Smith::Smith, and P4::P4Tools::P4Testgen::Testgen.