![]() |
Spicy
|
#include <unit.h>
Public Member Functions | |
Unit (const std::vector< type::function::Parameter > ¶ms, std::vector< unit::Item > i, const std::optional< AttributeSet > &={}, Meta m=Meta()) | |
Unit (Wildcard, Meta m=Meta()) | |
NodeRef | selfRef () const |
auto | id () const |
auto | parameters () const |
auto | parameterRefs () const |
auto | items () const |
auto | itemRefs () const |
auto | attributes () const |
hilti::optional_ref< const Type > | contextType () const |
hilti::optional_ref< const type::unit::Item > | itemByName (const ID &id) const |
NodeRef | itemRefByName (const ID &id) const |
template<typename T > | |
auto | items () const |
hilti::optional_ref< const unit::item::Property > | propertyItem (const std::string &name) const |
auto | propertyItems (const std::string &name) const |
auto | isPublic () const |
bool | isFilter () const |
const spicy::detail::codegen::Grammar & | grammar () const |
void | addItems (std::vector< unit::Item > items) |
void | setAttributes (const AttributeSet &attrs) |
void | setGrammar (std::shared_ptr< spicy::detail::codegen::Grammar > g) |
void | setID (const ID &id) |
void | setPublic (bool p) |
bool | operator== (const Unit &other) const |
auto | isEqual (const Type &other) const |
auto | _isResolved (ResolvedState *rstate) const |
auto | typeParameters () const |
auto | isWildcard () const |
auto | properties () const |
![]() | |
NodeBase (Meta meta) | |
NodeBase (std::vector< Node > children, Meta meta) | |
template<typename T > | |
const T & | child (int i) const |
template<typename T > | |
void | assertChildIsA (int i) |
template<typename T > | |
auto | children (int begin, int end) const |
auto | childRefs (int begin, int end) |
template<typename T > | |
hilti::node::Set< T > | childrenOfType () const |
template<typename T > | |
std::vector< NodeRef > | childRefsOfType () const |
void | addChild (Node n) |
const auto & | children () const |
auto & | children () |
auto & | meta () const |
void | setMeta (Meta m) |
bool | pruneWalk () const |
Static Public Member Functions | |
static void | setSelf (Node *n) |
AST node for a Spicy unit.
|
inline |
Adds a number of new items to the unit.
|
inline |
Returns the type set through `context
, if available.
|
inline |
Returns the grammar associated with the type. It must have been set before through setGrammar()
.
|
inline |
Returns true if this unit type can act as a filter.
|
inline |
Returns true if the unit has been declared as publically/externally accessible.
hilti::optional_ref< const type::unit::Item > type::Unit::itemByName | ( | const ID & | id | ) | const |
Returns the item of a given name if it exists. This descends recursively into children as well.
Returns a reference to an item give by its ID.
|
inline |
Returns all of the unit's items of a particular subtype T.
|
inline |
Returns the property of a given name if it exists. If it exists more than once, it's undefined which one is returned.
|
inline |
Returns all properties of a given name.
|
inlinestatic |
Given an existing node wrapping a unit type, updates the contained unit type to have its self
declaration initialized. Note that the unit type's constructor cannot do this because we need the Node
shell for this.