Skip to content

Class zmbt::lang::Expression

ClassList > zmbt > lang > Expression

Inherits the following classes: zmbt::lang::ExpressionView

Inherited by the following classes: zmbt::lang::SignatureBase, zmbt::lang::SignatureBase, zmbt::lang::SignatureBase, zmbt::Param, zmbt::lang::Expression::Subexpression, zmbt::lang::SignatureBase

Classes

Type Name
class Subexpression

Public Types inherited from zmbt::lang::ExpressionView

See zmbt::lang::ExpressionView

Type Name
typedef lang::Keyword Keyword
typedef boost::json::value V

Public Functions

Type Name
Expression ()
Expression (Encoding && encoding)
Expression (Encoding const & encoding)
Expression (boost::json::value const & expr)
Expression (boost::json::value && expr)
Expression (std::initializer_list< boost::json::value_ref > items)
Expression (T sample)
Expression (Keyword const & keyword)
Expression (ExpressionView const & view)
Expression (Expression const & other)
Expression (Expression && other)
Encoding encoding () const
bool operator!= (Expression v) const
Expression & operator= (Expression const & other)
Expression & operator= (Expression && other)
bool operator== (Expression v) const
~Expression () = default

Public Functions inherited from zmbt::lang::ExpressionView

See zmbt::lang::ExpressionView

Type Name
ExpressionView ()
ExpressionView (ExpressionView const &) = default
ExpressionView (ExpressionView &&) = default
ExpressionView (EncodingView v)
ExpressionView (Encoding enc)
boost::json::array const & as_array () const
bool as_bool () const
boost::json::object const & as_object () const
boost::json::string const & as_string () const
boost::json::value const & data () const
EncodingView encoding_view () const
boost::json::value eval (boost::json::value const & x=nullptr, EvalContext ctx={}) const
Evaluate expression.
bool eval_as_predicate (ExpressionView const & x, Expression & err_sts, EvalContext ctx) const
bool eval_as_predicate (boost::json::value const & x, Expression & err_sts, EvalContext ctx) const
Expression eval_e (ExpressionView const & x, EvalContext ctx) const
Evaluate expression.
Expression eval_maybe_predicate (ExpressionView const & x, EvalContext ctx) const
bool has_subexpr () const
boost::json::array const * if_array () const
bool const * if_bool () const
boost::json::object const * if_object () const
boost::json::string const * if_string () const
bool is (Keyword const kwrd) const
bool is_boolean () const
bool is_complete_flip () const
bool is_compose () const
bool is_const () const
bool is_error () const
bool is_fork () const
bool is_infix_fork () const
bool is_infix_pipe () const
bool is_infix_tuple () const
bool is_link () const
bool is_literal () const
bool is_noop () const
bool is_null () const
bool is_preproc () const
bool is_tuple () const
bool is_valid_link () const
Keyword keyword () const
boost::json::string_view keyword_to_str () const
bool match (boost::json::value const & x, Operator const & op={}) const
Eval and cast to boolean, return false on error.
bool operator!= (ExpressionView const & o) const
ExpressionView & operator= (ExpressionView const &) = default
ExpressionView & operator= (ExpressionView &&) = default
bool operator== (ExpressionView const & o) const
std::list< std::pair< std::string, std::string > > preprocessing_parameters () const
List of [param, json ptr].
std::string prettify () const
std::ostream & prettify_to (std::ostream & os) const
void prettify_to (char(&) buff) const
void prettify_to (char * buff, std::size_t n) const
std::string serialize () const
std::list< ExpressionView > subexpressions_list () const
Subexpressions.
boost::json::value to_json () const
std::list< ExpressionView > tuple_parameters () const
virtual ~ExpressionView () = default

Public Static Functions

Type Name
Encoding encodeLiteral (boost::json::value const & params)
Encoding encodeNested (Keyword const & keyword, std::initializer_list< Expression > subexpressions)
Encoding encodeNested (Keyword const & keyword, std::vector< Expression > && subexpressions)
Encoding encodePreProc (boost::json::value const & params)
bool to_predicate_if_const (Expression & e)

Protected Attributes inherited from zmbt::lang::ExpressionView

See zmbt::lang::ExpressionView

Type Name
EncodingView encoding_view_

Public Functions Documentation

function Expression [1/11]

zmbt::lang::Expression::Expression () 

function Expression [2/11]

explicit zmbt::lang::Expression::Expression (
    Encoding && encoding
) 

function Expression [3/11]

explicit zmbt::lang::Expression::Expression (
    Encoding const & encoding
) 

function Expression [4/11]

zmbt::lang::Expression::Expression (
    boost::json::value const & expr
) 

function Expression [5/11]

zmbt::lang::Expression::Expression (
    boost::json::value && expr
) 

function Expression [6/11]

zmbt::lang::Expression::Expression (
    std::initializer_list< boost::json::value_ref > items
) 

function Expression [7/11]

template<class T>
inline zmbt::lang::Expression::Expression (
    T sample
) 

function Expression [8/11]

explicit zmbt::lang::Expression::Expression (
    Keyword const & keyword
) 

function Expression [9/11]

explicit zmbt::lang::Expression::Expression (
    ExpressionView const & view
) 

function Expression [10/11]

zmbt::lang::Expression::Expression (
    Expression const & other
) 

function Expression [11/11]

zmbt::lang::Expression::Expression (
    Expression && other
) 

function encoding

inline Encoding zmbt::lang::Expression::encoding () const

function operator!=

inline bool zmbt::lang::Expression::operator!= (
    Expression v
) const

function operator=

Expression & zmbt::lang::Expression::operator= (
    Expression const & other
) 

function operator=

Expression & zmbt::lang::Expression::operator= (
    Expression && other
) 

function operator==

inline bool zmbt::lang::Expression::operator== (
    Expression v
) const

function ~Expression

zmbt::lang::Expression::~Expression () = default

Public Static Functions Documentation

function encodeLiteral

static Encoding zmbt::lang::Expression::encodeLiteral (
    boost::json::value const & params
) 

function encodeNested [2/3]

static Encoding zmbt::lang::Expression::encodeNested (
    Keyword const & keyword,
    std::initializer_list< Expression > subexpressions
) 

function encodeNested [3/3]

static Encoding zmbt::lang::Expression::encodeNested (
    Keyword const & keyword,
    std::vector< Expression > && subexpressions
) 

function encodePreProc

static Encoding zmbt::lang::Expression::encodePreProc (
    boost::json::value const & params
) 

function to_predicate_if_const

static bool zmbt::lang::Expression::to_predicate_if_const (
    Expression & e
) 

Friends Documentation

friend operator&

Pack expression results into an array.

Expression zmbt::lang::Expression::operator& (
    Expression lhs,
    Expression rhs
) 

See also: zmbt::expr::Fork.


friend operator+

Pack expression into an array. without evaluation.

Expression zmbt::lang::Expression::operator+ (
    Expression lhs,
    Expression rhs
) 

See also: zmbt::expr::Tuple.


friend operator<<

Inline named function, equivalent to Fn(link + expr)

Expression zmbt::lang::Expression::operator<< (
    Expression link,
    Expression expr
) 


friend operator|

Expression zmbt::lang::Expression::operator| (
    Expression lhs,
    Expression rhs
) 

Pipe expressions left-to-right

Pipe functional expressions in composition, s.t. a | b is equivalent to Pipe(a, b).

See also: zmbt::expr::Pipe


friend operator~

Flip design-time and eval-time parameters.

Expression zmbt::lang::Expression::operator~ (
    Expression expr
) 



The documentation for this class was generated from the following file zmbt-framework/zmbt-framework/backends/cxx/include/zmbt/expr/expression.hpp