Spicy
Public Member Functions | List of all members
spicy::detail::codegen::ProductionBase Class Reference

#include <production.h>

Inheritance diagram for spicy::detail::codegen::ProductionBase:
spicy::trait::isProduction spicy::detail::codegen::production::Boolean spicy::detail::codegen::production::ByteBlock spicy::detail::codegen::production::Counter spicy::detail::codegen::production::Ctor spicy::detail::codegen::production::Enclosure spicy::detail::codegen::production::Epsilon spicy::detail::codegen::production::ForEach spicy::detail::codegen::production::LookAhead spicy::detail::codegen::production::Resolved spicy::detail::codegen::production::Sequence spicy::detail::codegen::production::Switch spicy::detail::codegen::production::TypeLiteral spicy::detail::codegen::production::Unit spicy::detail::codegen::production::Variable spicy::detail::codegen::production::While

Public Member Functions

 ProductionBase (std::string symbol, Location l=location::None)
 
bool hasSize () const
 
const Locationlocation () const
 
const std::string & symbol () const
 
void setSymbol (const std::string &s)
 
std::optional< Expression > filter () const
 
void setFilter (const Expression &filter)
 
std::optional< Expression > sink () const
 
void setSink (const Expression &sink)
 
const production::Metameta () const
 
void setMeta (production::Meta m)
 
std::shared_ptr< production::Meta_metaInstance () const
 
void _setMetaInstance (std::shared_ptr< production::Meta > m)
 

Detailed Description

Common base class for classes implementing the Production interface. The base implements a number of the interface methods with standard versions shared across all nodes.

Constructor & Destructor Documentation

◆ ProductionBase()

spicy::detail::codegen::ProductionBase::ProductionBase ( std::string  symbol,
Location  l = location::None 
)
inline

Constructor.

Parameters
symbolsymbol associated with the production; the symbol must be unique within the grammar the production is (or will be) part of (unless it's empty).
mmeta data associated with the
llocation associated with the production

Member Function Documentation

◆ _metaInstance()

std::shared_ptr<production::Meta> spicy::detail::codegen::ProductionBase::_metaInstance ( ) const
inline

Implements the Production interface.

◆ filter()

std::optional<Expression> spicy::detail::codegen::ProductionBase::filter ( ) const
inline

Implements the Production interface.

◆ hasSize()

bool spicy::detail::codegen::ProductionBase::hasSize ( ) const
inline

Returns true if the production's associated field has a &size attribute.

◆ location()

const Location& spicy::detail::codegen::ProductionBase::location ( ) const
inline

Implements the Production interface.

◆ meta()

const production::Meta& spicy::detail::codegen::ProductionBase::meta ( ) const
inline

Implements the Production interface.

◆ setFilter()

void spicy::detail::codegen::ProductionBase::setFilter ( const Expression &  filter)
inline

Implements the Production interface.

◆ setMeta()

void spicy::detail::codegen::ProductionBase::setMeta ( production::Meta  m)
inline

Implements the Production interface.

◆ setSink()

void spicy::detail::codegen::ProductionBase::setSink ( const Expression &  sink)
inline

Implements the Production interface.

◆ setSymbol()

void spicy::detail::codegen::ProductionBase::setSymbol ( const std::string &  s)
inline

Implements the Production interface.

◆ sink()

std::optional<Expression> spicy::detail::codegen::ProductionBase::sink ( ) const
inline

Implements the Production interface.

◆ symbol()

const std::string& spicy::detail::codegen::ProductionBase::symbol ( ) const
inline

Implements the Production interface.


The documentation for this class was generated from the following file: