Compare commits

..

No commits in common. "e6d3846dbff97c2e4e82c3bcfd2744f2fe4f820a" and "43de5f4f8fef72c74c30a6cf1974b95390bc236e" have entirely different histories.

375 changed files with 9712 additions and 24890 deletions

View file

@ -1,10 +1,8 @@
# xo-reader2/CMakeLists.txt
# xo-expression2/CMakeLists.txt
cmake_minimum_required(VERSION 3.10)
#set(CMAKE_CXX_STANDARD 23)
project(xo_reader2 VERSION 1.0)
project(xo_expression2 VERSION 1.0)
enable_language(CXX)
include(GNUInstallDirs)
@ -24,376 +22,310 @@ add_definitions(${PROJECT_CXX_FLAGS})
add_subdirectory(utest)
# ----------------------------------------------------------------
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-gcobject-schematikaparser
FACET_PKG xo_alloc2
INPUT idl/IGCObject_DSchematikaParser.json5
)
# ----------------------------------------------------------------
# note: manual target; generated code committed to git
xo_add_genfacet(
TARGET xo-reader2-facet-syntaxstatemachine
FACET SyntaxStateMachine
INPUT idl/SyntaxStateMachine.json5
TARGET xo-expression2-facet-symboltable
FACET SymbolTable
INPUT idl/SymbolTable.json5
OUTPUT_HPP_DIR include/xo/expression2
OUTPUT_IMPL_SUBDIR detail
)
# ----------------------------------------------------------------
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-syntaxstatemachine-toplevelseqssm
FACET_PKG xo_reader2
INPUT idl/ISyntaxStateMachine_DToplevelSeqSsm.json5
TARGET xo-expression2-facetimpl-symboltable-localsymtab
FACET_PKG xo_expression2
# REPR LocalSymtab
INPUT idl/ISymbolTable_DLocalSymtab.json5
)
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-printable-toplevelseqssm
FACET_PKG xo_printable2
INPUT idl/IPrintable_DToplevelSeqSsm.json5
)
# ----------------------------------------------------------------
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-syntaxstatemachine-definessm
FACET_PKG xo_reader2
INPUT idl/ISyntaxStateMachine_DDefineSsm.json5
)
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-printable-definessm
FACET_PKG xo_printable2
INPUT idl/IPrintable_DDefineSsm.json5
)
# ----------------------------------------------------------------
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-syntaxstatemachine-deftypessm
FACET_PKG xo_reader2
INPUT idl/ISyntaxStateMachine_DDeftypeSsm.json5
)
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-printable-deftypessm
FACET_PKG xo_printable2
INPUT idl/IPrintable_DDeftypeSsm.json5
)
# ----------------------------------------------------------------
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-syntaxstatemachine-lambdassm
FACET_PKG xo_reader2
INPUT idl/ISyntaxStateMachine_DLambdaSsm.json5
)
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-printable-lambdassm
FACET_PKG xo_printable2
INPUT idl/IPrintable_DLambdaSsm.json5
)
# ----------------------------------------------------------------
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-syntaxstatemachine-parenssm
FACET_PKG xo_reader2
INPUT idl/ISyntaxStateMachine_DParenSsm.json5
)
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-printable-parenssm
FACET_PKG xo_printable2
INPUT idl/IPrintable_DParenSsm.json5
)
# ----------------------------------------------------------------
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-syntaxstatemachine-expectformalarglistssm
FACET_PKG xo_reader2
INPUT idl/ISyntaxStateMachine_DExpectFormalArglistSsm.json5
)
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-printable-expectformalarglistssm
FACET_PKG xo_printable2
INPUT idl/IPrintable_DExpectFormalArglistSsm.json5
)
# ----------------------------------------------------------------
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-syntaxstatemachine-expectformalargssm
FACET_PKG xo_reader2
INPUT idl/ISyntaxStateMachine_DExpectFormalArgSsm.json5
)
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-printable-expectformalargssm
FACET_PKG xo_printable2
INPUT idl/IPrintable_DExpectFormalArgSsm.json5
)
# ----------------------------------------------------------------
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-syntaxstatemachine-ifelsessm
FACET_PKG xo_reader2
INPUT idl/ISyntaxStateMachine_DIfElseSsm.json5
)
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-printable-ifelsessm
FACET_PKG xo_printable2
INPUT idl/IPrintable_DIfElseSsm.json5
)
# ----------------------------------------------------------------
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-syntaxstatemachine-sequencessm
FACET_PKG xo_reader2
INPUT idl/ISyntaxStateMachine_DSequenceSsm.json5
)
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-printable-sequencessm
FACET_PKG xo_printable2
INPUT idl/IPrintable_DSequenceSsm.json5
)
# ----------------------------------------------------------------
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-syntaxstatemachine-applyssm
FACET_PKG xo_reader2
INPUT idl/ISyntaxStateMachine_DApplySsm.json5
)
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-printable-applyssm
FACET_PKG xo_printable2
INPUT idl/IPrintable_DApplySsm.json5
)
# ----------------------------------------------------------------
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-syntaxstatemachine-expectsymbolssm
FACET_PKG xo_reader2
INPUT idl/ISyntaxStateMachine_DExpectSymbolSsm.json5
)
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-printable-expectsymbolssm
FACET_PKG xo_printable2
INPUT idl/IPrintable_DExpectSymbolSsm.json5
)
# ----------------------------------------------------------------
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-syntaxstatemachine-expecttypessm
FACET_PKG xo_reader2
INPUT idl/ISyntaxStateMachine_DExpectTypeSsm.json5
)
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-printable-expecttypessm
FACET_PKG xo_printable2
INPUT idl/IPrintable_DExpectTypeSsm.json5
)
# ----------------------------------------------------------------
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-syntaxstatemachine-expectlisttypessm
FACET_PKG xo_reader2
INPUT idl/ISyntaxStateMachine_DExpectListTypeSsm.json5
)
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-printable-expectlisttypessm
FACET_PKG xo_printable2
INPUT idl/IPrintable_DExpectListTypeSsm.json5
)
# ----------------------------------------------------------------
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-syntaxstatemachine-expectexprssm
FACET_PKG xo_reader2
INPUT idl/ISyntaxStateMachine_DExpectExprSsm.json5
)
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-printable-expectexprssm
FACET_PKG xo_printable2
INPUT idl/IPrintable_DExpectExprSsm.json5
)
# ----------------------------------------------------------------
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-syntaxstatemachine-progressssm
FACET_PKG xo_reader2
INPUT idl/ISyntaxStateMachine_DProgressSsm.json5
)
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-printable-progressssm
FACET_PKG xo_printable2
INPUT idl/IPrintable_DProgressSsm.json5
)
# ----------------------------------------------------------------
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-syntaxstatemachine-quotessm
FACET_PKG xo_reader2
INPUT idl/ISyntaxStateMachine_DQuoteSsm.json5
)
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-printable-quotessm
FACET_PKG xo_printable2
INPUT idl/IPrintable_DQuoteSsm.json5
)
# ----------------------------------------------------------------
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-syntaxstatemachine-expectqliteralssm
FACET_PKG xo_reader2
INPUT idl/ISyntaxStateMachine_DExpectQLiteralSsm.json5
)
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-printable-expectqliteralssm
FACET_PKG xo_printable2
INPUT idl/IPrintable_DExpectQLiteralSsm.json5
)
# ----------------------------------------------------------------
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-syntaxstatemachine-expectqlistssm
FACET_PKG xo_reader2
INPUT idl/ISyntaxStateMachine_DExpectQListSsm.json5
)
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-printable-expectqlistssm
FACET_PKG xo_printable2
INPUT idl/IPrintable_DExpectQListSsm.json5
)
# ----------------------------------------------------------------
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-syntaxstatemachine-expectqdictssm
FACET_PKG xo_reader2
INPUT idl/ISyntaxStateMachine_DExpectQDictSsm.json5
)
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-printable-expectqdictssm
FACET_PKG xo_printable2
INPUT idl/IPrintable_DExpectQDictSsm.json5
)
# ----------------------------------------------------------------
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-syntaxstatemachine-expectqarrayssm
FACET_PKG xo_reader2
INPUT idl/ISyntaxStateMachine_DExpectQArraySsm.json5
)
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-printable-expectqarrayssm
FACET_PKG xo_printable2
INPUT idl/IPrintable_DExpectQArraySsm.json5
)
# ----------------------------------------------------------------
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-gcobject-globalenv
TARGET xo-expression2-facetimpl-gcobject-localsymtab
FACET_PKG xo_alloc2
INPUT idl/IGCObject_DGlobalEnv.json5
# REPR LocalSymtab
INPUT idl/IGCObject_DLocalSymtab.json5
)
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-printable-globalenv
TARGET xo-expression2-facetimpl-printable-localsymtab
FACET_PKG xo_printable2
INPUT idl/IPrintable_DGlobalEnv.json5
# REPR LocalSymtab
INPUT idl/IPrintable_DLocalSymtab.json5
)
# ----------------------------------------------------------------
xo_add_genfacet_all(xo-reader2-genfacet-all)
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-expression2-facetimpl-symboltable-globalsymtab
FACET_PKG xo_expression2
# REPR GlobalSymtab
INPUT idl/ISymbolTable_DGlobalSymtab.json5
)
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-expression2-facetimpl-gcobject-globalsymtab
FACET_PKG xo_alloc2
# REPR GlobalSymtab
INPUT idl/IGCObject_DGlobalSymtab.json5
)
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-expression2-facetimpl-printable-globalsymtab
FACET_PKG xo_printable2
# REPR GlobalSymtab
INPUT idl/IPrintable_DGlobalSymtab.json5
)
# ----------------------------------------------------------------
# note: manual target; generated code committed to git
xo_add_genfacet(
TARGET xo-expression2-facet-expression
FACET Expression
INPUT idl/Expression.json5
OUTPUT_HPP_DIR include/xo/expression2
OUTPUT_IMPL_SUBDIR detail
)
# ----------------------------------------------------------------
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-expression2-facetimpl-expression-constant
FACET_PKG xo_expression2
# REPR Constant
INPUT idl/IExpression_DConstant.json5
)
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-expression2-facetimpl-gcobject-constant
FACET_PKG xo_alloc2
# REPR Constant
INPUT idl/IGCObject_DConstant.json5
)
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-expression2-facetimpl-printable-constant
FACET_PKG xo_printable2
# REPR Constant
INPUT idl/IPrintable_DConstant.json5
)
# ----------------------------------------------------------------
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-expression2-facetimpl-expression-variable
FACET_PKG xo_expression2
# REPR Variable
INPUT idl/IExpression_DVariable.json5
)
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-expression2-facetimpl-gcobject-variable
FACET_PKG xo_alloc2
# REPR Variable
INPUT idl/IGCObject_DVariable.json5
)
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-expression2-facetimpl-printable-variable
FACET_PKG xo_printable2
# REPR Variable
INPUT idl/IPrintable_DVariable.json5
)
# ----------------------------------------------------------------
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-expression2-facetimpl-gcobject-typename
FACET_PKG xo_alloc2
# REPR Typename
INPUT idl/IGCObject_DTypename.json5
)
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-expression2-facetimpl-printable-typename
FACET_PKG xo_printable2
# REPR Typename
INPUT idl/IPrintable_DTypename.json5
)
# ----------------------------------------------------------------
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-expression2-facetimpl-expression-varref
FACET_PKG xo_expression2
# REPR VarRef
INPUT idl/IExpression_DVarRef.json5
)
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-expression2-facetimpl-gcobject-varref
FACET_PKG xo_alloc2
# REPR VarRef
INPUT idl/IGCObject_DVarRef.json5
)
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-expression2-facetimpl-printable-varref
FACET_PKG xo_printable2
# REPR VarRef
INPUT idl/IPrintable_DVarRef.json5
)
# ----------------------------------------------------------------
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-expression2-facetimpl-expression-defineexpr
FACET_PKG xo_expression2
# REPR DefineExpr
INPUT idl/IExpression_DDefineExpr.json5
)
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-expression2-facetimpl-gcobject-defineexpr
FACET_PKG xo_alloc2
# REPR DefineExpr
INPUT idl/IGCObject_DDefineExpr.json5
)
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-expression2-facetimpl-printable-defineexpr
FACET_PKG xo_printable2
# REPR DefineExpr
INPUT idl/IPrintable_DDefineExpr.json5
)
# ----------------------------------------------------------------
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-expression2-facetimpl-expression-applyexpr
FACET_PKG xo_expression2
# REPR ApplyExpr
INPUT idl/IExpression_DApplyExpr.json5
)
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-expression2-facetimpl-gcobject-applyexpr
FACET_PKG xo_alloc2
# REPR ApplyExpr
INPUT idl/IGCObject_DApplyExpr.json5
)
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-expression2-facetimpl-printable-applyexpr
FACET_PKG xo_printable2
# REPR ApplyExpr
INPUT idl/IPrintable_DApplyExpr.json5
)
# ----------------------------------------------------------------
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-expression2-facetimpl-expression-lambdaexpr
FACET_PKG xo_expression2
# REPR LambdaExpr
INPUT idl/IExpression_DLambdaExpr.json5
)
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-expression2-facetimpl-gcobject-lambdaexpr
FACET_PKG xo_alloc2
# REPR LambdaExpr
INPUT idl/IGCObject_DLambdaExpr.json5
)
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-expression2-facetimpl-printable-lambdaexpr
FACET_PKG xo_printable2
# REPR LambdaExpr
INPUT idl/IPrintable_DLambdaExpr.json5
)
# ----------------------------------------------------------------
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-expression2-facetimpl-expression-ifelseexpr
FACET_PKG xo_expression2
# REPR IfElseExpr
INPUT idl/IExpression_DIfElseExpr.json5
)
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-expression2-facetimpl-gcobject-ifelseexpr
FACET_PKG xo_alloc2
INPUT idl/IGCObject_DIfElseExpr.json5
)
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-expression2-facetimpl-printable-ifelseexpr
FACET_PKG xo_printable2
INPUT idl/IPrintable_DIfElseExpr.json5
)
# ----------------------------------------------------------------
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-expression2-facetimpl-expression-sequenceexpr
FACET_PKG xo_expression2
INPUT idl/IExpression_DSequenceExpr.json5
)
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-expression2-facetimpl-gcobject-sequenceexpr
FACET_PKG xo_alloc2
INPUT idl/IGCObject_DSequenceExpr.json5
)
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-expression2-facetimpl-printable-sequenceexpr
FACET_PKG xo_printable2
INPUT idl/IPrintable_DSequenceExpr.json5
)
# ----------------------------------------------------------------
xo_add_genfacet_all(xo-expression2-genfacet-all)
# ----------------------------------------------------------------
# shared library
add_subdirectory(src/reader2)
add_subdirectory(src/expression2)
# ----------------------------------------------------------------
# example programs
add_subdirectory(example)
# ----------------------------------------------------------------
# cmake helper (for external xo-reader2 users)
# cmake helper (for external xo-expression2 users)
xo_export_cmake_config(${PROJECT_NAME} ${PROJECT_VERSION} ${PROJECT_NAME}Targets)

View file

@ -1,21 +0,0 @@
Uses arena allocators for fast+efficient parsing.
Composition of nested state machines.
## SchematikaParser
Parser to convert schematika text to expressions.
### Details
Partial GCObject facet support, so a SchmeatikaParser instance can
be a gc root.
## SyntaxStateMachine
a state machine dedicated to some particular Schematika syntax.
Examples: if-expression, type declaration, function call
## DToplevelSeqSsm
top-level expression sequence

View file

@ -6,13 +6,14 @@ include(CMakeFindDependencyMacro)
# must coordinate with xo_dependency() calls
# in CMakeLists.txt
#
find_dependency(xo_numeric)
find_dependency(xo_procedure2)
find_dependency(xo_gc)
find_dependency(xo_type)
find_dependency(xo_tokenizer2)
find_dependency(xo_expression2)
find_dependency(subsys)
find_dependency(xo_gc)
find_dependency(reflect)
find_dependency(xo_procedure2)
find_dependency(xo_printable2)
find_dependency(xo_flatstring)
find_dependency(cmake)
find_dependency(indentlog)
include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Share.cmake")

View file

@ -1,6 +0,0 @@
diagram for parsing stack.
stack growing down for nested ssm's
`on_if_token` etc going to same state
`on_parsed_xxx` going back up the stack

View file

@ -1,3 +0,0 @@
ssm = syntax state machine
psm = parser state machine
ckp = checkpoint

View file

@ -1 +0,0 @@
add_subdirectory(readerreplxx)

View file

@ -1,14 +0,0 @@
# xo-reader2/example/readerreplxx/CMakeLists.txt
set(SELF_EXE xo_reader2_readereplxx)
set(SELF_SRCS readerreplxx.cpp)
if (XO_ENABLE_EXAMPLES)
xo_add_executable(${SELF_EXE} ${SELF_SRCS})
xo_self_dependency(${SELF_EXE} xo_reader2)
xo_external_target_dependency(${SELF_EXE} replxx replxx::replxx)
# replxx requires this
find_package(Threads REQUIRED)
target_link_libraries(${SELF_EXE} PUBLIC Threads::Threads)
endif()

View file

@ -1,248 +0,0 @@
/** @file readerreplxx.cpp **/
#include <xo/reader2/init_reader2.hpp>
#include <xo/reader2/SchematikaReader.hpp>
#include <xo/gc/X1Collector.hpp>
#include <xo/gc/detail/IAllocator_DX1Collector.hpp>
#include <xo/alloc2/Arena.hpp>
#include <xo/alloc2/Allocator.hpp>
#include <xo/printable2/Printable.hpp>
#include <xo/facet/FacetRegistry.hpp>
#include <xo/facet/obj.hpp>
#include <xo/subsys/Subsystem.hpp>
#include <replxx.hxx>
#include <iostream>
#include <unistd.h> // for isatty
// presumeably replxx assumes input is a tty
//
bool replxx_getline(bool interactive,
bool is_at_toplevel,
replxx::Replxx & rx,
const char ** p_input)
{
using namespace std;
char const * prompt = "";
if (interactive) {
prompt = ((is_at_toplevel) ? "> " : ". ");
}
const char * input_cstr = rx.input(prompt);
bool retval = (input_cstr != nullptr);
if (retval)
*p_input = input_cstr;
if (input_cstr)
rx.history_add(input_cstr);
return retval;
}
void
welcome(std::ostream & os)
{
using namespace std;
os << "read-eval-print loop for schematika expressions" << endl;
os << " ctrl-a/ctrl-e beginning/end of line" << endl;
os << " ctrl-u delete entire line" << endl;
os << " ctrl-k delete to end of line" << endl;
os << " meta-<bs> backward delete word" << endl;
os << " <up>|meta-p previous command from history" << endl;
os << " <down>|meta-n next command from history" << endl;
os << " <pgup>/<pgdown> page through history faster" << endl;
os << " ctrl-s/ctrl-r forward/backward history search" << endl;
os << endl;
}
namespace {
using xo::scm::SchematikaReader;
using xo::scm::AExpression;
using xo::print::APrintable;
using xo::print::ppstate_standalone;
using xo::print::ppconfig;
using xo::facet::FacetRegistry;
using xo::facet::obj;
using xo::xtag;
using xo::scope;
using std::cout;
using std::endl;
/** body of read-parse-print loop
*
* true -> no errors;
* false -> reader encountered error
**/
bool
reader_seq(SchematikaReader * p_reader,
SchematikaReader::span_type * p_input,
bool eof,
bool debug_flag)
{
scope log(XO_DEBUG(debug_flag));
if (!p_input || p_input->empty())
return true;
auto [expr, remaining, error] = p_reader->read_expr(*p_input, eof);
obj<APrintable> expr_pr;
if (expr) {
expr_pr = FacetRegistry::instance().variant<APrintable,AExpression>(expr);
assert(expr_pr);
}
if (log) {
if (expr_pr) {
log(xtag("expr", expr_pr));
}
log(xtag("remaining", remaining));
log(xtag("error", error));
}
if (expr) {
ppconfig ppc;
ppstate_standalone pps(&cout, 0, &ppc);
pps.prettyn(expr_pr);
p_reader->reset_result();
*p_input = remaining;
return true;
} else if (error.is_error()) {
cout << "parsing error (detected in " << error.src_function() << "): " << endl;
error.report(cout);
/* discard stashed remainder of input line
* (for nicely-formatted errors)
*/
p_reader->reset_to_idle_toplevel();
return false;
} else {
*p_input = remaining;
/* partial expression or whitespace input, no error */
return true;
}
}
}
struct AppConfig {
using ReaderConfig = xo::scm::ReaderConfig;
using X1CollectorConfig = xo::mm::X1CollectorConfig;
using ArenaConfig = xo::mm::ArenaConfig;
AppConfig() {
rdr_config_.reader_debug_flag_ = true;
//rdr_config.parser_debug_flag_ = true;
//rdr_config.tk_debug_flag_ = true;
}
std::size_t max_history_size_ = 1000;
std::string repl_history_fname_ = "repl_history.txt";;
ReaderConfig rdr_config_;
X1CollectorConfig x1_config_ = (X1CollectorConfig().with_name("gc").with_size(4*1024*1024));
ArenaConfig fixed_config_ = (ArenaConfig().with_name("fixed").with_size(4*1024));
};
struct AppContext {
using AAllocator = xo::mm::AAllocator;
using DX1Collector = xo::mm::DX1Collector;
using X1CollectorConfig = xo::mm::X1CollectorConfig;
using DArena = xo::mm::DArena;
using ArenaConfig = xo::mm::ArenaConfig;
using Replxx = replxx::Replxx;
AppContext(const AppConfig & cfg = AppConfig()) : config_{cfg},
x1_{cfg.x1_config_},
fixed_{cfg.fixed_config_},
rdr_{config_.rdr_config_,
x1_.ref(),
obj<AAllocator,DArena>(&fixed_)}
{
rx_.set_max_history_size(config_.max_history_size_);
rx_.history_load(config_.repl_history_fname_);
// rx.bind_key_internal(Replxx::KEY::control('p'), "history_previous");
// rx.bind_key_internal(Replxx::KEY::control('n'), "history_next");
}
AppConfig config_;
Replxx rx_;
/** collector/allocator for schematika expressions **/
DX1Collector x1_;
/** e.g. for DArenaHashMap within global symtab **/
DArena fixed_;
SchematikaReader rdr_;
};
int
main()
{
using namespace replxx;
using xo::scm::SchematikaReader;
using xo::scm::ReaderConfig;
using xo::mm::AAllocator;
using xo::mm::DX1Collector;
using xo::mm::DArena;
using xo::facet::with_facet;
using xo::facet::obj;
using xo::S_reader2_tag;
using xo::InitSubsys;
using xo::Subsystem;
using xo::scope;
using namespace std;
bool interactive = isatty(STDIN_FILENO);
InitSubsys<S_reader2_tag>::require();
Subsystem::initialize_all();
AppConfig cfg;
AppContext cx(cfg);
constexpr bool c_debug_flag = false;
scope log(XO_DEBUG(c_debug_flag));
using span_type = SchematikaReader::span_type;
welcome(cerr);
cx.rdr_.begin_interactive_session();
bool eof = false;
const char * input_str = nullptr;
span_type input;
while (replxx_getline(interactive, cx.rdr_.is_at_toplevel(), cx.rx_, &input_str)) {
if (input_str && *input_str) {
input = span_type::from_cstr(input_str);
while (!input.empty()
&& reader_seq(&cx.rdr_, &input, false /*eof*/, c_debug_flag))
{
;
}
/* here: either:
* 1. input.empty() or
* 2. error encountered
*/
}
}
/* reminder: eof can complete at most one token */
reader_seq(&cx.rdr_, &input, true /*eof*/, c_debug_flag);
cx.rx_.history_save(cx.config_.repl_history_fname_);
}
/* end readerreplxx.cpp */

74
idl/Expression.json5 Normal file
View file

@ -0,0 +1,74 @@
{
mode: "facet",
output_cpp_dir: "src/expression2",
output_hpp_dir: "include/xo/expression2",
output_impl_subdir: "detail",
includes: [ "\"TypeRef.hpp\"",
"\"exprtype.hpp\"",
"<xo/reflect/TypeDescr.hpp>"],
// extra includes in Expression.hpp, if any
user_hpp_includes: [],
namespace1: "xo",
namespace2: "scm",
// text after includes, before AExpression
pretext: [ "// {pretext} here" ],
facet: "Expression",
detail_subdir: "detail",
brief: "a schematika expression",
using_doxygen: true,
doc: [
"Representation for executable Schematika expressions"
],
types: [
// using TypeDescr = xo::reflect::TypeDescr;
{
name: "TypeDescr",
doc: ["struct describing a type"],
definition: "xo::reflect::TypeDescr"
},
],
const_methods: [
{
name: "extype",
doc: ["expression type (constant | apply | ..)"],
return_type: "exprtype",
args: [],
const: true,
noexcept: true,
attributes: [],
},
{
name: "typeref",
doc: ["placeholder for type giving possible values for this expression"],
return_type: "TypeRef",
args: [],
const: true,
noexcept: true,
attributes: [],
},
{
name: "valuetype",
doc: ["type giving possible values for this expression. Maybe null before typecheck"],
return_type: "TypeDescr",
args: [],
const: true,
noexcept: true,
attributes: [],
},
],
nonconst_methods: [
{
name: "assign_valuetype",
doc: ["assing to valuetype member. Useful when scaffolding expressions"],
return_type: "void",
args: [
// void assign_valuetype(TypeDescr td)
{type: "TypeDescr", name: "td"},
],
const: false,
noexcept: true,
attributes: [],
}
],
router_facet_explicit_content: [ ],
}

View file

@ -0,0 +1,15 @@
{
mode: "implementation",
output_cpp_dir: "src/expression2",
output_hpp_dir: "include/xo/expression2",
output_impl_subdir: "detail",
includes: [ "\"Expression.hpp\"" ],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/Expression.json5",
brief: "provide AExpression interface for DApplyExpr state",
using_doxygen: true,
repr: "DApplyExpr",
doc: ["doc for IExpression+DApplyExpr" ],
}

View file

@ -0,0 +1,15 @@
{
mode: "implementation",
output_cpp_dir: "src/expression2",
output_hpp_dir: "include/xo/expression2",
output_impl_subdir: "detail",
includes: [ "\"Expression.hpp\"" ],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/Expression.json5",
brief: "provide AExpression interface for DConstant state",
using_doxygen: true,
repr: "DConstant",
doc: ["doc for something or other IExpression+DConstant" ],
}

View file

@ -0,0 +1,15 @@
{
mode: "implementation",
output_cpp_dir: "src/expression2",
output_hpp_dir: "include/xo/expression2",
output_impl_subdir: "detail",
includes: [ "\"Expression.hpp\"" ],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/Expression.json5",
brief: "provide AExpression interface for DDefineExpr state",
using_doxygen: true,
repr: "DDefineExpr",
doc: ["doc for IExpression+DDefineExpr" ],
}

View file

@ -0,0 +1,15 @@
{
mode: "implementation",
output_cpp_dir: "src/expression2",
output_hpp_dir: "include/xo/expression2",
output_impl_subdir: "detail",
includes: [ "\"Expression.hpp\"" ],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/Expression.json5",
brief: "provide AExpression interface for DIfElseExpr state",
using_doxygen: true,
repr: "DIfElseExpr",
doc: ["doc for IExpression+DIfElseExpr" ],
}

View file

@ -0,0 +1,15 @@
{
mode: "implementation",
output_cpp_dir: "src/expression2",
output_hpp_dir: "include/xo/expression2",
output_impl_subdir: "detail",
includes: [ "\"Expression.hpp\"" ],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/Expression.json5",
brief: "provide AExpression interface for DLambdaExpr state",
using_doxygen: true,
repr: "DLambdaExpr",
doc: ["doc for IExpression+DLambdaExpr" ],
}

View file

@ -0,0 +1,15 @@
{
mode: "implementation",
output_cpp_dir: "src/expression2",
output_hpp_dir: "include/xo/expression2",
output_impl_subdir: "detail",
includes: [ "\"Expression.hpp\"" ],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/Expression.json5",
brief: "provide AExpression interface for DSequenceExpr state",
using_doxygen: true,
repr: "DSequenceExpr",
doc: ["doc for something or other IExpression+DSequenceExpr" ],
}

View file

@ -0,0 +1,15 @@
{
mode: "implementation",
output_cpp_dir: "src/expression2",
output_hpp_dir: "include/xo/expression2",
output_impl_subdir: "detail",
includes: [ "\"Expression.hpp\"" ],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/Expression.json5",
brief: "provide AExpression interface for DVarRef state",
using_doxygen: true,
repr: "DVarRef",
doc: ["doc for IExpression+DVarRef" ],
}

View file

@ -0,0 +1,15 @@
{
mode: "implementation",
output_cpp_dir: "src/expression2/facet",
output_hpp_dir: "include/xo/expression2",
output_impl_subdir: "variable",
includes: [ "\"Expression.hpp\"" ],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/Expression.json5",
brief: "provide AExpression interface for DVariable state",
using_doxygen: true,
repr: "DVariable",
doc: ["doc for IExpression+DVariable" ],
}

View file

@ -0,0 +1,18 @@
{
mode: "implementation",
output_cpp_dir: "src/expression2",
output_hpp_dir: "include/xo/expression2",
output_impl_subdir: "detail",
includes: [
"<xo/alloc2/GCObject.hpp>",
"<xo/alloc2/Allocator.hpp>"
],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/GCObject.json5",
brief: "provide AGCObject interface for DApplyExpr",
using_doxygen: true,
repr: "DApplyExpr",
doc: [ "implement AGCObject for DApplyExpr" ],
}

View file

@ -0,0 +1,18 @@
{
mode: "implementation",
output_cpp_dir: "src/expression2",
output_hpp_dir: "include/xo/expression2",
output_impl_subdir: "detail",
includes: [
"<xo/alloc2/GCObject.hpp>",
"<xo/alloc2/Allocator.hpp>"
],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/GCObject.json5",
brief: "provide AGCObject interface for DConstant",
using_doxygen: true,
repr: "DConstant",
doc: [ "implement AGCObject for DConstant" ],
}

View file

@ -0,0 +1,18 @@
{
mode: "implementation",
output_cpp_dir: "src/expression2",
output_hpp_dir: "include/xo/expression2",
output_impl_subdir: "define",
includes: [
"<xo/alloc2/GCObject.hpp>",
"<xo/alloc2/Allocator.hpp>"
],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/GCObject.json5",
brief: "provide AGCObject interface for DDefineExpr",
using_doxygen: true,
repr: "DDefineExpr",
doc: [ "implement AGCObject for DDefineExpr" ],
}

View file

@ -0,0 +1,18 @@
{
mode: "implementation",
output_cpp_dir: "src/expression2",
output_hpp_dir: "include/xo/expression2",
output_impl_subdir: "symtab",
includes: [
"<xo/alloc2/GCObject.hpp>",
"<xo/alloc2/Allocator.hpp>"
],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/GCObject.json5",
brief: "provide AGCObject interface for DGlobalSymtab",
using_doxygen: true,
repr: "DGlobalSymtab",
doc: [ "implement AGCObject for DGlobalSymtab" ],
}

View file

@ -0,0 +1,18 @@
{
mode: "implementation",
output_cpp_dir: "src/expression2",
output_hpp_dir: "include/xo/expression2",
output_impl_subdir: "detail",
includes: [
"<xo/alloc2/GCObject.hpp>",
"<xo/alloc2/Allocator.hpp>"
],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/GCObject.json5",
brief: "provide AGCObject interface for DIfElseExpr",
using_doxygen: true,
repr: "DIfElseExpr",
doc: [ "implement AGCObject for DIfElseExpr" ],
}

View file

@ -0,0 +1,18 @@
{
mode: "implementation",
output_cpp_dir: "src/expression2",
output_hpp_dir: "include/xo/expression2",
output_impl_subdir: "detail",
includes: [
"<xo/alloc2/GCObject.hpp>",
"<xo/alloc2/Allocator.hpp>"
],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/GCObject.json5",
brief: "provide AGCObject interface for DLambdaExpr",
using_doxygen: true,
repr: "DLambdaExpr",
doc: [ "implement AGCObject for DLambdaExpr" ],
}

View file

@ -0,0 +1,18 @@
{
mode: "implementation",
output_cpp_dir: "src/expression2",
output_hpp_dir: "include/xo/expression2",
output_impl_subdir: "symtab",
includes: [
"<xo/alloc2/GCObject.hpp>",
"<xo/alloc2/Allocator.hpp>"
],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/GCObject.json5",
brief: "provide AGCObject interface for DLocalSymtab",
using_doxygen: true,
repr: "DLocalSymtab",
doc: [ "implement AGCObject for DLocalSymtab" ],
}

View file

@ -1,18 +0,0 @@
{
mode: "implementation",
output_cpp_dir: "src/reader2/facet",
output_hpp_dir: "include/xo/reader2",
output_impl_subdir: "parser",
includes: [
"<xo/alloc2/GCObject.hpp>",
"<xo/alloc2/Allocator.hpp>"
],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/GCObject.json5",
brief: "provide AGCObject interface for SchematikaParser",
using_doxygen: true,
repr: "DSchematikaParser",
doc: [ "implement AGCObject for DSchematikaParser" ],
}

View file

@ -0,0 +1,18 @@
{
mode: "implementation",
output_cpp_dir: "src/expression2",
output_hpp_dir: "include/xo/expression2",
output_impl_subdir: "detail",
includes: [
"<xo/alloc2/GCObject.hpp>",
"<xo/alloc2/Allocator.hpp>"
],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/GCObject.json5",
brief: "provide AGCObject interface for DSequenceExpr",
using_doxygen: true,
repr: "DSequenceExpr",
doc: [ "implement AGCObject for DSequenceExpr" ],
}

View file

@ -0,0 +1,18 @@
{
mode: "implementation",
output_cpp_dir: "src/expression2",
output_hpp_dir: "include/xo/expression2",
output_impl_subdir: "typename",
includes: [
// "<xo/alloc2/GCObject.hpp>",
// "<xo/alloc2/Allocator.hpp>"
],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/GCObject.json5",
brief: "provide AGCObject interface for DTypename",
using_doxygen: true,
repr: "DTypename",
doc: [ "implement AGCObject for DTypename" ],
}

View file

@ -1,8 +1,8 @@
{
mode: "implementation",
output_cpp_dir: "src/reader2/facet",
output_hpp_dir: "include/xo/reader2",
output_impl_subdir: "env",
output_cpp_dir: "src/expression2",
output_hpp_dir: "include/xo/expression2",
output_impl_subdir: "detail",
includes: [
"<xo/alloc2/GCObject.hpp>",
"<xo/alloc2/Allocator.hpp>"
@ -11,8 +11,8 @@
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/GCObject.json5",
brief: "provide AGCObject interface for GlobalEnv",
brief: "provide AGCObject interface for DVarRef",
using_doxygen: true,
repr: "DGlobalEnv",
doc: [ "implement AGCObject for DGlobalEnv" ],
repr: "DVarRef",
doc: [ "implement AGCObject for DVarRef" ],
}

View file

@ -0,0 +1,18 @@
{
mode: "implementation",
output_cpp_dir: "src/expression2/facet",
output_hpp_dir: "include/xo/expression2",
output_impl_subdir: "variable",
includes: [
"<xo/alloc2/GCObject.hpp>",
"<xo/alloc2/Allocator.hpp>"
],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/GCObject.json5",
brief: "provide AGCObject interface for DVariable",
using_doxygen: true,
repr: "DVariable",
doc: [ "implement AGCObject for DVariable" ],
}

View file

@ -0,0 +1,16 @@
{
mode: "implementation",
output_cpp_dir: "src/expression2",
output_hpp_dir: "include/xo/expression2",
output_impl_subdir: "detail",
includes: [ "<xo/printable2/Printable.hpp>",
"<xo/printable2/detail/IPrintable_Xfer.hpp>" ],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/Printable.json5",
brief: "provide APrintable interface for DApplyExpr",
using_doxygen: true,
repr: "DApplyExpr",
doc: [ "implement APrintable for DApplyExpr" ],
}

View file

@ -1,16 +0,0 @@
{
mode: "implementation",
output_cpp_dir: "src/reader2/facet",
output_hpp_dir: "include/xo/reader2",
output_impl_subdir: "apply",
includes: [ "<xo/printable2/Printable.hpp>",
"<xo/printable2/detail/IPrintable_Xfer.hpp>" ],
local_types: [],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/Printable.json5",
brief: "provide APrintable interface for DApplySsm",
using_doxygen: true,
repr: "DApplySsm",
doc: [ "implement APrintable for DApplySsm" ],
}

View file

@ -0,0 +1,16 @@
{
mode: "implementation",
output_cpp_dir: "src/expression2",
output_hpp_dir: "include/xo/expression2",
output_impl_subdir: "detail",
includes: [ "<xo/printable2/Printable.hpp>",
"<xo/printable2/detail/IPrintable_Xfer.hpp>" ],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/Printable.json5",
brief: "provide APrintable interface for DConstant",
using_doxygen: true,
repr: "DConstant",
doc: [ "implement APrintable for DConstant" ],
}

View file

@ -0,0 +1,16 @@
{
mode: "implementation",
output_cpp_dir: "src/expression2",
output_hpp_dir: "include/xo/expression2",
output_impl_subdir: "detail",
includes: [ "<xo/printable2/Printable.hpp>",
"<xo/printable2/detail/IPrintable_Xfer.hpp>" ],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/Printable.json5",
brief: "provide APrintable interface for DDefineExpr",
using_doxygen: true,
repr: "DDefineExpr",
doc: [ "implement APrintable for DDefineExpr" ],
}

View file

@ -1,16 +0,0 @@
{
mode: "implementation",
output_cpp_dir: "src/reader2/facet",
output_hpp_dir: "include/xo/reader2",
output_impl_subdir: "define",
includes: [ "<xo/printable2/Printable.hpp>",
"<xo/printable2/detail/IPrintable_Xfer.hpp>" ],
local_types: [],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/Printable.json5",
brief: "provide APrintable interface for DDefineSsm",
using_doxygen: true,
repr: "DDefineSsm",
doc: [ "implement APrintable for DDefineSsm" ],
}

View file

@ -1,16 +0,0 @@
{
mode: "implementation",
output_cpp_dir: "src/reader2/facet",
output_hpp_dir: "include/xo/reader2",
output_impl_subdir: "deftype",
includes: [ "<xo/printable2/Printable.hpp>",
"<xo/printable2/detail/IPrintable_Xfer.hpp>" ],
local_types: [],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/Printable.json5",
brief: "provide APrintable interface for DDeftypeSsm",
using_doxygen: true,
repr: "DDeftypeSsm",
doc: [ "implement APrintable for DDeftypeSsm" ],
}

View file

@ -1,16 +0,0 @@
{
mode: "implementation",
output_cpp_dir: "src/reader2",
output_hpp_dir: "include/xo/reader2",
output_impl_subdir: "ssm",
includes: [ "<xo/printable2/Printable.hpp>",
"<xo/printable2/detail/IPrintable_Xfer.hpp>" ],
local_types: [],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/Printable.json5",
brief: "provide APrintable interface for DExpectExprSsm",
using_doxygen: true,
repr: "DExpectExprSsm",
doc: [ "implement APrintable for DExpectExprSsm" ],
}

View file

@ -1,16 +0,0 @@
{
mode: "implementation",
output_cpp_dir: "src/reader2/facet",
output_hpp_dir: "include/xo/reader2",
output_impl_subdir: "expect_formal_arg",
includes: [ "<xo/printable2/Printable.hpp>",
"<xo/printable2/detail/IPrintable_Xfer.hpp>" ],
local_types: [],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/Printable.json5",
brief: "provide APrintable interface for DExpectFormalArgSsm",
using_doxygen: true,
repr: "DExpectFormalArgSsm",
doc: [ "implement APrintable for DExpectFormalArgSsm" ],
}

View file

@ -1,16 +0,0 @@
{
mode: "implementation",
output_cpp_dir: "src/reader2",
output_hpp_dir: "include/xo/reader2",
output_impl_subdir: "ssm",
includes: [ "<xo/printable2/Printable.hpp>",
"<xo/printable2/detail/IPrintable_Xfer.hpp>" ],
local_types: [],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/Printable.json5",
brief: "provide APrintable interface for DExpectFormalArglistSsm",
using_doxygen: true,
repr: "DExpectFormalArglistSsm",
doc: [ "implement APrintable for DExpectFormalArglistSsm" ],
}

View file

@ -1,16 +0,0 @@
{
mode: "implementation",
output_cpp_dir: "src/reader2/facet",
output_hpp_dir: "include/xo/reader2",
output_impl_subdir: "expect_listtype",
includes: [ "<xo/printable2/Printable.hpp>",
"<xo/printable2/detail/IPrintable_Xfer.hpp>" ],
local_types: [],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/Printable.json5",
brief: "provide APrintable interface for DExpectListTypeSsm",
using_doxygen: true,
repr: "DExpectListTypeSsm",
doc: [ "implement APrintable for DExpectListTypeSsm" ],
}

View file

@ -1,16 +0,0 @@
{
mode: "implementation",
output_cpp_dir: "src/reader2",
output_hpp_dir: "include/xo/reader2",
output_impl_subdir: "ssm",
includes: [ "<xo/printable2/Printable.hpp>",
"<xo/printable2/detail/IPrintable_Xfer.hpp>" ],
local_types: [],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/Printable.json5",
brief: "provide APrintable interface for DExpectQArraySsm",
using_doxygen: true,
repr: "DExpectQArraySsm",
doc: [ "implement APrintable for DExpectQArraySsm" ],
}

View file

@ -1,16 +0,0 @@
{
mode: "implementation",
output_cpp_dir: "src/reader2/facet",
output_hpp_dir: "include/xo/reader2",
output_impl_subdir: "expect_qdict",
includes: [ "<xo/printable2/Printable.hpp>",
"<xo/printable2/detail/IPrintable_Xfer.hpp>" ],
local_types: [],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/Printable.json5",
brief: "provide APrintable interface for DExpectQDictSsm",
using_doxygen: true,
repr: "DExpectQDictSsm",
doc: [ "implement APrintable for DExpectQDictSsm" ],
}

View file

@ -1,16 +0,0 @@
{
mode: "implementation",
output_cpp_dir: "src/reader2",
output_hpp_dir: "include/xo/reader2",
output_impl_subdir: "ssm",
includes: [ "<xo/printable2/Printable.hpp>",
"<xo/printable2/detail/IPrintable_Xfer.hpp>" ],
local_types: [],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/Printable.json5",
brief: "provide APrintable interface for DExpectQListSsm",
using_doxygen: true,
repr: "DExpectQListSsm",
doc: [ "implement APrintable for DExpectQListSsm" ],
}

View file

@ -1,16 +0,0 @@
{
mode: "implementation",
output_cpp_dir: "src/reader2",
output_hpp_dir: "include/xo/reader2",
output_impl_subdir: "ssm",
includes: [ "<xo/printable2/Printable.hpp>",
"<xo/printable2/detail/IPrintable_Xfer.hpp>" ],
local_types: [],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/Printable.json5",
brief: "provide APrintable interface for DExpectQLiteralSsm",
using_doxygen: true,
repr: "DExpectQLiteralSsm",
doc: [ "implement APrintable for DExpectQLiteralSsm" ],
}

View file

@ -1,16 +0,0 @@
{
mode: "implementation",
output_cpp_dir: "src/reader2",
output_hpp_dir: "include/xo/reader2",
output_impl_subdir: "ssm",
includes: [ "<xo/printable2/Printable.hpp>",
"<xo/printable2/detail/IPrintable_Xfer.hpp>" ],
local_types: [],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/Printable.json5",
brief: "provide APrintable interface for DExpectSymbolSsm",
using_doxygen: true,
repr: "DExpectSymbolSsm",
doc: [ "implement APrintable for DExpectSymbolSsm" ],
}

View file

@ -1,16 +0,0 @@
{
mode: "implementation",
output_cpp_dir: "src/reader2",
output_hpp_dir: "include/xo/reader2",
output_impl_subdir: "ssm",
includes: [ "<xo/printable2/Printable.hpp>",
"<xo/printable2/detail/IPrintable_Xfer.hpp>" ],
local_types: [],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/Printable.json5",
brief: "provide APrintable interface for DExpectTypeSsm",
using_doxygen: true,
repr: "DExpectTypeSsm",
doc: [ "implement APrintable for DExpectTypeSsm" ],
}

View file

@ -0,0 +1,16 @@
{
mode: "implementation",
output_cpp_dir: "src/expression2",
output_hpp_dir: "include/xo/expression2",
output_impl_subdir: "symtab",
includes: [ "<xo/printable2/Printable.hpp>",
"<xo/printable2/detail/IPrintable_Xfer.hpp>" ],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/Printable.json5",
brief: "provide APrintable interface for DGlobalSymtab",
using_doxygen: true,
repr: "DGlobalSymtab",
doc: [ "implement APrintable for DGlobalSymtab" ],
}

View file

@ -0,0 +1,16 @@
{
mode: "implementation",
output_cpp_dir: "src/expression2",
output_hpp_dir: "include/xo/expression2",
output_impl_subdir: "detail",
includes: [ "<xo/printable2/Printable.hpp>",
"<xo/printable2/detail/IPrintable_Xfer.hpp>" ],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/Printable.json5",
brief: "provide APrintable interface for DIfElseExpr",
using_doxygen: true,
repr: "DIfElseExpr",
doc: [ "implement APrintable for DIfElseExpr" ],
}

View file

@ -1,16 +0,0 @@
{
mode: "implementation",
output_cpp_dir: "src/reader2/facet",
output_hpp_dir: "include/xo/reader2",
output_impl_subdir: "ifelse",
includes: [ "<xo/printable2/Printable.hpp>",
"<xo/printable2/detail/IPrintable_Xfer.hpp>" ],
local_types: [],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/Printable.json5",
brief: "provide APrintable interface for DIfElseSsm",
using_doxygen: true,
repr: "DIfElseSsm",
doc: [ "implement APrintable for DIfElseSsm" ],
}

View file

@ -0,0 +1,16 @@
{
mode: "implementation",
output_cpp_dir: "src/expression2",
output_hpp_dir: "include/xo/expression2",
output_impl_subdir: "detail",
includes: [ "<xo/printable2/Printable.hpp>",
"<xo/printable2/detail/IPrintable_Xfer.hpp>" ],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/Printable.json5",
brief: "provide APrintable interface for DLambdaExpr",
using_doxygen: true,
repr: "DLambdaExpr",
doc: [ "implement APrintable for DLambdaExpr" ],
}

View file

@ -1,16 +0,0 @@
{
mode: "implementation",
output_cpp_dir: "src/reader2/facet",
output_hpp_dir: "include/xo/reader2",
output_impl_subdir: "lambda",
includes: [ "<xo/printable2/Printable.hpp>",
"<xo/printable2/detail/IPrintable_Xfer.hpp>" ],
local_types: [],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/Printable.json5",
brief: "provide APrintable interface for DLambdaSsm",
using_doxygen: true,
repr: "DLambdaSsm",
doc: [ "implement APrintable for DLambdaSsm" ],
}

View file

@ -0,0 +1,16 @@
{
mode: "implementation",
output_cpp_dir: "src/expression2",
output_hpp_dir: "include/xo/expression2",
output_impl_subdir: "symtab",
includes: [ "<xo/printable2/Printable.hpp>",
"<xo/printable2/detail/IPrintable_Xfer.hpp>" ],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/Printable.json5",
brief: "provide APrintable interface for DLocalSymtab",
using_doxygen: true,
repr: "DLocalSymtab",
doc: [ "implement APrintable for DLocalSymtab" ],
}

View file

@ -1,16 +0,0 @@
{
mode: "implementation",
output_cpp_dir: "src/reader2",
output_hpp_dir: "include/xo/reader2",
output_impl_subdir: "paren",
includes: [ "<xo/printable2/Printable.hpp>",
"<xo/printable2/detail/IPrintable_Xfer.hpp>" ],
local_types: [],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/Printable.json5",
brief: "provide APrintable interface for DParenSsm",
using_doxygen: true,
repr: "DParenSsm",
doc: [ "implement APrintable for DParenSsm" ],
}

View file

@ -1,16 +0,0 @@
{
mode: "implementation",
output_cpp_dir: "src/reader2",
output_hpp_dir: "include/xo/reader2",
output_impl_subdir: "ssm",
includes: [ "<xo/printable2/Printable.hpp>",
"<xo/printable2/detail/IPrintable_Xfer.hpp>" ],
local_types: [],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/Printable.json5",
brief: "provide APrintable interface for DProgressSsm",
using_doxygen: true,
repr: "DProgressSsm",
doc: [ "implement APrintable for DProgressSsm" ],
}

View file

@ -1,16 +0,0 @@
{
mode: "implementation",
output_cpp_dir: "src/reader2/facet",
output_hpp_dir: "include/xo/reader2",
output_impl_subdir: "quote",
includes: [ "<xo/printable2/Printable.hpp>",
"<xo/printable2/detail/IPrintable_Xfer.hpp>" ],
local_types: [],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/Printable.json5",
brief: "provide APrintable interface for DQuoteSsm",
using_doxygen: true,
repr: "DQuoteSsm",
doc: [ "implement APrintable for DQuoteSsm" ],
}

View file

@ -0,0 +1,16 @@
{
mode: "implementation",
output_cpp_dir: "src/expression2",
output_hpp_dir: "include/xo/expression2",
output_impl_subdir: "detail",
includes: [ "<xo/printable2/Printable.hpp>",
"<xo/printable2/detail/IPrintable_Xfer.hpp>" ],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/Printable.json5",
brief: "provide APrintable interface for DSequenceExpr",
using_doxygen: true,
repr: "DSequenceExpr",
doc: [ "implement APrintable for DSequenceExpr" ],
}

View file

@ -1,16 +0,0 @@
{
mode: "implementation",
output_cpp_dir: "src/reader2",
output_hpp_dir: "include/xo/reader2",
output_impl_subdir: "ssm",
includes: [ "<xo/printable2/Printable.hpp>",
"<xo/printable2/detail/IPrintable_Xfer.hpp>" ],
local_types: [],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/Printable.json5",
brief: "provide APrintable interface for DSequenceSsm",
using_doxygen: true,
repr: "DSequenceSsm",
doc: [ "implement APrintable for DSequenceSsm" ],
}

View file

@ -1,16 +0,0 @@
{
mode: "implementation",
output_cpp_dir: "src/reader2",
output_hpp_dir: "include/xo/reader2",
output_impl_subdir: "ssm",
includes: [ "<xo/printable2/Printable.hpp>",
"<xo/printable2/detail/IPrintable_Xfer.hpp>" ],
local_types: [],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/Printable.json5",
brief: "provide APrintable interface for DToplevelSeqSsm",
using_doxygen: true,
repr: "DToplevelSeqSsm",
doc: [ "implement APrintable for DToplevelSeqSsm" ],
}

View file

@ -0,0 +1,16 @@
{
mode: "implementation",
output_cpp_dir: "src/expression2",
output_hpp_dir: "include/xo/expression2",
output_impl_subdir: "typename",
includes: [ "<xo/printable2/Printable.hpp>",
"<xo/printable2/detail/IPrintable_Xfer.hpp>" ],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/Printable.json5",
brief: "provide APrintable interface for DTypename",
using_doxygen: true,
repr: "DTypename",
doc: [ "implement APrintable for DTypename" ],
}

View file

@ -1,16 +1,16 @@
{
mode: "implementation",
output_cpp_dir: "src/reader2/facet",
output_hpp_dir: "include/xo/reader2",
output_impl_subdir: "env",
output_cpp_dir: "src/expression2",
output_hpp_dir: "include/xo/expression2",
output_impl_subdir: "detail",
includes: [ "<xo/printable2/Printable.hpp>",
"<xo/printable2/detail/IPrintable_Xfer.hpp>" ],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/Printable.json5",
brief: "provide APrintable interface for DGlobalEnv",
brief: "provide APrintable interface for DVarRef",
using_doxygen: true,
repr: "DGlobalEnv",
doc: [ "implement APrintable for DGlobalEnv" ],
repr: "DVarRef",
doc: [ "implement APrintable for DVarRef" ],
}

View file

@ -0,0 +1,16 @@
{
mode: "implementation",
output_cpp_dir: "src/expression2/facet",
output_hpp_dir: "include/xo/expression2",
output_impl_subdir: "variable",
includes: [ "<xo/printable2/Printable.hpp>",
"<xo/printable2/detail/IPrintable_Xfer.hpp>" ],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/Printable.json5",
brief: "provide APrintable interface for DVariable",
using_doxygen: true,
repr: "DVariable",
doc: [ "implement APrintable for DVariable" ],
}

View file

@ -0,0 +1,15 @@
{
mode: "implementation",
output_cpp_dir: "src/expression2",
output_hpp_dir: "include/xo/expression2",
output_impl_subdir: "symtab",
includes: [ ],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/SymbolTable.json5",
brief: "provide ASymbolTable interface for DGlobalSymtab",
using_doxygen: true,
repr: "DGlobalSymtab",
doc: [ "implement ASymbolTable for DGlobalSymtab" ],
}

View file

@ -0,0 +1,15 @@
{
mode: "implementation",
output_cpp_dir: "src/expression2",
output_hpp_dir: "include/xo/expression2",
output_impl_subdir: "symtab",
includes: [ ],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/SymbolTable.json5",
brief: "provide ASymbolTable interface for DLocalSymtab",
using_doxygen: true,
repr: "DLocalSymtab",
doc: [ "implement ASymbolTable for DLocalSymtab" ],
}

View file

@ -1,16 +0,0 @@
{
mode: "implementation",
output_cpp_dir: "src/reader2/facet",
output_hpp_dir: "include/xo/reader2",
output_impl_subdir: "apply",
includes: [ "\"SyntaxStateMachine.hpp\"",
"\"ssm/ISyntaxStateMachine_Xfer.hpp\"" ],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/SyntaxStateMachine.json5",
brief: "provide ASyntaxStateMachine interface for DApplySsm",
using_doxygen: true,
repr: "DApplySsm",
doc: [ "implement ASyntaxStateMachine for DApplySsm" ],
}

View file

@ -1,16 +0,0 @@
{
mode: "implementation",
output_cpp_dir: "src/reader2/facet",
output_hpp_dir: "include/xo/reader2",
output_impl_subdir: "define",
includes: [ "\"SyntaxStateMachine.hpp\"",
"\"ssm/ISyntaxStateMachine_Xfer.hpp\"" ],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/SyntaxStateMachine.json5",
brief: "provide ASyntaxStateMachine interface for DDefineSsm",
using_doxygen: true,
repr: "DDefineSsm",
doc: [ "implement ASyntaxStateMachine for DDefineSsm" ],
}

View file

@ -1,16 +0,0 @@
{
mode: "implementation",
output_cpp_dir: "src/reader2/facet",
output_hpp_dir: "include/xo/reader2",
output_impl_subdir: "deftype",
includes: [ "\"SyntaxStateMachine.hpp\"",
"\"ssm/ISyntaxStateMachine_Xfer.hpp\"" ],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/SyntaxStateMachine.json5",
brief: "provide ASyntaxStateMachine interface for DDeftypeSsm",
using_doxygen: true,
repr: "DDeftypeSsm",
doc: [ "implement ASyntaxStateMachine for DDeftypeSsm" ],
}

View file

@ -1,16 +0,0 @@
{
mode: "implementation",
output_cpp_dir: "src/reader2",
output_hpp_dir: "include/xo/reader2",
output_impl_subdir: "ssm",
includes: [ "\"SyntaxStateMachine.hpp\"",
"\"ssm/ISyntaxStateMachine_Xfer.hpp\"" ],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/SyntaxStateMachine.json5",
brief: "provide ASyntaxStateMachine interface for DExpectExprSsm",
using_doxygen: true,
repr: "DExpectExprSsm",
doc: [ "implement ASyntaxStateMachine for DExpectExprSsm" ],
}

View file

@ -1,16 +0,0 @@
{
mode: "implementation",
output_cpp_dir: "src/reader2/facet",
output_hpp_dir: "include/xo/reader2",
output_impl_subdir: "expect_formal_arg",
includes: [ "\"SyntaxStateMachine.hpp\"",
"\"ssm/ISyntaxStateMachine_Xfer.hpp\"" ],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/SyntaxStateMachine.json5",
brief: "provide ASyntaxStateMachine interface for DExpectFormalArgSsm",
using_doxygen: true,
repr: "DExpectFormalArgSsm",
doc: [ "implement ASyntaxStateMachine for DExpectFormalArgSsm" ],
}

View file

@ -1,16 +0,0 @@
{
mode: "implementation",
output_cpp_dir: "src/reader2",
output_hpp_dir: "include/xo/reader2",
output_impl_subdir: "ssm",
includes: [ "\"SyntaxStateMachine.hpp\"",
"\"ssm/ISyntaxStateMachine_Xfer.hpp\"" ],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/SyntaxStateMachine.json5",
brief: "provide ASyntaxStateMachine interface for DExpectFormalArglistSsm",
using_doxygen: true,
repr: "DExpectFormalArglistSsm",
doc: [ "implement ASyntaxStateMachine for DExpectFormalArglistSsm" ],
}

View file

@ -1,16 +0,0 @@
{
mode: "implementation",
output_cpp_dir: "src/reader2/facet",
output_hpp_dir: "include/xo/reader2",
output_impl_subdir: "expect_listtype",
includes: [ "\"SyntaxStateMachine.hpp\"",
"\"ssm/ISyntaxStateMachine_Xfer.hpp\"" ],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/SyntaxStateMachine.json5",
brief: "provide ASyntaxStateMachine interface for DExpectListTypeSsm",
using_doxygen: true,
repr: "DExpectListTypeSsm",
doc: [ "implement ASyntaxStateMachine for DExpectListTypeSsm" ],
}

View file

@ -1,16 +0,0 @@
{
mode: "implementation",
output_cpp_dir: "src/reader2",
output_hpp_dir: "include/xo/reader2",
output_impl_subdir: "ssm",
includes: [ "\"SyntaxStateMachine.hpp\"",
"\"ssm/ISyntaxStateMachine_Xfer.hpp\"" ],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/SyntaxStateMachine.json5",
brief: "provide ASyntaxStateMachine interface for DExpectQArraySsm",
using_doxygen: true,
repr: "DExpectQArraySsm",
doc: [ "implement ASyntaxStateMachine for DExpectQArraySsm" ],
}

View file

@ -1,16 +0,0 @@
{
mode: "implementation",
output_cpp_dir: "src/reader2/facet",
output_hpp_dir: "include/xo/reader2",
output_impl_subdir: "expect_qdict",
includes: [ "\"SyntaxStateMachine.hpp\"",
"\"ssm/ISyntaxStateMachine_Xfer.hpp\"" ],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/SyntaxStateMachine.json5",
brief: "provide ASyntaxStateMachine interface for DExpectQDictSsm",
using_doxygen: true,
repr: "DExpectQDictSsm",
doc: [ "implement ASyntaxStateMachine for DExpectQDictSsm" ],
}

View file

@ -1,16 +0,0 @@
{
mode: "implementation",
output_cpp_dir: "src/reader2",
output_hpp_dir: "include/xo/reader2",
output_impl_subdir: "ssm",
includes: [ "\"SyntaxStateMachine.hpp\"",
"\"ssm/ISyntaxStateMachine_Xfer.hpp\"" ],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/SyntaxStateMachine.json5",
brief: "provide ASyntaxStateMachine interface for DExpectQListSsm",
using_doxygen: true,
repr: "DExpectQListSsm",
doc: [ "implement ASyntaxStateMachine for DExpectQListSsm" ],
}

View file

@ -1,16 +0,0 @@
{
mode: "implementation",
output_cpp_dir: "src/reader2",
output_hpp_dir: "include/xo/reader2",
output_impl_subdir: "ssm",
includes: [ "\"SyntaxStateMachine.hpp\"",
"\"ssm/ISyntaxStateMachine_Xfer.hpp\"" ],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/SyntaxStateMachine.json5",
brief: "provide ASyntaxStateMachine interface for DExpectQLiteralSsm",
using_doxygen: true,
repr: "DExpectQLiteralSsm",
doc: [ "implement ASyntaxStateMachine for DExpectQLiteralSsm" ],
}

View file

@ -1,16 +0,0 @@
{
mode: "implementation",
output_cpp_dir: "src/reader2",
output_hpp_dir: "include/xo/reader2",
output_impl_subdir: "ssm",
includes: [ "\"SyntaxStateMachine.hpp\"",
"\"ssm/ISyntaxStateMachine_Xfer.hpp\"" ],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/SyntaxStateMachine.json5",
brief: "provide ASyntaxStateMachine interface for DExpectSymbolSsm",
using_doxygen: true,
repr: "DExpectSymbolSsm",
doc: [ "implement ASyntaxStateMachine for DExpectSymbolSsm" ],
}

View file

@ -1,16 +0,0 @@
{
mode: "implementation",
output_cpp_dir: "src/reader2",
output_hpp_dir: "include/xo/reader2",
output_impl_subdir: "ssm",
includes: [ "\"SyntaxStateMachine.hpp\"",
"\"ssm/ISyntaxStateMachine_Xfer.hpp\"" ],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/SyntaxStateMachine.json5",
brief: "provide ASyntaxStateMachine interface for DExpectTypeSsm",
using_doxygen: true,
repr: "DExpectTypeSsm",
doc: [ "implement ASyntaxStateMachine for DExpectTypeSsm" ],
}

View file

@ -1,16 +0,0 @@
{
mode: "implementation",
output_cpp_dir: "src/reader2/facet",
output_hpp_dir: "include/xo/reader2",
output_impl_subdir: "ifelse",
includes: [ "\"SyntaxStateMachine.hpp\"",
"\"ssm/ISyntaxStateMachine_Xfer.hpp\"" ],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/SyntaxStateMachine.json5",
brief: "provide ASyntaxStateMachine interface for DIfElseSsm",
using_doxygen: true,
repr: "DIfElseSsm",
doc: [ "implement ASyntaxStateMachine for DIfElseSsm" ],
}

View file

@ -1,16 +0,0 @@
{
mode: "implementation",
output_cpp_dir: "src/reader2/facet",
output_hpp_dir: "include/xo/reader2",
output_impl_subdir: "lambda",
includes: [ "\"SyntaxStateMachine.hpp\"",
"\"ssm/ISyntaxStateMachine_Xfer.hpp\"" ],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/SyntaxStateMachine.json5",
brief: "provide ASyntaxStateMachine interface for DLambdaSsm",
using_doxygen: true,
repr: "DLambdaSsm",
doc: [ "implement ASyntaxStateMachine for DLambdaSsm" ],
}

View file

@ -1,16 +0,0 @@
{
mode: "implementation",
output_cpp_dir: "src/reader2",
output_hpp_dir: "include/xo/reader2",
output_impl_subdir: "paren",
includes: [ "\"SyntaxStateMachine.hpp\"",
"\"ssm/ISyntaxStateMachine_Xfer.hpp\"" ],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/SyntaxStateMachine.json5",
brief: "provide ASyntaxStateMachine interface for DParenSsm",
using_doxygen: true,
repr: "DParenSsm",
doc: [ "implement ASyntaxStateMachine for DParenSsm" ],
}

View file

@ -1,16 +0,0 @@
{
mode: "implementation",
output_cpp_dir: "src/reader2",
output_hpp_dir: "include/xo/reader2",
output_impl_subdir: "ssm",
includes: [ "\"SyntaxStateMachine.hpp\"",
"\"ssm/ISyntaxStateMachine_Xfer.hpp\"" ],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/SyntaxStateMachine.json5",
brief: "provide ASyntaxStateMachine interface for DProgressSsm",
using_doxygen: true,
repr: "DProgressSsm",
doc: [ "implement ASyntaxStateMachine for DProgressSsm" ],
}

View file

@ -1,16 +0,0 @@
{
mode: "implementation",
output_cpp_dir: "src/reader2/facet",
output_hpp_dir: "include/xo/reader2",
output_impl_subdir: "quote",
includes: [ "\"SyntaxStateMachine.hpp\"",
"\"ssm/ISyntaxStateMachine_Xfer.hpp\"" ],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/SyntaxStateMachine.json5",
brief: "provide ASyntaxStateMachine interface for DQuoteSsm",
using_doxygen: true,
repr: "DQuoteSsm",
doc: [ "implement ASyntaxStateMachine for DQuoteSsm" ],
}

View file

@ -1,16 +0,0 @@
{
mode: "implementation",
output_cpp_dir: "src/reader2",
output_hpp_dir: "include/xo/reader2",
output_impl_subdir: "ssm",
includes: [ "\"SyntaxStateMachine.hpp\"",
"\"ssm/ISyntaxStateMachine_Xfer.hpp\"" ],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/SyntaxStateMachine.json5",
brief: "provide ASyntaxStateMachine interface for DSequenceSsm",
using_doxygen: true,
repr: "DSequenceSsm",
doc: [ "implement ASyntaxStateMachine for DSequenceSsm" ],
}

View file

@ -1,16 +0,0 @@
{
mode: "implementation",
output_cpp_dir: "src/reader2",
output_hpp_dir: "include/xo/reader2",
output_impl_subdir: "ssm",
includes: [ "\"SyntaxStateMachine.hpp\"",
"\"ssm/ISyntaxStateMachine_Xfer.hpp\"" ],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/SyntaxStateMachine.json5",
brief: "provide ASyntaxStateMachine interface for DToplevelSeqSsm",
using_doxygen: true,
repr: "DToplevelSeqSsm",
doc: [ "implement ASyntaxStateMachine for DToplevelSeqSsm" ],
}

63
idl/SymbolTable.json5 Normal file
View file

@ -0,0 +1,63 @@
{
mode: "facet",
output_cpp_dir: "src/expression2",
output_hpp_dir: "include/xo/expression2",
output_impl_subdir: "symtab",
includes: [
"\"Binding.hpp\"",
"\"DUniqueString.hpp\""
],
// extra includes in SymbolTable.hpp, if any
user_hpp_includes: [],
namespace1: "xo",
namespace2: "scm",
// text after includes, before ASymbolTable
pretext: [ "// {pretext} here" ],
facet: "SymbolTable",
detail_subdir: "symtab",
brief: "symbol table derived from a set of schematika expressions",
using_doxygen: true,
doc: [
"Map symbols to schematika expressions. Output of schematika parser"
],
types: [
// { name: string, doc: [ string ], definition: string },
],
const_methods: [
{
// bool is_global_symtab() const noexcept;
name: "is_global_symtab",
doc: ["true iff this is toplevel (global) symbol table."],
return_type: "bool",
args: [],
const: true,
noexcept: true,
attributes: [],
},
{
// Binding lookup_binding(const DUniqueString * sym) const noexcept;
name: "lookup_binding",
doc: ["report ingredients needed to address variable at runtime."],
return_type: "Binding",
args: [
{type: "const DUniqueString *", name: "sym"},
],
const: true,
noexcept: true,
attributes: [],
},
// //
// obj<AExpression> lookup_var(const DUniqueString * sym) const noexcept;
// //
// obj<AExpression> lookup_local(const DUniqueString * sym) const noexcept;
],
nonconst_methods: [
// // Variable gives both {name, type}
// void upsert_local(DVariable * target) = 0;
],
router_facet_explicit_content: [ ],
}

View file

@ -1,160 +0,0 @@
{
mode: "facet",
output_cpp_dir: "src/reader2",
output_hpp_dir: "include/xo/reader2",
output_impl_subdir: "ssm",
// includes in ASyntaxStateMachine.hpp
includes: [
"\"ParserStateMachine.hpp\"",
"\"syntaxstatetype.hpp\"",
"<xo/type/Type.hpp>",
"<xo/tokenizer2/Token.hpp>",
"<xo/reflect/TypeDescr.hpp>",
"<xo/alloc2/GCObjectVisitor.hpp>"
],
// extra includes in SyntaxStateMachine.hpp, if any
user_hpp_includes: [],
namespace1: "xo",
namespace2: "scm",
// text after includes, before ASyntaxStateMachine
pretext: ["// {pretext} here"],
facet: "SyntaxStateMachine",
detail_subdir: "ssm",
brief: "specialized state machine for parsing some particular schematika syntax",
using_doxygen: true,
doc: [
"Assistant to schematika parser dedicated to particular syntax"
],
types: [
{ name: "TypeDescr", doc: [ "reflected c++ type" ], definition: "xo::reflect::TypeDescr" },
{ name: "AGCObjectVisitor", doc: [ "gc visitor interface" ], definition: "xo::mm::AGCObjectVisitor" },
{ name: "AGCObject", doc: [ "gc-aware object" ], definition: "xo::mm::AGCObject" },
{ name: "VisitReason", doc: [ "hint when traversing gco graph" ], definition: "xo::mm::VisitReason" },
],
const_methods: [
{
name: "ssm_type",
doc: ["identify a type of syntax state machine"],
return_type: "syntaxstatetype",
args: [],
const: true,
noexcept: true,
attributes: [],
},
{
name: "get_expect_str",
doc: ["text describing expected/allowed input to this ssm in current state"],
return_type: "std::string_view",
args: [],
const: true,
noexcept: true,
attributes: [],
},
],
nonconst_methods: [
{
name: "on_token",
doc: ["operate state machine for incoming token @p tk"],
return_type: "void",
args: [
{type: "const Token &", name: "tk"},
{type: "ParserStateMachine *", name: "p_psm"},
],
},
{
name: "on_parsed_symbol",
doc: ["update stat machine for incoming parsed symbol @p sym"],
return_type: "void",
args: [
{type: "std::string_view", name: "sym"},
{type: "ParserStateMachine *", name: "p_psm"},
],
},
{
name: "on_parsed_typedescr",
doc: ["operate state machine for incoming type description @p td"],
return_type: "void",
args: [
{type: "TypeDescr", name: "td"},
{type: "ParserStateMachine *", name: "p_psm"},
],
},
{
name: "on_parsed_type",
doc: ["update state machine for type emitted by nested ssm"],
return_type: "void",
args: [
{type: "obj<AType>", name: "type"},
{type: "ParserStateMachine *", name: "p_psm"},
],
},
{
name: "on_parsed_formal",
doc: ["operate state machine for formal emitted by nested ssm"],
return_type: "void",
args: [
{type: "const DUniqueString *", name: "param_name"},
{type: "TypeDescr", name: "param_type"},
{type: "ParserStateMachine *", name: "p_psm"},
],
},
{
name: "on_parsed_formal_with_token",
doc: ["operate state machine for formal emitted by nested ssm"],
return_type: "void",
args: [
{type: "const DUniqueString *", name: "param_name"},
{type: "TypeDescr", name: "param_type"},
{type: "const Token &", name: "tk"},
{type: "ParserStateMachine *", name: "p_psm"},
],
},
{
name: "on_parsed_formal_arglist",
doc: ["consume formal arglist emitted by nested ssm"],
return_type: "void",
args: [
{type: "DArray *", name: "arglist"},
{type: "ParserStateMachine *", name: "p_psm"},
],
},
{
name: "on_parsed_expression",
doc: ["update state machine for nested parsed expression @p expr"],
return_type: "void",
args: [
{type: "obj<AExpression>", name: "expr"},
{type: "ParserStateMachine *", name: "p_psm"},
],
},
{
name: "on_parsed_expression_with_token",
doc: ["update state machine @p p_psm for incoming parsed expression @p expr followed by token @p tk"],
return_type: "void",
args: [
{type: "obj<AExpression>", name: "expr"},
{type: "const Token &", name: "tk"},
{type: "ParserStateMachine *", name: "p_psm"},
],
},
{
name: "on_quoted_literal",
doc: ["update state machine for nested quoted literal @p lit"],
return_type: "void",
args: [
{type: "obj<AGCObject>", name: "lit"},
{type: "ParserStateMachine *", name: "p_psm"},
],
},
{
name: "visit_gco_children",
doc: ["gc support: visit immediate gc-aware child pointers with @p gc. Call gc.visit_child() for each"],
return_type: "void",
args: [
{type: "VisitReason", name: "reason"},
{type: "obj<AGCObjectVisitor>", name: "gc"},
],
}
],
router_facet_explicit_content: [ ],
}

View file

View file

@ -0,0 +1,13 @@
/** @file ApplyExpr.hpp
*
* @author Roland Conybeare, Feb 2026
**/
#pragma once
#include "DApplyExpr.hpp"
#include "detail/IExpression_DApplyExpr.hpp"
#include "detail/IGCObject_DApplyExpr.hpp"
#include "detail/IPrintable_DApplyExpr.hpp"
/* end ApplyExpr.hpp */

View file

@ -0,0 +1,65 @@
/** @file Binding.hpp
*
* @author Roland Conybeare, Jan 2026
**/
#pragma once
#include <iostream>
#include <cstdint>
namespace xo {
namespace scm {
class Binding {
public:
using slot_type = int32_t;
static constexpr int32_t c_link_sentinel = -2;
static constexpr int32_t c_link_global = -1;
public:
Binding() : i_link_{-2}, j_slot_{-1} {}
Binding(int32_t i_link, int32_t j_slot)
: i_link_{i_link}, j_slot_{j_slot} {}
static Binding null() { return Binding(); }
/** global bindings are located by symbol name **/
static Binding global(int32_t j_slot) { return Binding(c_link_global, j_slot); }
static Binding local(int32_t j_slot) { return Binding(0, j_slot); }
static Binding relative(int32_t i_link, Binding def);
bool is_null() const {
return (i_link_ == c_link_sentinel) && (j_slot_ == -1);
}
bool is_global() const { return i_link_ == c_link_global; }
bool is_local() const { return (i_link_ == 0) && (j_slot_ >= 0); }
int32_t i_link() const noexcept { return i_link_; }
int32_t j_slot() const noexcept { return j_slot_; }
/** print human-readable repr to stream @p os **/
void print(std::ostream & os) const;
private:
/**
* >= 0: number of parent links to traverse
* to a fixed-size frame
* -1: resolve globally
* -2: sentinel (binding info not computed)
**/
int32_t i_link_ = c_link_sentinel;
/** if @ref i_link_ >= 0, frame offset
* (in 'variables' not bytes).
* ignored if @ref i_link_ is global
**/
int32_t j_slot_ = -1;
};
inline std::ostream & operator<< (std::ostream & os, Binding x) {
x.print(os);
return os;
}
} /*namespace scm*/
} /*namespace xo*/
/* Binding.hpp */

View file

@ -0,0 +1,13 @@
/** @file Constant.hpp
*
* @author Roland Conybeare, Feb 2026
**/
#pragma once
#include "DConstant.hpp"
#include "detail/IExpression_DConstant.hpp"
#include "detail/IGCObject_DConstant.hpp"
#include "detail/IPrintable_DConstant.hpp"
/* end Constant.hpp */

View file

@ -0,0 +1,113 @@
/** @file DApplyExpr.hpp
*
* @author Roland Conybeare, Jan 2026
**/
#pragma once
#include "Expression.hpp"
#include "TypeRef.hpp"
#include "exprtype.hpp"
#include <xo/alloc2/GCObjectVisitor.hpp>
#include <xo/object2/DArray.hpp>
#include <xo/reflect/TypeDescr.hpp>
#include <xo/indentlog/print/pretty.hpp>
namespace xo {
namespace scm {
/** @class DApplyExpr
* @brief syntax for a procedure/function call
**/
class DApplyExpr {
public:
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using VisitReason = xo::mm::VisitReason;
using AAllocator = xo::mm::AAllocator;
using TypeDescr = xo::reflect::TypeDescr;
using ppindentinfo = xo::print::ppindentinfo;
using size_type = std::uint32_t;
public:
/** @defgroup scm-applyexpr-constructors **/
///@{
/** construct empty instance, but with argument expressions empty **/
DApplyExpr(TypeRef typeref,
obj<AExpression> fn_expr,
size_type n_args);
/** create apply for function with 2 arguments **/
static obj<AExpression,DApplyExpr> make2(obj<AAllocator> mm,
TypeRef typeref,
obj<AExpression> fn_expr,
obj<AExpression> arg1,
obj<AExpression> arg2);
/** create apply for function with 2 arguments **/
static DApplyExpr * _make2(obj<AAllocator> mm,
TypeRef typeref,
obj<AExpression> fn_expr,
obj<AExpression> arg1,
obj<AExpression> arg2);
/** scaffold incomplete instance.
* apply-expr using memory from @p mm.
* will construct instance with space for @p n_args arguments
* but expressions left empty.
* use @ref assign_arg for all arguments to complete.
**/
static DApplyExpr * scaffold(obj<AAllocator> mm,
TypeRef typeref,
obj<AExpression> fn_expr,
size_type n_args);
void assign_arg(size_type i_arg, obj<AExpression> expr);
///@}
/** @defgroup scm-applyexpr-access-methods **/
///@{
obj<AExpression> fn() const noexcept { return fn_; }
size_type n_args() const noexcept { return n_args_; }
obj<AExpression> arg(size_type i) const;
///@}
/** @defgroup scm-applyexpr-expression-facet **/
///@{
exprtype extype() const noexcept { return exprtype::apply; }
TypeRef typeref() const noexcept { return typeref_; }
TypeDescr valuetype() const noexcept { return typeref_.td(); }
void assign_valuetype(TypeDescr td) noexcept;
///@}
/** @defgroup scm-applyexpr-gcobject-facet **/
///@{
DApplyExpr * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(VisitReason reason, obj<AGCObjectVisitor> gc) noexcept;
///@}
/** @defgroup scm-applyexpr-printable-facet **/
///@{
bool pretty(const ppindentinfo & ppii) const;
///@}
private:
/** expression value always has type consistent
* with this description
**/
TypeRef typeref_;
/** expression for function/procedure to invoke **/
obj<AExpression> fn_;
/** number of arguments (not counting @ref fn_ **/
size_type n_args_ = 0;
/** args_[i] is expression for i'th argument to @ref fn_ **/
obj<AExpression> args_[];
};
}
}
/* end DApplyExpr.hpp */

View file

@ -0,0 +1,91 @@
/** @file DConstant.hpp
*
* @author Roland Conybeare, Jan 2026
**/
#pragma once
#include "Expression.hpp"
#include "TypeRef.hpp"
#include "exprtype.hpp"
#include <xo/alloc2/GCObject.hpp>
#include <xo/alloc2/GCObjectVisitor.hpp>
#include <xo/reflect/TaggedPtr.hpp>
namespace xo {
namespace scm {
/** @class DConstant
* @brief Schematika expression respresenting a literal constant
**/
struct DConstant {
public:
using TaggedPtr = xo::reflect::TaggedPtr;
using TypeDescr = xo::reflect::TypeDescr;
using AGCObject = xo::mm::AGCObject;
using VisitReason = xo::mm::VisitReason;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using AAllocator = xo::mm::AAllocator;
using typeseq = xo::reflect::typeseq;
using ppindentinfo = xo::print::ppindentinfo;
public:
explicit DConstant(obj<AGCObject> value) noexcept;
/** create isntance
* @p mm memory allocator
* @p value literal constant
**/
static obj<AExpression,DConstant> make(obj<AAllocator> mm,
obj<AGCObject> value);
/** create instance
* @p mm memory allocator
* @p value literal constant
**/
static DConstant * _make(obj<AAllocator> mm,
obj<AGCObject> value);
bool is_resolved() const noexcept { return typeref_.is_resolved(); }
obj<AGCObject> value() const noexcept { return value_; }
TypeDescr value_td() const noexcept { return typeref_.td(); }
TaggedPtr value_tp() const noexcept { return TaggedPtr(typeref_.td(), value_.data()); }
/** @defgroup scm-constant-expression-facet **/
///@{
exprtype extype() const noexcept { return exprtype::constant; }
TypeRef typeref() const noexcept { return typeref_; }
TypeDescr valuetype() const noexcept { return typeref_.td(); }
void assign_valuetype(TypeDescr td) noexcept { typeref_.resolve(td); }
///@}
/** @defgroup scm-constant-gcobject-facet **/
///@{
DConstant * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(VisitReason reason, obj<AGCObjectVisitor> gc) noexcept;
///@}
/** @defgroup scm-constant-printable-facet **/
///@{
bool pretty(const ppindentinfo & ppii) const;
///@}
private:
static TypeDescr _lookup_td(typeseq tseq);
private:
/** type for value of this expression
* or unification breadcrumb before unification
**/
TypeRef typeref_;
/** literal value **/
obj<AGCObject> value_;
};
} /*namespace scm*/
} /*namespace xo*/
/* end DConstant.hpp */

View file

@ -0,0 +1,108 @@
/** @file DDefineExpr.hpp
*
* @author Roland Conybeare, Jan 2026
**/
#pragma once
#include "Expression.hpp"
#include "DVariable.hpp"
#include <xo/alloc2/Allocator.hpp>
#include <xo/alloc2/GCObjectVisitor.hpp>
#include <xo/indentlog/print/pretty.hpp>
namespace xo {
namespace scm {
class DUniqueString; // see DUniqueString.hpp
/** @class DDefineExpr
* @brief an expression that introduces a variable.
*
* Variable may optionally be declared with a type,
* and may come with an expression specifying an initial value
**/
class DDefineExpr {
public:
using ppindentinfo = xo::print::ppindentinfo;
using ACollector = xo::mm::ACollector;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using VisitReason = xo::mm::VisitReason;
using AAllocator = xo::mm::AAllocator;
using TypeDescr = xo::reflect::TypeDescr;
public:
/** @defgroup scm-defineexpr-constructors **/
///@{
/** create instance: define-expr using memory from @p mm
* with lhs name @p lhs_name and rhs expression @p rhs_expr
**/
static DDefineExpr * make(obj<AAllocator> mm,
const DUniqueString * lhs_name,
obj<AExpression> rhs_expr);
/** create empty skeleton. Rely on this for parsing
**/
static DDefineExpr * make_empty(obj<AAllocator> mm);
DDefineExpr(DVariable * lhs_var,
obj<AExpression> rhs);
///@}
/** @defgroup scm-definexpr-access-methods **/
///@{
DVariable * lhs() const { return lhs_var_; }
obj<AExpression> rhs() const noexcept { return rhs_; }
const DUniqueString * name() const noexcept;
///@}
/** @defgroup scm-definexpr-bookkeeping-methods **/
///@{
void assign_lhs_name(const DUniqueString * name);
void assign_rhs(obj<AExpression> rhs);
///@}
/** @defgroup scm-defineexpr-expression-facet **/
///@{
exprtype extype() const noexcept { return exprtype::define; }
TypeRef typeref() const noexcept { return lhs_var_->typeref(); }
TypeDescr valuetype() const noexcept { return lhs_var_->typeref().td(); }
void assign_valuetype(TypeDescr td) noexcept;
///@}
/** @defgroup scm-defineexpr-gcobject-facet **/
///@{
DDefineExpr * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(VisitReason reason, obj<AGCObjectVisitor> gc) noexcept;
///@}
/** @defgroup scm-defineexpr-printable-facet **/
///@{
bool pretty(const ppindentinfo & ppii) const;
///@}
private:
/** @defgrouop scm-defineexpr-instance-vars **/
///@{
/** variable being defined by this expression.
**/
DVariable * lhs_var_ = nullptr;
/** expression for initial value of this expression
**/
obj<AExpression> rhs_;
// std::set<std::string> free_var_set_;
///@}
};
} /*namespace scm*/
} /*namespace xo*/
/* end DDefineExpr.hpp */

View file

@ -0,0 +1,161 @@
/** @file DGlobalSymtab.hpp
*
* @author Roland Conybeare, Jan 2026
**/
#pragma once
#include "Binding.hpp"
#include "DVariable.hpp"
#include "DTypename.hpp"
#include <xo/object2/DArray.hpp>
#include <xo/alloc2/GCObjectVisitor.hpp>
#include <xo/alloc2/dp.hpp>
#include <xo/arena/DArenaHashMap.hpp>
namespace xo {
namespace scm {
class DUniqueString;
/** @class DGlobalSymtab
* @brief symbol table for toplevel environment
*
* We're using DArenaHashMap to store <key,binding> pairs.
* Both of these are outside GC-space, so we don't need collector
* to traverse these.
**/
class DGlobalSymtab {
public:
using key_type = const DUniqueString *;
using value_type = Binding;
using ArenaHashMapConfig = xo::map::ArenaHashMapConfig;
using repr_type = xo::map::DArenaHashMap<key_type, Binding::slot_type>;
using AGCObject = xo::mm::AGCObject;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using VisitReason = xo::mm::VisitReason;
using AAllocator = xo::mm::AAllocator;
using MemorySizeVisitor = xo::mm::MemorySizeVisitor;
using ppindentinfo = xo::print::ppindentinfo;
using size_type = std::uint32_t;
public:
/** @defgroup scm-globalsymtab-ctors constructors **/
///@{
DGlobalSymtab(dp<repr_type> var_map, DArray * vars,
dp<repr_type> type_map, DArray * types);
/** move constructor (needed because dp<> deletes copy ctor) **/
DGlobalSymtab(DGlobalSymtab && other);
/** create instance.
* Use memory from @p fixed_mm for @ref map_.
* Use memory from @p mm for DGlobalSymtab instance.
* Hashmap for variables per @p var_cfg; for types per @p type_cfg.
**/
static DGlobalSymtab * _make(obj<AAllocator> mm,
obj<AAllocator> fixed_mm,
const ArenaHashMapConfig & var_cfg,
const ArenaHashMapConfig & type_cfg);
/** like _make(..), but create fop **/
static obj<AGCObject,DGlobalSymtab> make(obj<AAllocator> mm,
obj<AAllocator> fixed_mm,
const ArenaHashMapConfig & var_cfg,
const ArenaHashMapConfig & type_cfg);
/** non-trivial destructor for @ref map_ **/
~DGlobalSymtab() = default;
///@}
/** @defgroup scm-globalsymtab-access-methods access methods **/
///@{
size_type n_vars() const noexcept { return var_map_->size(); }
size_type var_capacity() const noexcept { return var_map_->capacity(); }
/** visit symtab-owned memory pools; call visitor(info) for each **/
void visit_pools(const MemorySizeVisitor & visitor) const;
/** lookup global symbol with name @p sym **/
DVariable * lookup_variable(const DUniqueString * sym) const noexcept;
/** lookup global typename with name @p sym **/
DTypename * lookup_typename(const DUniqueString * sym) const noexcept;
///@}
/** @defgroup scm-globalsymtab-general-methods general methods **/
///@{
/** update this symtab to associate @p var with @c var->name().
* If there was a previous variable with the same name,
* replace it with @p var.
**/
void upsert_variable(obj<AAllocator> mm,
DVariable * var);
/** update this symtab to associate typename @p type with @c type->name().
* If there was a previous type with the same name, replace it with
* @p type.
**/
void upsert_typename(obj<AAllocator> mm,
DTypename * type);
///@}
/** @defgroup scm-globalsymtab-symboltable-facet symboltable facet **/
///@{
/** true for global symbol table **/
bool is_global_symtab() const noexcept { return true; }
/** lookup binding for variable @p sym **/
Binding lookup_binding(const DUniqueString * sym) const noexcept;
///@}
/** @defgroup scm-globalsymtab-gcobject-facet gcobject facet **/
///@{
DGlobalSymtab * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(VisitReason reason, obj<AGCObjectVisitor> gc) noexcept;
///@}
/** @defgroup scm-globalsymtab-printable-facet printable facet **/
///@{
/** pretty-printing support **/
bool pretty(const ppindentinfo & ppii) const;
///@}
private:
/** map variable symbol -> index into @ref vars_.
* Minor point: storing offsets instead of Variables allows us to:
* omit hash-map iteration during GC.
* Savings when map_ slots sparsely populated.
**/
dp<repr_type> var_map_;
/** array of variables.
* When S is a unique-string for a global symbol, then:
* 1. var_map_[S] is unique global index i(S) for S.
* 2. vars_[i(S)] is variable-expr var(S) for S
* 3. var(S)->name == S
**/
DArray * vars_ = nullptr;
/** map type name -> index values into @ref types_ **/
dp<repr_type> type_map_;
/** array of types.
* When T is a unique-string for a globally-defined type, then:
* 1. type_map_[T] is unique global index i(T) for T.
* 2. types_[i(T)] is type type(T) for T
* 3. type(T)->name == T
**/
DArray * types_ = nullptr;
};
} /*namespace scm*/
} /*namespace xo*/
/* end DGlobalSymtab.hpp */

View file

@ -0,0 +1,248 @@
/** @file DIfElseExpr.hpp
*
* @author Roland Conybeare, Jan 2026
**/
#pragma once
#include "Expression.hpp"
#include "TypeRef.hpp"
#include "exprtype.hpp"
#include <xo/alloc2/GCObjectVisitor.hpp>
#include <xo/alloc2/Allocator.hpp>
#include <string>
namespace xo {
namespace scm {
/** @class DIfExpr
* @brief abstract syntax tree for a function definition
**/
class DIfElseExpr {
public:
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using VisitReason = xo::mm::VisitReason;
using AAllocator = xo::mm::AAllocator;
using TypeDescr = xo::reflect::TypeDescr;
using ppindentinfo = xo::print::ppindentinfo;
public:
/** @defgroup scm-ifelseexpr-constructors **/
///@{
/**
* @p ifexpr_type type for value produced by if-expression.
* same as both when_true->valuetype() and
* when_false->valuetype().
* @p test test-expression; always execute
* @p when_true then-branch; executes only when test succeeds
* @p when_false else-branch; executes only when test fails
**/
DIfElseExpr(TypeRef ifexpr_type,
obj<AExpression> test_expr,
obj<AExpression> when_true,
obj<AExpression> when_false);
/** create if-else expression using memory from @p mm.
* @p when_false can be null
**/
static obj<AExpression,DIfElseExpr> make(obj<AAllocator> mm,
obj<AExpression> test,
obj<AExpression> when_true,
obj<AExpression> when_false);
/** create expression for conditional execution of
* @p when_true or @p when_false, depending on result
* of evaluating expression @p test
**/
static DIfElseExpr * _make(obj<AAllocator> mm,
obj<AExpression> test,
obj<AExpression> when_true,
obj<AExpression> when_false);
/** create empty if-else expression using memory from @p mm **/
static obj<AExpression,DIfElseExpr> make_empty(obj<AAllocator> mm);
/** create empty if-else expression using memory from @p mm **/
static DIfElseExpr * _make_empty(obj<AAllocator> mm);
///@}
/** @defgroup scm-ifelseexpr-access-methods **/
///@{
obj<AExpression> test() const noexcept { return test_; }
obj<AExpression> when_true() const noexcept { return when_true_; }
obj<AExpression> when_false() const noexcept { return when_false_; }
void assign_test(obj<AExpression> x) { this->test_ = x; }
void assign_when_true(obj<AExpression> x) { this->when_true_ = x; }
void assign_when_false(obj<AExpression> x) { this->when_false_ = x; }
///@}
/** @defgroup scm-ifelseexpr-expression-facet **/
///@{
exprtype extype() const noexcept { return exprtype::ifexpr; }
TypeRef typeref() const noexcept { return typeref_; }
TypeDescr valuetype() const noexcept { return typeref_.td(); }
void assign_valuetype(TypeDescr td) noexcept;
///@}
/** @defgroup scm-ifelseexpr-printable-facet **/
///@{
bool pretty(const ppindentinfo & ppii) const;
///@}
/** @defgroup scm-ifelseexpr-gcobject-facet **/
///@{
DIfElseExpr * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(VisitReason reason, obj<AGCObjectVisitor> gc) noexcept;
///@}
#ifdef NOT_YET
virtual std::set<std::string> get_free_variables() const override {
std::set<std::string> retval = test_->get_free_variables();
std::set<std::string> free_vars;
free_vars = when_true_->get_free_variables();
for (const auto & s : free_vars)
retval.insert(s);
free_vars = when_false_->get_free_variables();
for (const auto & s : free_vars)
retval.insert(s);
return retval;
}
virtual std::size_t visit_preorder(VisitFn visitor_fn) override {
std::size_t n = 1;
visitor_fn(this);
n += this->test_->visit_preorder(visitor_fn);
n += this->when_true_->visit_preorder(visitor_fn);
n += this->when_false_->visit_preorder(visitor_fn);
return n;
}
virtual std::size_t visit_layer(VisitFn visitor_fn) override {
std::size_t n = 1;
visitor_fn(this);
n += this->test_->visit_layer(visitor_fn);
n += this->when_true_->visit_layer(visitor_fn);
n += this->when_false_->visit_layer(visitor_fn);
return n;
}
virtual rp<Expression> xform_layer(TransformFn xform_fn) override {
this->test_ = this->test_->xform_layer(xform_fn);
this->when_true_ = this->when_true_->xform_layer(xform_fn);
this->when_false_= this->when_false_->xform_layer(xform_fn);
return xform_fn(this);
}
virtual void attach_envs(bp<SymbolTable> p) override {
test_->attach_envs(p);
when_true_->attach_envs(p);
when_false_->attach_envs(p);
}
#endif
#ifdef NOT_USING
virtual std::int32_t find_free_vars(std::set<bp<Variable>> * p_set) override {
return (test_->find_free_vars(p_set)
+ when_true_->find_free_vars(p_set)
+ when_false_->find_free_vars(p_set));
}
#endif
#ifdef NOPE
virtual void display(std::ostream & os) const override;
virtual std::uint32_t pretty_print(const ppindentinfo & ppi) const override;
#endif
protected:
#ifdef NOT_YET
/**
* @p ifexpr_type type for value produced by if-expression.
* same as both when_true->valuetype() and
* when_false->valuetype().
* @p test test-expression; always execute
* @p when_true then-branch; executes only when test succeeds
* @p when_false else-branch; executes only when test fails
**/
IfExpr(TypeDescr ifexpr_type,
rp<Expression> test,
rp<Expression> when_true,
rp<Expression> when_false)
: Expression(exprtype::ifexpr, ifexpr_type),
test_{std::move(test)},
when_true_{std::move(when_true)},
when_false_{std::move(when_false)} {}
static TypeDescr check_consistent_valuetype(const rp<Expression> & when_true,
const rp<Expression> & when_false);
/** determine if-expr valuetype **/
void establish_valuetype();
#endif
private:
/** expression value always has type consistent
* with this description
**/
TypeRef typeref_;
/** if:
* (if x y z)
*
* executes x; if true execute y; otherwise execute z
**/
obj<AExpression> test_;
obj<AExpression> when_true_;
obj<AExpression> when_false_;
}; /*IfExpr*/
#ifdef NOPE
inline rp<IfExpr>
make_ifexpr(const rp<Expression> & test,
const rp<Expression> & when_true,
const rp<Expression> & when_false)
{
return IfExpr::make(test, when_true, when_false);
}
class IfExprAccess : public IfExpr {
public:
static rp<IfExprAccess> make(rp<Expression> test,
rp<Expression> when_true,
rp<Expression> when_false);
static rp<IfExprAccess> make_empty();
void assign_test(rp<Expression> x) { test_ = std::move(x); }
void assign_when_true(rp<Expression> x);
void assign_when_false(rp<Expression> x);
private:
IfExprAccess(TypeDescr ifexpr_type,
rp<Expression> test,
rp<Expression> when_true,
rp<Expression> when_false)
: IfExpr(ifexpr_type,
std::move(test),
std::move(when_true),
std::move(when_false)) {}
};
#endif
} /*namespace scm*/
} /*namespace xo*/
/* end DIfElseExpr.hpp */

View file

@ -0,0 +1,133 @@
/** @file DLambdaExpr.hpp
*
* @author Roland Conybeare, Jan 2026
**/
#pragma once
#include "Expression.hpp"
#include "TypeRef.hpp"
#include "exprtype.hpp"
#include "DLocalSymtab.hpp"
#include "DString.hpp"
#include <xo/alloc2/GCObjectVisitor.hpp>
#include <xo/facet/obj.hpp>
namespace xo {
namespace scm {
/** @class DLambdaExpr
* @brief syntax tree for a function/procedure definition
*
**/
class DLambdaExpr {
public:
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using VisitReason = xo::mm::VisitReason;
using AAllocator = xo::mm::AAllocator;
using TypeDescr = xo::reflect::TypeDescr;
using ppindentinfo = xo::print::ppindentinfo;
using size_type = DLocalSymtab::size_type;
public:
/** @defgroup scm-lambdaexpr-ctors **/
///@{
DLambdaExpr(TypeRef typeref,
const DUniqueString * name,
DLocalSymtab * local_symtab,
obj<AExpression> body);
/** create instance using memory from @p mm **/
static obj<AExpression,DLambdaExpr> make(obj<AAllocator> mm,
TypeRef typeref,
const DUniqueString * name,
DLocalSymtab * local_symtab,
obj<AExpression> body);
/** create instance, using memory from @p mm **/
static DLambdaExpr * _make(obj<AAllocator> mm,
TypeRef typeref,
const DUniqueString * name,
DLocalSymtab * local_symtab,
obj<AExpression> body);
/** create type description for lambda with arguments described by @p symtab
* and return type @p return_td.
* Load-bearing for DLambdaSsm in xo-reader2/
**/
static TypeDescr assemble_lambda_td(DLocalSymtab * symtab,
TypeDescr return_td);
///@}
/** @defgroup scm-lambdaexpr-methods **/
///@{
DLocalSymtab * local_symtab() const noexcept { return local_symtab_; }
size_type n_args() const noexcept { return local_symtab_->n_vars(); }
obj<AExpression> body_expr() const noexcept { return body_expr_; }
// get_free_variables()
// visit_preorder()
// visit_layer()
// xform_layer()
// attach_envs(SymbolTable*)
///@}
/** @defgroup scm-lambdaexpr-expression-facet **/
///@{
exprtype extype() const noexcept;
TypeRef typeref() const noexcept;
TypeDescr valuetype() const noexcept;
void assign_valuetype(TypeDescr td) noexcept;
///@}
/** @defgroup scm-lambdaexpr-gcobject-facet **/
///@{
std::size_t shallow_size() const noexcept;
DLambdaExpr * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(VisitReason reason, obj<AGCObjectVisitor> gc) noexcept;
///@}
/** @defgroup scm-lambdaexpr-printable-facet **/
///@{
bool pretty(const ppindentinfo & ppii) const;
///@}
private:
/** expression value always has type consistent
* with description here
**/
TypeRef typeref_;
/** name for this lambda (generated if necessary) **/
const DUniqueString * name_ = nullptr;
#ifdef NOT_YET // when enabled, need to visit forward_children()
/** e.g.
* i64(f64,string)
* for function of two arguments with types (f64, string) respectively,
* that returns an i64.
**/
const DUniqueString * type_name_str_ = nullptr;
#endif
/** symbol table for lambda arguments **/
DLocalSymtab * local_symtab_ = nullptr;;
/** expression for function body **/
obj<AExpression> body_expr_;
// free_var_set
// captured_var_set
// layer_var_map
// nested_lambda_map
};
} /*namespace scm*/
} /*namespace xo*/
/* end DLambdaExpr.hpp */

View file

@ -0,0 +1,128 @@
/** @file DLocalSymtab.hpp
*
* @author Roland Conybeare, Jan 2026
**/
#pragma once
#include "Binding.hpp"
#include "DVariable.hpp"
#include "DUniqueString.hpp"
#include <xo/object2/DArray.hpp>
#include <xo/alloc2/GCObjectVisitor.hpp>
namespace xo {
namespace scm {
/** @class DLocalSymtab
* @brief symbol table for a local stack frame
**/
struct DLocalSymtab {
public:
using DArray = xo::scm::DArray;
using ppindentinfo = xo::print::ppindentinfo;
using AGCObject = xo::mm::AGCObject;
using VisitReason = xo::mm::VisitReason;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using AAllocator = xo::mm::AAllocator;
/* note: uint16_t would be fine too */
using size_type = std::uint32_t;
struct Slot {
Slot() = default;
explicit Slot(DVariable * var) : var_{var} {}
/** variable representing a formal argument.
* binding will be correct only within the same layer
* as top-level lambda body
* (i.e. up to the doorstep of each and every nested lambda)
**/
DVariable * var_ = nullptr;
};
public:
/** @defgroup scm-lambdaexpr-constructors **/
///@{
/** empty instance with parent @p p, using arrays @p vars for variables
* and @p types for type definitions.
**/
DLocalSymtab(DLocalSymtab * p, DArray * nv, DArray * nt);
/** scaffold empty symtab instance,
* capacity for @p nv vars and @p nt types,
* using memory from allocator @p mm.
* Symtab chains to parent @p p.
**/
static DLocalSymtab * _make_empty(obj<AAllocator> mm,
DLocalSymtab * p,
size_type nv,
size_type nt);
///@}
/** @defgroup scm-lambdaexpr-methods **/
///@{
DLocalSymtab * parent() const noexcept { return parent_; }
//size_type capacity() const noexcept { return capacity_; }
size_type n_vars() const noexcept { return vars_->size(); }
size_type n_types() const noexcept { return types_->size(); }
DVariable * lookup_var(Binding ix) noexcept;
/** increase slot size (provided below capacity) to append
* binding for one local variable. Local variable will be allocated
* from @p mm, named @p name, with type described by @p typeref.
**/
Binding append_var(obj<AAllocator> mm,
const DUniqueString * name,
TypeRef typeref);
/** increase slot size (provided below capacity) to append
* binding for one local type. Local type will be allocated
* from @p mm, named @p name, with type described by @p type.
**/
void append_type(obj<AAllocator> mm,
const DUniqueString * name,
obj<AType> type);
///@}
/** @defgroup xo-localsymtab-symboltable-facet symboltable facet**/
///@{
/** true for global symbol table **/
bool is_global_symtab() const noexcept { return false; }
/** lookup binding for variable @p sym **/
Binding lookup_binding(const DUniqueString * sym) const noexcept;
///@}
/** @defgroup xo-localsymtab-gcobject-facet gcobject facet **/
///@{
DLocalSymtab * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(VisitReason reason, obj<AGCObjectVisitor> gc) noexcept;
///@}
/** @defgroup xo-localsymtab-printable-facet printable facet **/
///@{
bool pretty(const ppindentinfo & ppii) const;
///@}
private:
/** parent symbol table from scoping surrounding this one **/
DLocalSymtab * parent_ = nullptr;
/** variables owned by (declared in) this symbol table
* vars_[i] is convertible to obj<AGCObject>
**/
DArray * vars_ = nullptr;
/** types owned by (defined in) this symbol table
* types_[i] is convertible to obj<AType>
**/
DArray * types_ = nullptr;
};
} /*namespace scm*/
} /*namespace xo*/
/* end DLocalSymtab.hpp */

View file

@ -0,0 +1,93 @@
/** @file DSequenceExpr.hpp
*
* @author Roland Conybeare, Jan 2026
**/
#pragma once
#include "Expression.hpp"
#include "TypeRef.hpp"
#include <xo/object2/DArray.hpp>
#include <xo/alloc2/GCObjectVisitor.hpp>
namespace xo {
namespace scm {
/** syntax for a sequence of expressions
* {
* expr(1);
* expr(2);
* ...
* expr(n);
* }
**/
class DSequenceExpr {
public:
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using VisitReason = xo::mm::VisitReason;
using AAllocator = xo::mm::AAllocator;
using TypeDescr = xo::reflect::TypeDescr;
using size_type = DArray::size_type;
using ppindentinfo = xo::print::ppindentinfo;
public:
DSequenceExpr() ;
DSequenceExpr(DArray * xv);
/** create empty sequence using memory from @p mm **/
static obj<AExpression,DSequenceExpr> make_empty(obj<AAllocator> mm);
/** create empty sequence expression using mmeory from @p mm **/
static DSequenceExpr * _make_empty(obj<AAllocator> mm);
size_type size() const noexcept;
obj<AExpression> operator[](std::size_t i) const;
/** append @p expr to the end of this sequence;
* use memory from @p mm if need to expand storage
**/
void push_back(obj<AAllocator> mm,
obj<AExpression> expr);
// get_free_variables();
// visit_preorder();
// visit_layer();
// xform_layer()
// attach_envs()
/** @defgroup scm-ifelseexpr-expression-facets **/
///@{
exprtype extype() const noexcept { return exprtype::sequence; }
TypeRef typeref() const noexcept { return typeref_; }
TypeDescr valuetype() const noexcept { return typeref_.td(); }
void assign_valuetype(TypeDescr td) noexcept;
///@}
/** @defgroup scm-sequenceexpr-printable-facet printable facet methods **/
///@{
/** pretty-printing driver; combine layout+printing **/
bool pretty(const ppindentinfo & ppii) const;
///@}
/** @defgroup scm-sequenceexpr-gcobject-facet gcobject facet methods **/
///@{
DSequenceExpr * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(VisitReason reason, obj<AGCObjectVisitor> gc) noexcept;
///@}
private:
/** expression value always has type consistent with this description
**/
TypeRef typeref_;
/** array of expressions **/
DArray * expr_v_ = nullptr;
};
} /*namespace scm*/
} /*namespace xo*/
/* end DSequenceExpr.hpp */

View file

@ -0,0 +1,78 @@
/** @file DTypename.hpp
*
* @author Roland Conybeare, Mar 2026
**/
#pragma once
#include "DUniqueString.hpp"
#include <xo/type/Type.hpp>
#include <xo/alloc2/GCObjectVisitor.hpp>
#include <xo/printable2/Printable.hpp>
#include <xo/indentlog/print/pretty.hpp>
namespace xo {
namespace scm {
/** @class DTypename
* @brief Container for a named type
*
* Represents the result of syntax like
* 1. deftype Foo :: i64;
* 2. deftype FooAlias :: Foo;
**/
class DTypename {
public:
using ppindentinfo = xo::print::ppindentinfo;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using VisitReason = xo::mm::VisitReason;
using AGCObject = xo::mm::AGCObject;
using AAllocator = xo::mm::AAllocator;
public:
DTypename(const DUniqueString * name,
obj<AType> type);
/** create instance
* @p mm memory allocator
* @p name type name
* @p type type definition
**/
static DTypename * _make(obj<AAllocator> mm,
const DUniqueString * name,
obj<AType> type);
/** create fop for new instance **/
static obj<AGCObject,DTypename> make(obj<AAllocator> mm,
const DUniqueString * name,
obj<AType> type);
const DUniqueString * name() const noexcept { return name_; }
obj<AType> type() const noexcept { return type_; }
void assign_name(const DUniqueString * name) { this->name_ = name; }
/** @defgroup scm-typename-gcobject-facet **/
///@{
DTypename * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(VisitReason reason, obj<AGCObjectVisitor> gc) noexcept;
///@}
/** @defgroup scm-typename-printable-facet **/
///@{
bool pretty(const ppindentinfo & ppii) const;
///@}
private:
/** symbol name **/
const DUniqueString * name_ = nullptr;
/** type defintion. Everything but the name **/
obj<AType> type_;
};
} /*namespace scm*/
} /*namespace xo*/
/* end DTypename.hpp */

View file

@ -0,0 +1,85 @@
/** @file DVarRef.hpp
*
* @author Roland Conybeare, Feb 2026
**/
#pragma once
#include "Variable.hpp"
#include <xo/alloc2/GCObjectVisitor.hpp>
namespace xo {
namespace scm {
/** @class DVarRef
* @brief syntax for a variable reference
*
* Reference to a known variable possibly
* defined in another scope.
* For non-local non-global variables,
**/
class DVarRef {
public:
using ppindentinfo = xo::print::ppindentinfo;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using VisitReason = xo::mm::VisitReason;
using AAllocator = xo::mm::AAllocator;
using TypeDescr = xo::reflect::TypeDescr;
public:
DVarRef(DVariable * vardef,
Binding path);
/** create instance
* @p mm memory allocator
* @p vardef variable definition (name, typeref, binding)
* @p link number of lexical scope boundaries we must cross
* to reach scope containing @p vardef.
* Only relevant for non-global vardef
**/
static DVarRef * make(obj<AAllocator> mm,
DVariable * vardef,
int32_t link);
const DUniqueString * name() const;
Binding path() const { return path_; }
/** @defgroup scm-variable-expression-facet **/
///@{
exprtype extype() const noexcept { return exprtype::varref; }
TypeRef typeref() const noexcept;
TypeDescr valuetype() const noexcept;
void assign_valuetype(TypeDescr td) noexcept;
///@}
/** @defgroup scm-variable-gcobject-facet **/
///@{
DVarRef * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(VisitReason reason, obj<AGCObjectVisitor> gc) noexcept;
///@}
/** @defgroup scm-variable-printable-facet **/
///@{
bool pretty(const ppindentinfo & ppii) const;
///@}
private:
/** variable definition. Created in the sccope where variable introduced.
* Has an associated @ref Binding, but that binding is only correct
* around any nested scopes.
**/
DVariable * vardef_ = nullptr;
/** at runtime: navigate environemnt via this path to get
* runtime memory location for this variable
**/
Binding path_;
};
} /*namespace scm*/
} /*namespace xo*/
/* end DVarRef.hpp */

View file

@ -0,0 +1,93 @@
/** @file DVariable.hpp
*
* @author Roland Conybeare, Jan 2026
**/
#pragma once
#include "DUniqueString.hpp"
#include "Binding.hpp"
#include "TypeRef.hpp"
#include "exprtype.hpp"
#include <xo/alloc2/GCObjectVisitor.hpp>
#include <xo/reflect/TypeDescr.hpp>
#include <xo/indentlog/print/pretty.hpp>
namespace xo {
namespace scm {
/** @class DVariable
* @brief syntax for a variable reference
**/
class DVariable {
public:
using ppindentinfo = xo::print::ppindentinfo;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using VisitReason = xo::mm::VisitReason;
using AAllocator = xo::mm::AAllocator;
using TypeDescr = xo::reflect::TypeDescr;
public:
/** 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());
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; }
void assign_path(Binding b) { this->path_ = b; }
/** @defgroup scm-variable-expression-facet **/
///@{
exprtype extype() const noexcept { return exprtype::variable; }
TypeRef typeref() const noexcept { return typeref_; }
TypeDescr valuetype() const noexcept { return typeref_.td(); };
void assign_valuetype(TypeDescr td) noexcept;
///@}
/** @defgroup scm-variable-gcobject-facet **/
///@{
DVariable * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(VisitReason reason, obj<AGCObjectVisitor> gc) noexcept;
///@}
/** @defgroup scm-variable-printable-facet **/
///@{
bool pretty(const ppindentinfo & ppii) const;
///@}
private:
/** symbol name **/
const DUniqueString * name_ = nullptr;
/** variable value always has type consistent
* with this description
**/
TypeRef typeref_;
/** at runtime: navigate environemnt via this path to get
* runtime memory location for this variable
**/
Binding path_;
};
} /*namespace scm*/
} /*namespace xo*/
/* end DVariable.hpp */

View file

@ -0,0 +1,13 @@
/** @file DefineExpr.hpp
*
* @author Roland Conybeare, Feb 2026
**/
#pragma once
#include "DDefineExpr.hpp"
#include "detail/IExpression_DDefineExpr.hpp"
#include "define/IGCObject_DDefineExpr.hpp"
#include "detail/IPrintable_DDefineExpr.hpp"
/* end DefineExpr.hpp */

Some files were not shown because too many files have changed in this diff Show more