xo-reader2 xo-expresion2: work on define-expressions [WIP]

This commit is contained in:
Roland Conybeare 2026-01-19 21:25:30 -05:00
commit da0d736946
14 changed files with 431 additions and 4 deletions

View file

@ -19,15 +19,33 @@ namespace xo {
**/
class DVariable {
public:
using AAllocator = xo::mm::AAllocator;
using TypeDescr = xo::reflect::TypeDescr;
public:
DVariable(const DUniqueString & name, const TypeRef & typeref, Binding path)
: name_{name}, typeref_{typeref}, path_{path} {}
/** create instance
* @p mm memory allocator
* @p name variable name
* @p typeref type information for legal values
* (possibly just placeholder when relying on inference)
* @p path binding path to runtime value.
* This may be computed after parsing;
* mnust be resolved before execution.
**/
static DVariable * make(obj<AAllocator> mm,
const DUniqueString * name,
const TypeRef & typeref,
Binding path = Binding());
const DUniqueString & name() const { return name_; }
DVariable(const DUniqueString * name,
const TypeRef & typeref,
Binding path);
const DUniqueString * name() const { return name_; }
Binding path() const { return path_; }
void assign_name(const DUniqueString * name) { this->name_ = name; }
/** @defgroup scm-variable-expression-facet**/
///@{
@ -40,7 +58,7 @@ namespace xo {
private:
/** symbol name **/
const DUniqueString & name_;
const DUniqueString * name_;
/** variable value always has type consistent
* with this description
**/