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

Public Member Functions

std::optional< CommandLineOptions > tryToParse (const IR::Annotation *annotation) override
 

Additional Inherited Members

- Public Types inherited from P4::IOptionPragmaParser
using CommandLineOptions = std::vector< const char * >
 

Detailed Description

An IOptionPragmaParser implementation that supports basic pragmas that all backends can support.

P4COptionPragmaParser recognizes:

  • pragma diagnostic [diagnostic name] [disable|warn|error]
  • @diagnostic([diagnostic name], ["disable"|"warn"|"error"])

Backends that want to add support for additional pragmas will usually want to inherit from this class and delegate tryToParse() to the superclass if they're unable to parse a pragma.