Spicy
Public Member Functions | Friends | List of all members
hilti::statement::switch_::Case Class Reference

#include <switch.h>

Inheritance diagram for hilti::statement::switch_::Case:
hilti::NodeBase hilti::trait::isNode

Public Member Functions

 Case (hilti::Expression expr, Statement body, Meta m=Meta())
 
 Case (std::vector< hilti::Expression > exprs, Statement body, Meta m=Meta())
 
 Case (Default, Statement body, Meta m=Meta())
 
auto expressions () const
 
auto preprocessedExpressions () const
 
const auto & body () const
 
bool isDefault () const
 
auto & _bodyNode ()
 
auto properties () const
 
bool operator== (const Case &other) const
 
- Public Member Functions inherited from hilti::NodeBase
 NodeBase (Meta meta)
 
 NodeBase (std::vector< Node > childs, Meta meta)
 
template<typename T >
const T & child (int i) const
 
template<typename T >
void assertChildIsA (int i)
 
template<typename T >
auto childs (int begin, int end) const
 
auto childRefs (int begin, int end)
 
template<typename T >
hilti::node::Set< T > childsOfType () const
 
template<typename T >
std::vector< NodeRefchildRefsOfType () const
 
void addChild (Node n)
 
const auto & childs () const
 
auto & childs ()
 
auto & meta () const
 
void setMeta (Meta m)
 
bool pruneWalk () const
 

Friends

class hilti::statement::Switch
 

Detailed Description

AST node for a switch case type.

Note that internally, we store the expressions in a preprocessed matter: E turns into <id> == E, where ID is selected to match the code generator's output. Doing this allows coercion for the comparision to proceed normally. The preprocessing happens at the time the Case gets added to a Switch statement, and the new versions are stored separately from the original expressions.

Member Function Documentation

◆ _bodyNode()

auto& hilti::statement::switch_::Case::_bodyNode ( )
inline

Internal method for use by builder API only.

◆ properties()

auto hilti::statement::switch_::Case::properties ( ) const
inline

Implements the Node interface.


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