Utilities for debugging Proto expression trees
Pretty-print a Proto expression tree.
A PolymorphicFunctionObject which accepts a Proto expression tree and pretty-prints it to an ostream for debugging purposes.
void
void
Expr const &
std::ostream &std::cout
The ostream to which the expression tree will be written.
int
0
The starting indentation depth for this node. Children nodes will be displayed at a starting depth of depth+4.
void
Expr const &
The Proto expression tree to pretty-print
std::ostream &
The ostream to which the output should be written. If not specified, defaults to std::cout.
void
Expr const &
Pretty-print a Proto expression tree.
Equivalent to proto::functional::display_expr(0, sout)(expr).
void
Expr const &
The Proto expression to check againts Grammar
.
Assert at compile time that a particular expression
matches the specified grammar.
Equivalent to BOOST_MPL_ASSERT((proto::matches<Expr, Grammar>))
.
Use proto::assert_matches()
to assert at compile-time that
an expression matches a grammar.
Example:typedef proto::plus< proto::terminal< int >, proto::terminal< int > > PlusInts;
proto::assert_matches<PlusInts>( proto::lit(1) + 42 );
See also:
proto::assert_matches_not()
BOOST_PROTO_ASSERT_MATCHES()
BOOST_PROTO_ASSERT_MATCHES_NOT()
void
Expr const &
The Proto expression to check againts Grammar
.
Assert at compile time that a particular expression
does not match the specified grammar.
Equivalent to BOOST_MPL_ASSERT_NOT((proto::matches<Expr, Grammar>))
.
Use proto::assert_matches_not()
to assert at compile-time that
an expression does not match a grammar.
Example:typedef proto::plus< proto::terminal< int >, proto::terminal< int > > PlusInts;
proto::assert_matches_not<PlusInts>( proto::lit("a string") + 42 );
See also:
proto::assert_matches()
BOOST_PROTO_ASSERT_MATCHES()
BOOST_PROTO_ASSERT_MATCHES_NOT()
Assert at compile time that a particular expression
matches the specified grammar.
Equivalent to proto::assert_matches<Grammar>(expr)
.
Use BOOST_PROTO_ASSERT_MATCHES()
to assert at compile-time that
an expression matches a grammar.
Example:typedef proto::plus< proto::terminal< int >, proto::terminal< int > > PlusInts;
BOOST_PROTO_ASSERT_MATCHES( proto::lit(1) + 42, PlusInts );
See also:
proto::assert_matches()
proto::assert_matches_not()
BOOST_PROTO_ASSERT_MATCHES_NOT()
Assert at compile time that a particular expression
does not match the specified grammar.
Equivalent to proto::assert_matches_not<Grammar>(expr)
.
Use BOOST_PROTO_ASSERT_MATCHES_NOT()
to assert at compile-time that
an expression does not match a grammar.
Example:typedef proto::plus< proto::terminal< int >, proto::terminal< int > > PlusInts;
BOOST_PROTO_ASSERT_MATCHES_NOT( proto::lit("a string") + 42, PlusInts );
See also:
proto::assert_matches()
proto::assert_matches_not()
BOOST_PROTO_ASSERT_MATCHES()