A grammar element and a PrimitiveTransform that associates a transform with the grammar. More...
#include <when.hpp>
Inherits PrimitiveTransform.
Public Types | |
typedef Grammar | first |
typedef PrimitiveTransform | second |
typedef Grammar::proto_grammar | proto_grammar |
A grammar element and a PrimitiveTransform that associates a transform with the grammar.
Use when<>
to override a grammar's default transform with a custom transform. It is for used when composing larger transforms by associating smaller transforms with individual rules in your grammar, as in the following transform which counts the number of terminals in an expression.
In when<G, T>
, when T
is a class type it is a PrimitiveTransform and the following equivalencies hold:
boost::result_of<when<G,T>(E,S,V)>::type
is the same as boost::result_of<T(E,S,V)>::type
.
when<G,T>()(e,s,d)
is the same as T()(e,s,d)
.
typedef Grammar boost::proto::when< Grammar, PrimitiveTransform >::first |
typedef Grammar::proto_grammar boost::proto::when< Grammar, PrimitiveTransform >::proto_grammar |
typedef PrimitiveTransform boost::proto::when< Grammar, PrimitiveTransform >::second |