P4C
The P4 Compiler
Loading...
Searching...
No Matches
P4::P4COptionPragmaParser Class Reference

#include <applyOptionsPragmas.h>

Inheritance diagram for P4::P4COptionPragmaParser:
[legend]

Public Member Functions

std::optional< CommandLineOptions > tryToParse (const IR::Annotation *annotation) override
 
- Public Member Functions inherited from P4::IOptionPragmaParser

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.

Member Function Documentation

◆ tryToParse()

std::optional< IOptionPragmaParser::CommandLineOptions > P4::P4COptionPragmaParser::tryToParse ( const IR::Annotation * annotation)
overridevirtual