hexed 0.3.0
 
Loading...
Searching...
No Matches
hexed::Struct_expr Class Reference

evaluates a structured expression in HIL More...

#include <Struct_expr.hpp>

Public Member Functions

 Struct_expr (std::string code)
 
std::vector< double > eval (Interpreter &) const
 executes the code and returns the values of the output variables.
 

Public Attributes

const std::vector< std::string > names
 names of output variables
 
const std::vector< std::string > exprs
 expressions for values of output variables
 

Detailed Description

evaluates a structured expression in HIL

Constructor & Destructor Documentation

◆ Struct_expr()

hexed::Struct_expr::Struct_expr ( std::string code)

Parameters
codeA structured expression, meaning an expression that always assigns to the same numeric variables, regardless of the environment in which it was executed. Specifically, it must satisfy the following requirements
  • It consists only of assignment statements where the LHS is non-empty and does not contain the macro-substitution character $.
  • The RHS must not contain line breaks or semicolons (except the one that terminates the statement, of course).
  • The RHS of the assignment statements may contain $, but any resulting substitutions must not line breaks/semicolons or exit the interpreter.
  • Each RHS must evaluate to an int or double.

Member Function Documentation

◆ eval()

std::vector< double > hexed::Struct_expr::eval ( Interpreter & inter) const

executes the code and returns the values of the output variables.

Variables are returned in the same order as names. Evaluates the expressions with the provided interpreter.


The documentation for this class was generated from the following files: