Spicy
Classes | Typedefs | Enumerations | Functions | Variables
hilti::node Namespace Reference

Classes

struct  Error
 
class  None
 
class  Range
 
class  RangeIterator
 
class  Set
 
class  SetIterator
 
class  WithDocString
 

Typedefs

using Properties = std::map< std::string, node::detail::PropertyValue >
 

Enumerations

enum  ErrorPriority { ErrorPriority::High = 3, ErrorPriority::Normal = 2, ErrorPriority::Low = 1, ErrorPriority::NoError = 0 }
 

Functions

bool operator< (ErrorPriority x, ErrorPriority y)
 
template<typename T , typename Other , IF_DERIVED_FROM(T, trait::isNode) , IF_DERIVED_FROM(Other, trait::isNode) >
bool isEqual (const T *this_, const Other &other)
 
template<typename X , typename F >
auto filter (const hilti::node::Range< X > &x, F f)
 
template<typename X , typename F >
auto filter (const hilti::node::Set< X > &x, F f)
 
template<typename X , typename F >
auto transform (const hilti::node::Range< X > &x, F f)
 
template<typename X , typename F >
auto transform (const hilti::node::Set< X > &x, F f)
 
node::Set< NodeflattenedChildren (const Node &n)
 

Variables

const Node none = None::create()
 

Detailed Description

Checks equality for two objects both implementing the Node interface.

If the two objects have different types, this will return false. Otherwise it will forward to the objects equality operator.

Typedef Documentation

◆ Properties

using hilti::node::Properties = typedef std::map<std::string, node::detail::PropertyValue>

Properties associated with an AST node. A property is a key/value pair recording node-specific, atomic information that's not represented by further child nodes.

Enumeration Type Documentation

◆ ErrorPriority

Importance of reporting an error, relative to others.

Enumerator
High 

high priority error that will always be reported

Normal 

normal priority error that will be reported if there are no higher priority ones

Low 

low priority error that will be reported if there are no higher priority ones

NoError 

place-holder for comparison if no error was encountered

Function Documentation

◆ filter() [1/2]

template<typename X , typename F >
auto hilti::node::filter ( const hilti::node::Range< X > &  x,
f 
)

Filters a node vector through a boolean predicate, returning a set containing the matching ones.

◆ filter() [2/2]

template<typename X , typename F >
auto hilti::node::filter ( const hilti::node::Set< X > &  x,
f 
)

Filters a node set through a boolean predicate, returning a new set containing the matching ones.

◆ flattenedChildren()

node::Set<Node> hilti::node::flattenedChildren ( const Node n)
inline

Returns a list of all children of specific type, descending recursively to find instance anywhere below this node.

◆ transform() [1/2]

template<typename X , typename F >
auto hilti::node::transform ( const hilti::node::Range< X > &  x,
f 
)

Applies a function to each element of a node range, returning a new vector with the results.

◆ transform() [2/2]

template<typename X , typename F >
auto hilti::node::transform ( const hilti::node::Set< X > &  x,
f 
)

Applies a function to each element of a node set, returning a new vector of with the results.

Variable Documentation

◆ none

const Node hilti::node::none = None::create()

Singleton.