Spicy
Public Types | Public Member Functions | List of all members
spicy::detail::codegen::production::Switch Class Reference

#include <switch.h>

Inheritance diagram for spicy::detail::codegen::production::Switch:
spicy::detail::codegen::ProductionBase spicy::trait::isNonTerminal spicy::trait::isProduction

Public Types

using Cases = std::vector< std::pair< std::vector< Expression >, Production > >
 

Public Member Functions

 Switch (const std::string &symbol, Expression expr, Cases cases, std::optional< Production > default_, AttributeSet attributes, const Location &l=location::None)
 
const Expression & expression () const
 
const Cases & cases () const
 
const std::optional< Production > & default_ () const
 
const AttributeSetattributes () const
 
std::vector< std::vector< Production > > rhss () const
 
std::optional< spicy::Typetype () const
 
bool nullable () const
 
bool eodOk () const
 
bool atomic () const
 
std::string render () const
 
- Public Member Functions inherited from spicy::detail::codegen::ProductionBase
 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

Production that decides between alternatives based on which value out of a set of options a given expression matches; plus an optional default if none matches.


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