xo-reader2 xo-expresion2: work on define-expressions [WIP]
This commit is contained in:
parent
f0e7a186a8
commit
da0d736946
14 changed files with 431 additions and 4 deletions
|
|
@ -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
|
||||
**/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue