Skip to content

Class zmbt::lang::ExpressionView

ClassList > zmbt > lang > ExpressionView

More...

  • #include <expression.hpp>

Inherited by the following classes: zmbt::lang::Expression

Public Types

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

Public Functions

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

Protected Attributes

Type Name
EncodingView encoding_view_

Detailed Description

Expression Language implementation class.

See also: Expression Language documentation.

Public Types Documentation

typedef Keyword

using zmbt::lang::ExpressionView::Keyword =  lang::Keyword;

typedef V

using zmbt::lang::ExpressionView::V =  boost::json::value;

Public Functions Documentation

function ExpressionView [1/5]

zmbt::lang::ExpressionView::ExpressionView () 

function ExpressionView [2/5]

zmbt::lang::ExpressionView::ExpressionView (
    ExpressionView const &
) = default

function ExpressionView [3/5]

zmbt::lang::ExpressionView::ExpressionView (
    ExpressionView &&
) = default

function ExpressionView [4/5]

inline explicit zmbt::lang::ExpressionView::ExpressionView (
    EncodingView v
) 

function ExpressionView [5/5]

inline explicit zmbt::lang::ExpressionView::ExpressionView (
    Encoding enc
) 

function as_array

inline boost::json::array const & zmbt::lang::ExpressionView::as_array () const

function as_bool

inline bool zmbt::lang::ExpressionView::as_bool () const

function as_object

inline boost::json::object const & zmbt::lang::ExpressionView::as_object () const

function as_string

inline boost::json::string const & zmbt::lang::ExpressionView::as_string () const

function data

boost::json::value const & zmbt::lang::ExpressionView::data () const

function encoding_view

inline EncodingView zmbt::lang::ExpressionView::encoding_view () const

function eval

Evaluate expression.

boost::json::value zmbt::lang::ExpressionView::eval (
    boost::json::value const & x=nullptr,
    EvalContext ctx={}
) const

Parameters:

  • x run-time argument
  • ctx evaluation context

Returns:


function eval_as_predicate [1/2]

bool zmbt::lang::ExpressionView::eval_as_predicate (
    ExpressionView const & x,
    Expression & err_sts,
    EvalContext ctx
) const

Eval const expressions as Eq(expr), except for Noop, otherwise eval expr.


function eval_as_predicate [2/2]

bool zmbt::lang::ExpressionView::eval_as_predicate (
    boost::json::value const & x,
    Expression & err_sts,
    EvalContext ctx
) const

Eval const expressions as Eq(expr), except for Noop, otherwise eval expr. Store result in arg reference and return error status.


function eval_e

Evaluate expression.

Expression zmbt::lang::ExpressionView::eval_e (
    ExpressionView const & x,
    EvalContext ctx
) const

Parameters:

  • x run-time argument
  • ctx evaluation context

Returns:


function eval_maybe_predicate

Expression zmbt::lang::ExpressionView::eval_maybe_predicate (
    ExpressionView const & x,
    EvalContext ctx
) const

function has_subexpr

inline bool zmbt::lang::ExpressionView::has_subexpr () const

function if_array

inline boost::json::array const * zmbt::lang::ExpressionView::if_array () const

function if_bool

inline bool const * zmbt::lang::ExpressionView::if_bool () const

function if_object

inline boost::json::object const * zmbt::lang::ExpressionView::if_object () const

function if_string

inline boost::json::string const * zmbt::lang::ExpressionView::if_string () const

function is

inline bool zmbt::lang::ExpressionView::is (
    Keyword const kwrd
) const

function is_boolean

bool zmbt::lang::ExpressionView::is_boolean () const

function is_complete_flip

inline bool zmbt::lang::ExpressionView::is_complete_flip () const

function is_compose

inline bool zmbt::lang::ExpressionView::is_compose () const

function is_const

bool zmbt::lang::ExpressionView::is_const () const

function is_error

inline bool zmbt::lang::ExpressionView::is_error () const

function is_fork

inline bool zmbt::lang::ExpressionView::is_fork () const

function is_infix_fork

inline bool zmbt::lang::ExpressionView::is_infix_fork () const

function is_infix_pipe

inline bool zmbt::lang::ExpressionView::is_infix_pipe () const

function is_infix_tuple

inline bool zmbt::lang::ExpressionView::is_infix_tuple () const

inline bool zmbt::lang::ExpressionView::is_link () const

function is_literal

inline bool zmbt::lang::ExpressionView::is_literal () const

function is_noop

inline bool zmbt::lang::ExpressionView::is_noop () const

function is_null

inline bool zmbt::lang::ExpressionView::is_null () const

function is_preproc

inline bool zmbt::lang::ExpressionView::is_preproc () const

function is_tuple

inline bool zmbt::lang::ExpressionView::is_tuple () const

inline bool zmbt::lang::ExpressionView::is_valid_link () const

function keyword

inline Keyword zmbt::lang::ExpressionView::keyword () const

function keyword_to_str

boost::json::string_view zmbt::lang::ExpressionView::keyword_to_str () const

function match

Eval and cast to boolean, return false on error.

bool zmbt::lang::ExpressionView::match (
    boost::json::value const & x,
    Operator const & op={}
) const


function operator!=

inline bool zmbt::lang::ExpressionView::operator!= (
    ExpressionView const & o
) const

function operator=

ExpressionView & zmbt::lang::ExpressionView::operator= (
    ExpressionView const &
) = default

function operator=

ExpressionView & zmbt::lang::ExpressionView::operator= (
    ExpressionView &&
) = default

function operator==

inline bool zmbt::lang::ExpressionView::operator== (
    ExpressionView const & o
) const

function preprocessing_parameters

List of [param, json ptr].

std::list< std::pair< std::string, std::string > > zmbt::lang::ExpressionView::preprocessing_parameters () const


function prettify

std::string zmbt::lang::ExpressionView::prettify () const

function prettify_to [1/3]

std::ostream & zmbt::lang::ExpressionView::prettify_to (
    std::ostream & os
) const

function prettify_to [2/3]

template<std::size_t N>
inline void zmbt::lang::ExpressionView::prettify_to (
    char(&) buff
) const

function prettify_to [3/3]

void zmbt::lang::ExpressionView::prettify_to (
    char * buff,
    std::size_t n
) const

function serialize

inline std::string zmbt::lang::ExpressionView::serialize () const

function subexpressions_list

Subexpressions.

std::list< ExpressionView > zmbt::lang::ExpressionView::subexpressions_list () const


function to_json

boost::json::value zmbt::lang::ExpressionView::to_json () const

function tuple_parameters

std::list< ExpressionView > zmbt::lang::ExpressionView::tuple_parameters () const

function ~ExpressionView

virtual zmbt::lang::ExpressionView::~ExpressionView () = default

Protected Attributes Documentation

variable encoding_view_

EncodingView zmbt::lang::ExpressionView::encoding_view_;

Friends Documentation

friend operator*

Evaluate x to lhs expression.

V zmbt::lang::ExpressionView::operator* (
    ExpressionView expr,
    ExpressionView const & x
) 

Equivalent to expr.eval(x).


friend operator*

Evaluate expression.

V zmbt::lang::ExpressionView::operator* (
    ExpressionView expr
) 

Equivalent to expr.eval().


friend operator<<

std::ostream & zmbt::lang::ExpressionView::operator<< (
    std::ostream & os,
    ExpressionView const & expr
) 

friend operator<<

zmbt::Logger & zmbt::lang::ExpressionView::operator<< (
    zmbt::Logger & logger,
    ExpressionView const & expr
) 


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