git subrepo clone git@github.com:Rconybea/xo-expression2.git xo-expression2
subrepo: subdir: "xo-expression2" merged: "9823ce36" upstream: origin: "git@github.com:Rconybea/xo-expression2.git" branch: "main" commit: "9823ce36" git-subrepo: version: "0.4.9" origin: "???" commit: "???"
This commit is contained in:
parent
91b119cdef
commit
a33f75f6f4
167 changed files with 10695 additions and 0 deletions
12
xo-expression2/.gitrepo
Normal file
12
xo-expression2/.gitrepo
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
; DO NOT EDIT (unless you know what you are doing)
|
||||
;
|
||||
; This subdirectory is a git "subrepo", and this file is maintained by the
|
||||
; git-subrepo command. See https://github.com/ingydotnet/git-subrepo#readme
|
||||
;
|
||||
[subrepo]
|
||||
remote = git@github.com:Rconybea/xo-expression2.git
|
||||
branch = main
|
||||
commit = 9823ce36647bb3f0bf517924e31230627f36ae50
|
||||
parent = 91b119cdef07176b576b40b878a4704617406979
|
||||
method = merge
|
||||
cmdver = 0.4.9
|
||||
332
xo-expression2/CMakeLists.txt
Normal file
332
xo-expression2/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,332 @@
|
|||
# xo-expression2/CMakeLists.txt
|
||||
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
|
||||
project(xo_expression2 VERSION 1.0)
|
||||
enable_language(CXX)
|
||||
|
||||
include(GNUInstallDirs)
|
||||
include(cmake/xo-bootstrap-macros.cmake)
|
||||
|
||||
xo_cxx_toplevel_options3()
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
# c++ settings
|
||||
|
||||
# one-time project-specific c++ flags. usually empty
|
||||
set(PROJECT_CXX_FLAGS "")
|
||||
add_definitions(${PROJECT_CXX_FLAGS})
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
# output targets
|
||||
|
||||
add_subdirectory(utest)
|
||||
|
||||
# note: manual target; generated code committed to git
|
||||
xo_add_genfacet(
|
||||
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-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-expression2-facetimpl-gcobject-localsymtab
|
||||
FACET_PKG xo_alloc2
|
||||
# REPR LocalSymtab
|
||||
INPUT idl/IGCObject_DLocalSymtab.json5
|
||||
)
|
||||
|
||||
# note: manual target; generated code committed to git
|
||||
xo_add_genfacetimpl(
|
||||
TARGET xo-expression2-facetimpl-printable-localsymtab
|
||||
FACET_PKG xo_printable2
|
||||
# REPR LocalSymtab
|
||||
INPUT idl/IPrintable_DLocalSymtab.json5
|
||||
)
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
|
||||
# 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/expression2)
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
# cmake helper (for external xo-expression2 users)
|
||||
|
||||
xo_export_cmake_config(${PROJECT_NAME} ${PROJECT_VERSION} ${PROJECT_NAME}Targets)
|
||||
|
||||
# end CMakeLists.txt
|
||||
33
xo-expression2/cmake/xo-bootstrap-macros.cmake
Normal file
33
xo-expression2/cmake/xo-bootstrap-macros.cmake
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
# ----------------------------------------------------------------
|
||||
# for example:
|
||||
# $ PREFIX=/usr/local # for example
|
||||
# $ cmake -DCMAKE_MODULE_PATH=prefix -DCMAKE_INSTALL_PREFIX=$PREFIX -B .build
|
||||
#
|
||||
# will get
|
||||
# CMAKE_MODULE_PATH
|
||||
# from xo-cmake-config --cmake-module-path
|
||||
#
|
||||
# and expect .cmake macros in
|
||||
# CMAKE_MODULE_PATH/xo_macros/xo_cxx.cmake
|
||||
# ----------------------------------------------------------------
|
||||
|
||||
find_program(XO_CMAKE_CONFIG_EXECUTABLE NAMES xo-cmake-config REQUIRED)
|
||||
|
||||
if (("${CMAKE_MODULE_PATH}" STREQUAL "") OR ("${CMAKE_MODULE_PATH}" STREQUAL "prefix"))
|
||||
message(FATAL "could not find xo-cmake-config executable")
|
||||
endif()
|
||||
|
||||
if (NOT XO_SUBMODULE_BUILD)
|
||||
if (("${CMAKE_MODULE_PATH}" STREQUAL "") OR ("${CMAKE_MODULE_PATH}" STREQUAL prefix))
|
||||
# default to typical install location for xo-project-macros
|
||||
execute_process(COMMAND ${XO_CMAKE_CONFIG_EXECUTABLE} --cmake-module-path OUTPUT_VARIABLE CMAKE_MODULE_PATH)
|
||||
message(STATUS "CMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# needs to have been installed somewhere on CMAKE_MODULE_PATH,
|
||||
# (e.g. from xo-cmake with the same value for CMAKE_INSTALL_PREFIX)
|
||||
#
|
||||
include(xo_macros/xo_cxx)
|
||||
|
||||
xo_cxx_bootstrap_message()
|
||||
20
xo-expression2/cmake/xo_expression2Config.cmake.in
Normal file
20
xo-expression2/cmake/xo_expression2Config.cmake.in
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
@PACKAGE_INIT@
|
||||
|
||||
include(CMakeFindDependencyMacro)
|
||||
|
||||
# note: changes to find_dependency() calls here
|
||||
# must coordinate with xo_dependency() calls
|
||||
# in CMakeLists.txt
|
||||
#
|
||||
find_dependency(xo_type)
|
||||
find_dependency(xo_gc)
|
||||
find_dependency(reflect)
|
||||
find_dependency(xo_procedure2)
|
||||
find_dependency(xo_printable2)
|
||||
find_dependency(xo_flatstring)
|
||||
find_dependency(subsys)
|
||||
find_dependency(indentlog)
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake")
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Share.cmake")
|
||||
check_required_components("@PROJECT_NAME@")
|
||||
74
xo-expression2/idl/Expression.json5
Normal file
74
xo-expression2/idl/Expression.json5
Normal 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: [ ],
|
||||
}
|
||||
15
xo-expression2/idl/IExpression_DApplyExpr.json5
Normal file
15
xo-expression2/idl/IExpression_DApplyExpr.json5
Normal 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" ],
|
||||
}
|
||||
15
xo-expression2/idl/IExpression_DConstant.json5
Normal file
15
xo-expression2/idl/IExpression_DConstant.json5
Normal 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" ],
|
||||
}
|
||||
15
xo-expression2/idl/IExpression_DDefineExpr.json5
Normal file
15
xo-expression2/idl/IExpression_DDefineExpr.json5
Normal 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" ],
|
||||
}
|
||||
15
xo-expression2/idl/IExpression_DIfElseExpr.json5
Normal file
15
xo-expression2/idl/IExpression_DIfElseExpr.json5
Normal 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" ],
|
||||
}
|
||||
15
xo-expression2/idl/IExpression_DLambdaExpr.json5
Normal file
15
xo-expression2/idl/IExpression_DLambdaExpr.json5
Normal 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" ],
|
||||
}
|
||||
15
xo-expression2/idl/IExpression_DSequenceExpr.json5
Normal file
15
xo-expression2/idl/IExpression_DSequenceExpr.json5
Normal 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" ],
|
||||
}
|
||||
15
xo-expression2/idl/IExpression_DVarRef.json5
Normal file
15
xo-expression2/idl/IExpression_DVarRef.json5
Normal 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" ],
|
||||
}
|
||||
15
xo-expression2/idl/IExpression_DVariable.json5
Normal file
15
xo-expression2/idl/IExpression_DVariable.json5
Normal 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" ],
|
||||
}
|
||||
18
xo-expression2/idl/IGCObject_DApplyExpr.json5
Normal file
18
xo-expression2/idl/IGCObject_DApplyExpr.json5
Normal 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" ],
|
||||
}
|
||||
18
xo-expression2/idl/IGCObject_DConstant.json5
Normal file
18
xo-expression2/idl/IGCObject_DConstant.json5
Normal 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" ],
|
||||
}
|
||||
18
xo-expression2/idl/IGCObject_DDefineExpr.json5
Normal file
18
xo-expression2/idl/IGCObject_DDefineExpr.json5
Normal 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" ],
|
||||
}
|
||||
18
xo-expression2/idl/IGCObject_DGlobalSymtab.json5
Normal file
18
xo-expression2/idl/IGCObject_DGlobalSymtab.json5
Normal 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" ],
|
||||
}
|
||||
18
xo-expression2/idl/IGCObject_DIfElseExpr.json5
Normal file
18
xo-expression2/idl/IGCObject_DIfElseExpr.json5
Normal 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" ],
|
||||
}
|
||||
18
xo-expression2/idl/IGCObject_DLambdaExpr.json5
Normal file
18
xo-expression2/idl/IGCObject_DLambdaExpr.json5
Normal 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" ],
|
||||
}
|
||||
18
xo-expression2/idl/IGCObject_DLocalSymtab.json5
Normal file
18
xo-expression2/idl/IGCObject_DLocalSymtab.json5
Normal 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" ],
|
||||
}
|
||||
18
xo-expression2/idl/IGCObject_DSequenceExpr.json5
Normal file
18
xo-expression2/idl/IGCObject_DSequenceExpr.json5
Normal 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" ],
|
||||
}
|
||||
18
xo-expression2/idl/IGCObject_DTypename.json5
Normal file
18
xo-expression2/idl/IGCObject_DTypename.json5
Normal 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" ],
|
||||
}
|
||||
18
xo-expression2/idl/IGCObject_DVarRef.json5
Normal file
18
xo-expression2/idl/IGCObject_DVarRef.json5
Normal 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 DVarRef",
|
||||
using_doxygen: true,
|
||||
repr: "DVarRef",
|
||||
doc: [ "implement AGCObject for DVarRef" ],
|
||||
}
|
||||
18
xo-expression2/idl/IGCObject_DVariable.json5
Normal file
18
xo-expression2/idl/IGCObject_DVariable.json5
Normal 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" ],
|
||||
}
|
||||
16
xo-expression2/idl/IPrintable_DApplyExpr.json5
Normal file
16
xo-expression2/idl/IPrintable_DApplyExpr.json5
Normal 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" ],
|
||||
}
|
||||
16
xo-expression2/idl/IPrintable_DConstant.json5
Normal file
16
xo-expression2/idl/IPrintable_DConstant.json5
Normal 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" ],
|
||||
}
|
||||
16
xo-expression2/idl/IPrintable_DDefineExpr.json5
Normal file
16
xo-expression2/idl/IPrintable_DDefineExpr.json5
Normal 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" ],
|
||||
}
|
||||
16
xo-expression2/idl/IPrintable_DGlobalSymtab.json5
Normal file
16
xo-expression2/idl/IPrintable_DGlobalSymtab.json5
Normal 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" ],
|
||||
}
|
||||
16
xo-expression2/idl/IPrintable_DIfElseExpr.json5
Normal file
16
xo-expression2/idl/IPrintable_DIfElseExpr.json5
Normal 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" ],
|
||||
}
|
||||
16
xo-expression2/idl/IPrintable_DLambdaExpr.json5
Normal file
16
xo-expression2/idl/IPrintable_DLambdaExpr.json5
Normal 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" ],
|
||||
}
|
||||
16
xo-expression2/idl/IPrintable_DLocalSymtab.json5
Normal file
16
xo-expression2/idl/IPrintable_DLocalSymtab.json5
Normal 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" ],
|
||||
}
|
||||
16
xo-expression2/idl/IPrintable_DSequenceExpr.json5
Normal file
16
xo-expression2/idl/IPrintable_DSequenceExpr.json5
Normal 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" ],
|
||||
}
|
||||
16
xo-expression2/idl/IPrintable_DTypename.json5
Normal file
16
xo-expression2/idl/IPrintable_DTypename.json5
Normal 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" ],
|
||||
}
|
||||
16
xo-expression2/idl/IPrintable_DVarRef.json5
Normal file
16
xo-expression2/idl/IPrintable_DVarRef.json5
Normal 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 DVarRef",
|
||||
using_doxygen: true,
|
||||
repr: "DVarRef",
|
||||
doc: [ "implement APrintable for DVarRef" ],
|
||||
}
|
||||
16
xo-expression2/idl/IPrintable_DVariable.json5
Normal file
16
xo-expression2/idl/IPrintable_DVariable.json5
Normal 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" ],
|
||||
}
|
||||
15
xo-expression2/idl/ISymbolTable_DGlobalSymtab.json5
Normal file
15
xo-expression2/idl/ISymbolTable_DGlobalSymtab.json5
Normal 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" ],
|
||||
}
|
||||
15
xo-expression2/idl/ISymbolTable_DLocalSymtab.json5
Normal file
15
xo-expression2/idl/ISymbolTable_DLocalSymtab.json5
Normal 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" ],
|
||||
}
|
||||
63
xo-expression2/idl/SymbolTable.json5
Normal file
63
xo-expression2/idl/SymbolTable.json5
Normal 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: [ ],
|
||||
}
|
||||
0
xo-expression2/include/xo/expression2/.gitkeep
Normal file
0
xo-expression2/include/xo/expression2/.gitkeep
Normal file
13
xo-expression2/include/xo/expression2/ApplyExpr.hpp
Normal file
13
xo-expression2/include/xo/expression2/ApplyExpr.hpp
Normal 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 */
|
||||
65
xo-expression2/include/xo/expression2/Binding.hpp
Normal file
65
xo-expression2/include/xo/expression2/Binding.hpp
Normal 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 */
|
||||
13
xo-expression2/include/xo/expression2/Constant.hpp
Normal file
13
xo-expression2/include/xo/expression2/Constant.hpp
Normal 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 */
|
||||
113
xo-expression2/include/xo/expression2/DApplyExpr.hpp
Normal file
113
xo-expression2/include/xo/expression2/DApplyExpr.hpp
Normal 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 */
|
||||
91
xo-expression2/include/xo/expression2/DConstant.hpp
Normal file
91
xo-expression2/include/xo/expression2/DConstant.hpp
Normal 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 */
|
||||
108
xo-expression2/include/xo/expression2/DDefineExpr.hpp
Normal file
108
xo-expression2/include/xo/expression2/DDefineExpr.hpp
Normal 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 */
|
||||
161
xo-expression2/include/xo/expression2/DGlobalSymtab.hpp
Normal file
161
xo-expression2/include/xo/expression2/DGlobalSymtab.hpp
Normal 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 */
|
||||
248
xo-expression2/include/xo/expression2/DIfElseExpr.hpp
Normal file
248
xo-expression2/include/xo/expression2/DIfElseExpr.hpp
Normal 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 */
|
||||
133
xo-expression2/include/xo/expression2/DLambdaExpr.hpp
Normal file
133
xo-expression2/include/xo/expression2/DLambdaExpr.hpp
Normal 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 */
|
||||
128
xo-expression2/include/xo/expression2/DLocalSymtab.hpp
Normal file
128
xo-expression2/include/xo/expression2/DLocalSymtab.hpp
Normal 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 */
|
||||
93
xo-expression2/include/xo/expression2/DSequenceExpr.hpp
Normal file
93
xo-expression2/include/xo/expression2/DSequenceExpr.hpp
Normal 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 */
|
||||
78
xo-expression2/include/xo/expression2/DTypename.hpp
Normal file
78
xo-expression2/include/xo/expression2/DTypename.hpp
Normal 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 */
|
||||
85
xo-expression2/include/xo/expression2/DVarRef.hpp
Normal file
85
xo-expression2/include/xo/expression2/DVarRef.hpp
Normal 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 */
|
||||
93
xo-expression2/include/xo/expression2/DVariable.hpp
Normal file
93
xo-expression2/include/xo/expression2/DVariable.hpp
Normal 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 */
|
||||
13
xo-expression2/include/xo/expression2/DefineExpr.hpp
Normal file
13
xo-expression2/include/xo/expression2/DefineExpr.hpp
Normal 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 */
|
||||
22
xo-expression2/include/xo/expression2/Expression.hpp
Normal file
22
xo-expression2/include/xo/expression2/Expression.hpp
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
/** @file Expression.hpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/Expression.json5]
|
||||
* 2. jinja2 template for facet .hpp file:
|
||||
* [facet.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/Expression.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "detail/AExpression.hpp"
|
||||
#include "detail/IExpression_Any.hpp"
|
||||
#include "detail/IExpression_Xfer.hpp"
|
||||
#include "detail/RExpression.hpp"
|
||||
|
||||
|
||||
/* end Expression.hpp */
|
||||
13
xo-expression2/include/xo/expression2/GlobalSymtab.hpp
Normal file
13
xo-expression2/include/xo/expression2/GlobalSymtab.hpp
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
/** @file GlobalSymtab.hpp
|
||||
*
|
||||
* @author Roland Conybeare, Feb 2026
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "DGlobalSymtab.hpp"
|
||||
#include "symtab/ISymbolTable_DGlobalSymtab.hpp"
|
||||
#include "symtab/IGCObject_DGlobalSymtab.hpp"
|
||||
#include "symtab/IPrintable_DGlobalSymtab.hpp"
|
||||
|
||||
/* end GlobalSymtab.hpp */
|
||||
13
xo-expression2/include/xo/expression2/IfElseExpr.hpp
Normal file
13
xo-expression2/include/xo/expression2/IfElseExpr.hpp
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
/** @file IfElseExpr.hpp
|
||||
*
|
||||
* @author Roland Conybeare, Feb 2026
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "DIfElseExpr.hpp"
|
||||
#include "detail/IExpression_DIfElseExpr.hpp"
|
||||
#include "detail/IGCObject_DIfElseExpr.hpp"
|
||||
#include "detail/IPrintable_DIfElseExpr.hpp"
|
||||
|
||||
/* end IfElseExpr.hpp */
|
||||
13
xo-expression2/include/xo/expression2/LambdaExpr.hpp
Normal file
13
xo-expression2/include/xo/expression2/LambdaExpr.hpp
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
/** @file LambdaExpr.hpp
|
||||
*
|
||||
* @author Roland Conybeare, Feb 2026
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "DLambdaExpr.hpp"
|
||||
#include "detail/IExpression_DLambdaExpr.hpp"
|
||||
#include "detail/IGCObject_DLambdaExpr.hpp"
|
||||
#include "detail/IPrintable_DLambdaExpr.hpp"
|
||||
|
||||
/* end LambdaExpr.hpp */
|
||||
13
xo-expression2/include/xo/expression2/LocalSymtab.hpp
Normal file
13
xo-expression2/include/xo/expression2/LocalSymtab.hpp
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
/** @file LocalSymtab.hpp
|
||||
*
|
||||
* @author Roland Conybeare, Feb 2026
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "DLocalSymtab.hpp"
|
||||
#include "symtab/ISymbolTable_DLocalSymtab.hpp"
|
||||
#include "symtab/IGCObject_DLocalSymtab.hpp"
|
||||
#include "symtab/IPrintable_DLocalSymtab.hpp"
|
||||
|
||||
/* end LocalSymtab.hpp */
|
||||
14
xo-expression2/include/xo/expression2/SequenceExpr.hpp
Normal file
14
xo-expression2/include/xo/expression2/SequenceExpr.hpp
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
/** @file SequenceExpr.hpp
|
||||
*
|
||||
* @author Roland Conybeare, Feb 2026
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "DSequenceExpr.hpp"
|
||||
#include "detail/IExpression_DSequenceExpr.hpp"
|
||||
#include "detail/IGCObject_DSequenceExpr.hpp"
|
||||
#include "detail/IPrintable_DSequenceExpr.hpp"
|
||||
|
||||
/* end SequenceExpr.hpp */
|
||||
|
||||
25
xo-expression2/include/xo/expression2/SetupExpression2.hpp
Normal file
25
xo-expression2/include/xo/expression2/SetupExpression2.hpp
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
/** @file SetupExpression2.hpp
|
||||
*
|
||||
* @author Roland Conybeare, Jan 2026
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <xo/alloc2/Collector.hpp>
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
class SetupExpression2 {
|
||||
public:
|
||||
using ACollector = xo::mm::ACollector;
|
||||
|
||||
public:
|
||||
/** Register expression2 (facet,impl) combinations with FacetRegistry **/
|
||||
static bool register_facets();
|
||||
/** Register expression2 (facet,impl) combinations with FacetRegistry **/
|
||||
static bool register_types(obj<ACollector> gc);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/* end SetupExpression2.hpp */
|
||||
22
xo-expression2/include/xo/expression2/SymbolTable.hpp
Normal file
22
xo-expression2/include/xo/expression2/SymbolTable.hpp
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
/** @file SymbolTable.hpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/SymbolTable.json5]
|
||||
* 2. jinja2 template for facet .hpp file:
|
||||
* [facet.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/SymbolTable.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "symtab/ASymbolTable.hpp"
|
||||
#include "symtab/ISymbolTable_Any.hpp"
|
||||
#include "symtab/ISymbolTable_Xfer.hpp"
|
||||
#include "symtab/RSymbolTable.hpp"
|
||||
|
||||
|
||||
/* end SymbolTable.hpp */
|
||||
111
xo-expression2/include/xo/expression2/TypeRef.hpp
Normal file
111
xo-expression2/include/xo/expression2/TypeRef.hpp
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
/** @file TypeRef.hpp
|
||||
*
|
||||
* @author Roland Conybeare, Jan 2026
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <xo/type/Type.hpp>
|
||||
#include <xo/reflect/TypeDescr.hpp>
|
||||
#include <xo/alloc2/Collector.hpp>
|
||||
#include <xo/alloc2/GCObjectVisitor.hpp>
|
||||
#include <xo/flatstring/flatstring.hpp>
|
||||
#include <xo/indentlog/print/pretty.hpp>
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
/** @class TypeRef
|
||||
* @brief name and (when established) resolution for type
|
||||
* associated with an expression
|
||||
*
|
||||
* Type inference / unification operates on
|
||||
* @ref xo::scm::TypeBlueprint instances. See also!
|
||||
**/
|
||||
class TypeRef {
|
||||
public:
|
||||
using TypeDescr = xo::reflect::TypeDescr;
|
||||
using type_var = flatstring<20>;
|
||||
using prefix_type = flatstring<8>;
|
||||
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
|
||||
using VisitReason = xo::mm::VisitReason;
|
||||
using ppindentinfo = xo::print::ppindentinfo;
|
||||
|
||||
public:
|
||||
TypeRef() = default;
|
||||
TypeRef(const type_var & id, obj<AType> type);
|
||||
|
||||
/** trivial typeref, where already resolved.
|
||||
* Require: @p td non-null
|
||||
**/
|
||||
static TypeRef resolved(TypeDescr td);
|
||||
|
||||
/** trivial typeref, where already resolved **/
|
||||
static TypeRef resolved(obj<AType> type);
|
||||
|
||||
/** if @p type is non-null
|
||||
* -> type already resolved
|
||||
* else
|
||||
* -> generate unique typevar name, starting with @p prefix
|
||||
**/
|
||||
static TypeRef dwim(prefix_type prefix, obj<AType> type);
|
||||
|
||||
/** if @p td is non-null
|
||||
* -> type is already resolved
|
||||
*
|
||||
* if type is not determined (i.e. @p td is nullptr):
|
||||
* -> generate and store type variable name.
|
||||
**/
|
||||
static TypeRef dwim(prefix_type prefix, TypeDescr td);
|
||||
|
||||
/** generate a unique type-variable name,
|
||||
* that begins with @p prefix
|
||||
**/
|
||||
static type_var generate_unique(prefix_type prefix);
|
||||
|
||||
const type_var & id() const noexcept { return id_; }
|
||||
TypeDescr td() const noexcept { return td_; }
|
||||
|
||||
/** true iff type at this location has been resolved **/
|
||||
bool is_resolved() const noexcept;
|
||||
|
||||
/** resolve TypeRef by supplying final type-description **/
|
||||
void resolve(TypeDescr td) noexcept { td_ = td; }
|
||||
|
||||
/** pretty-printer support **/
|
||||
bool pretty(const ppindentinfo & ppii) const;
|
||||
|
||||
/** gc support **/
|
||||
void visit_gco_children(VisitReason reason, obj<AGCObjectVisitor> gc) noexcept;
|
||||
|
||||
private:
|
||||
TypeRef(const type_var & id, TypeDescr td);
|
||||
|
||||
private:
|
||||
/** unique (probably generated) name for type at this location **/
|
||||
type_var id_;
|
||||
|
||||
/** Type, when resolved **/
|
||||
obj<AType> type_;
|
||||
|
||||
/** Description for concrete type, once resolved.
|
||||
* May be null when this TypeRef created,
|
||||
* but expected to be immutable once established.
|
||||
**/
|
||||
TypeDescr td_ = nullptr;
|
||||
};
|
||||
} /*namespace scm*/
|
||||
|
||||
namespace print {
|
||||
/** pretty printer in <xo/indentlog/print/pretty.hpp> relies on this specialization
|
||||
* to handle TypeRef instances
|
||||
**/
|
||||
template <>
|
||||
struct ppdetail<xo::scm::TypeRef> {
|
||||
static inline bool print_pretty(const ppindentinfo & ppii, const xo::scm::TypeRef x) {
|
||||
return x.pretty(ppii);
|
||||
}
|
||||
};
|
||||
}
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end TypeRef.hpp */
|
||||
12
xo-expression2/include/xo/expression2/Typename.hpp
Normal file
12
xo-expression2/include/xo/expression2/Typename.hpp
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
/** @file Typename.hpp
|
||||
*
|
||||
* @author Roland Conybeare, Mar 2026
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "DTypename.hpp"
|
||||
#include "typename/IGCObject_DTypename.hpp"
|
||||
#include "typename/IPrintable_DTypename.hpp"
|
||||
|
||||
/* end Typename.hpp */
|
||||
13
xo-expression2/include/xo/expression2/VarRef.hpp
Normal file
13
xo-expression2/include/xo/expression2/VarRef.hpp
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
/** @file VarRef.hpp
|
||||
*
|
||||
* @author Roland Conybeare, Feb 2026
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "DVarRef.hpp"
|
||||
#include "detail/IExpression_DVarRef.hpp"
|
||||
#include "detail/IGCObject_DVarRef.hpp"
|
||||
#include "detail/IPrintable_DVarRef.hpp"
|
||||
|
||||
/* end VarRef.hpp */
|
||||
13
xo-expression2/include/xo/expression2/Variable.hpp
Normal file
13
xo-expression2/include/xo/expression2/Variable.hpp
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
/** @file Variable.hpp
|
||||
*
|
||||
* @author Roland Conybeare, Feb 2026
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "DVariable.hpp"
|
||||
#include "variable/IExpression_DVariable.hpp"
|
||||
#include "variable/IGCObject_DVariable.hpp"
|
||||
#include "variable/IPrintable_DVariable.hpp"
|
||||
|
||||
/* end Variable.hpp */
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
/** @file IGCObject_DDefineExpr.hpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/IGCObject_DDefineExpr.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_repr.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/IGCObject_DDefineExpr.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "GCObject.hpp"
|
||||
#include <xo/alloc2/GCObject.hpp>
|
||||
#include <xo/alloc2/Allocator.hpp>
|
||||
#include "DDefineExpr.hpp"
|
||||
|
||||
namespace xo { namespace scm { class IGCObject_DDefineExpr; } }
|
||||
|
||||
namespace xo {
|
||||
namespace facet {
|
||||
template <>
|
||||
struct FacetImplementation<xo::mm::AGCObject,
|
||||
xo::scm::DDefineExpr>
|
||||
{
|
||||
using ImplType = xo::mm::IGCObject_Xfer
|
||||
<xo::scm::DDefineExpr,
|
||||
xo::scm::IGCObject_DDefineExpr>;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
/** @class IGCObject_DDefineExpr
|
||||
**/
|
||||
class IGCObject_DDefineExpr {
|
||||
public:
|
||||
/** @defgroup scm-gcobject-ddefineexpr-type-traits **/
|
||||
///@{
|
||||
using size_type = xo::mm::AGCObject::size_type;
|
||||
using AAllocator = xo::mm::AGCObject::AAllocator;
|
||||
using AGCObjectVisitor = xo::mm::AGCObject::AGCObjectVisitor;
|
||||
using VisitReason = xo::mm::AGCObject::VisitReason;
|
||||
using Copaque = xo::mm::AGCObject::Copaque;
|
||||
using Opaque = xo::mm::AGCObject::Opaque;
|
||||
///@}
|
||||
/** @defgroup scm-gcobject-ddefineexpr-methods **/
|
||||
///@{
|
||||
// const methods
|
||||
|
||||
// non-const methods
|
||||
/** move instance using object visitor.
|
||||
Arguably abusing the word 'visitor' here **/
|
||||
static Opaque gco_shallow_move(DDefineExpr & self, obj<AGCObjectVisitor> gc) noexcept;
|
||||
/** Invoke fn.visit_child(iface,data) for each child GCObject pointer.
|
||||
Context: provides address of data pointer so it can be updated in place
|
||||
when @p fn invokes garbage collector reentry point **/
|
||||
static void visit_gco_children(DDefineExpr & self, VisitReason reason, obj<AGCObjectVisitor> fn) noexcept;
|
||||
///@}
|
||||
};
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end */
|
||||
89
xo-expression2/include/xo/expression2/detail/AExpression.hpp
Normal file
89
xo-expression2/include/xo/expression2/detail/AExpression.hpp
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
/** @file AExpression.hpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/Expression.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [abstract_facet.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/Expression.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
// includes (via {facet_includes})
|
||||
#include "TypeRef.hpp"
|
||||
#include "exprtype.hpp"
|
||||
#include <xo/reflect/TypeDescr.hpp>
|
||||
#include <xo/facet/obj.hpp>
|
||||
#include <xo/facet/facet_implementation.hpp>
|
||||
#include <xo/facet/typeseq.hpp>
|
||||
|
||||
// {pretext} here
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
|
||||
using Copaque = const void *;
|
||||
using Opaque = void *;
|
||||
|
||||
/**
|
||||
Representation for executable Schematika expressions
|
||||
**/
|
||||
class AExpression {
|
||||
public:
|
||||
/** @defgroup scm-expression-type-traits **/
|
||||
///@{
|
||||
// types
|
||||
/** integer identifying a type **/
|
||||
using typeseq = xo::facet::typeseq;
|
||||
using Copaque = const void *;
|
||||
using Opaque = void *;
|
||||
/** struct describing a type **/
|
||||
using TypeDescr = xo::reflect::TypeDescr;
|
||||
///@}
|
||||
|
||||
/** @defgroup scm-expression-methods **/
|
||||
///@{
|
||||
// const methods
|
||||
/** An uninitialized AExpression instance will have zero vtable pointer (per {linux,osx} abi).
|
||||
* Use case for this is narrow. We go to some lengths to avoid null vtable pointers. For example
|
||||
* obj<AFacet> will have non-null vtable (via IFacet_Any) with all methods terminating.
|
||||
**/
|
||||
bool _has_null_vptr() const noexcept { return *reinterpret_cast<const void * const *>(this) == nullptr; }
|
||||
/** RTTI: unique id# for actual runtime data representation **/
|
||||
virtual typeseq _typeseq() const noexcept = 0;
|
||||
/** destroy instance @p d; calls c++ dtor only for actual runtime type; does not recover memory **/
|
||||
virtual void _drop(Opaque d) const noexcept = 0;
|
||||
/** expression type (constant | apply | ..) **/
|
||||
virtual exprtype extype(Copaque data) const noexcept = 0;
|
||||
/** placeholder for type giving possible values for this expression **/
|
||||
virtual TypeRef typeref(Copaque data) const noexcept = 0;
|
||||
/** type giving possible values for this expression. Maybe null before typecheck **/
|
||||
virtual TypeDescr valuetype(Copaque data) const noexcept = 0;
|
||||
|
||||
// nonconst methods
|
||||
/** assing to valuetype member. Useful when scaffolding expressions **/
|
||||
virtual void assign_valuetype(Opaque data, TypeDescr td) noexcept = 0;
|
||||
///@}
|
||||
}; /*AExpression*/
|
||||
|
||||
/** Implementation IExpression_DRepr of AExpression for state DRepr
|
||||
* should provide a specialization:
|
||||
*
|
||||
* template <>
|
||||
* struct xo::facet::FacetImplementation<AExpression, DRepr> {
|
||||
* using Impltype = IExpression_DRepr;
|
||||
* };
|
||||
*
|
||||
* then IExpression_ImplType<DRepr> --> IExpression_DRepr
|
||||
**/
|
||||
template <typename DRepr>
|
||||
using IExpression_ImplType = xo::facet::FacetImplType<AExpression, DRepr>;
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* AExpression.hpp */
|
||||
|
|
@ -0,0 +1,92 @@
|
|||
/** @file IExpression_Any.hpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/Expression.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_any.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/Expression.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "AExpression.hpp"
|
||||
#include <xo/facet/obj.hpp>
|
||||
|
||||
namespace xo { namespace scm { class IExpression_Any; } }
|
||||
|
||||
namespace xo {
|
||||
namespace facet {
|
||||
|
||||
template <>
|
||||
struct FacetImplementation<xo::scm::AExpression,
|
||||
DVariantPlaceholder>
|
||||
{
|
||||
using ImplType = xo::scm::IExpression_Any;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
|
||||
/** @class IExpression_Any
|
||||
* @brief AExpression implementation for empty variant instance
|
||||
**/
|
||||
class IExpression_Any : public AExpression {
|
||||
public:
|
||||
/** @defgroup scm-expression-any-type-traits **/
|
||||
///@{
|
||||
|
||||
/** integer identifying a type **/
|
||||
using typeseq = xo::facet::typeseq;
|
||||
using TypeDescr = AExpression::TypeDescr;
|
||||
|
||||
///@}
|
||||
/** @defgroup scm-expression-any-methods **/
|
||||
///@{
|
||||
|
||||
const AExpression * iface() const { return std::launder(this); }
|
||||
|
||||
// from AExpression
|
||||
|
||||
// builtin methods
|
||||
typeseq _typeseq() const noexcept override { return s_typeseq; }
|
||||
[[noreturn]] void _drop(Opaque) const noexcept override { _fatal(); }
|
||||
|
||||
// const methods
|
||||
[[noreturn]] exprtype extype(Copaque) const noexcept override { _fatal(); }
|
||||
[[noreturn]] TypeRef typeref(Copaque) const noexcept override { _fatal(); }
|
||||
[[noreturn]] TypeDescr valuetype(Copaque) const noexcept override { _fatal(); }
|
||||
|
||||
// nonconst methods
|
||||
[[noreturn]] void assign_valuetype(Opaque, TypeDescr) noexcept override;
|
||||
|
||||
///@}
|
||||
|
||||
private:
|
||||
/** @defgraoup scm-expression-any-private-methods **/
|
||||
///@{
|
||||
|
||||
[[noreturn]] static void _fatal();
|
||||
|
||||
///@}
|
||||
|
||||
public:
|
||||
/** @defgroup scm-expression-any-member-vars **/
|
||||
///@{
|
||||
|
||||
static typeseq s_typeseq;
|
||||
static bool _valid;
|
||||
|
||||
///@}
|
||||
};
|
||||
|
||||
} /*namespace scm */
|
||||
} /*namespace xo */
|
||||
|
||||
/* IExpression_Any.hpp */
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
/** @file IExpression_DApplyExpr.hpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/IExpression_DApplyExpr.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_repr.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/IExpression_DApplyExpr.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Expression.hpp"
|
||||
#include "Expression.hpp"
|
||||
#include "DApplyExpr.hpp"
|
||||
|
||||
namespace xo { namespace scm { class IExpression_DApplyExpr; } }
|
||||
|
||||
namespace xo {
|
||||
namespace facet {
|
||||
template <>
|
||||
struct FacetImplementation<xo::scm::AExpression,
|
||||
xo::scm::DApplyExpr>
|
||||
{
|
||||
using ImplType = xo::scm::IExpression_Xfer
|
||||
<xo::scm::DApplyExpr,
|
||||
xo::scm::IExpression_DApplyExpr>;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
/** @class IExpression_DApplyExpr
|
||||
**/
|
||||
class IExpression_DApplyExpr {
|
||||
public:
|
||||
/** @defgroup scm-expression-dapplyexpr-type-traits **/
|
||||
///@{
|
||||
using TypeDescr = xo::scm::AExpression::TypeDescr;
|
||||
using Copaque = xo::scm::AExpression::Copaque;
|
||||
using Opaque = xo::scm::AExpression::Opaque;
|
||||
///@}
|
||||
/** @defgroup scm-expression-dapplyexpr-methods **/
|
||||
///@{
|
||||
// const methods
|
||||
/** expression type (constant | apply | ..) **/
|
||||
static exprtype extype(const DApplyExpr & self) noexcept;
|
||||
/** placeholder for type giving possible values for this expression **/
|
||||
static TypeRef typeref(const DApplyExpr & self) noexcept;
|
||||
/** type giving possible values for this expression. Maybe null before typecheck **/
|
||||
static TypeDescr valuetype(const DApplyExpr & self) noexcept;
|
||||
|
||||
// non-const methods
|
||||
/** assing to valuetype member. Useful when scaffolding expressions **/
|
||||
static void assign_valuetype(DApplyExpr & self, TypeDescr td) noexcept;
|
||||
///@}
|
||||
};
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end */
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
/** @file IExpression_DConstant.hpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/IExpression_DConstant.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_repr.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/IExpression_DConstant.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Expression.hpp"
|
||||
#include "Expression.hpp"
|
||||
#include "DConstant.hpp"
|
||||
|
||||
namespace xo { namespace scm { class IExpression_DConstant; } }
|
||||
|
||||
namespace xo {
|
||||
namespace facet {
|
||||
template <>
|
||||
struct FacetImplementation<xo::scm::AExpression,
|
||||
xo::scm::DConstant>
|
||||
{
|
||||
using ImplType = xo::scm::IExpression_Xfer
|
||||
<xo::scm::DConstant,
|
||||
xo::scm::IExpression_DConstant>;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
/** @class IExpression_DConstant
|
||||
**/
|
||||
class IExpression_DConstant {
|
||||
public:
|
||||
/** @defgroup scm-expression-dconstant-type-traits **/
|
||||
///@{
|
||||
using TypeDescr = xo::scm::AExpression::TypeDescr;
|
||||
using Copaque = xo::scm::AExpression::Copaque;
|
||||
using Opaque = xo::scm::AExpression::Opaque;
|
||||
///@}
|
||||
/** @defgroup scm-expression-dconstant-methods **/
|
||||
///@{
|
||||
// const methods
|
||||
/** expression type (constant | apply | ..) **/
|
||||
static exprtype extype(const DConstant & self) noexcept;
|
||||
/** placeholder for type giving possible values for this expression **/
|
||||
static TypeRef typeref(const DConstant & self) noexcept;
|
||||
/** type giving possible values for this expression. Maybe null before typecheck **/
|
||||
static TypeDescr valuetype(const DConstant & self) noexcept;
|
||||
|
||||
// non-const methods
|
||||
/** assing to valuetype member. Useful when scaffolding expressions **/
|
||||
static void assign_valuetype(DConstant & self, TypeDescr td) noexcept;
|
||||
///@}
|
||||
};
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end */
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
/** @file IExpression_DDefineExpr.hpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/IExpression_DDefineExpr.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_repr.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/IExpression_DDefineExpr.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Expression.hpp"
|
||||
#include "Expression.hpp"
|
||||
#include "DDefineExpr.hpp"
|
||||
|
||||
namespace xo { namespace scm { class IExpression_DDefineExpr; } }
|
||||
|
||||
namespace xo {
|
||||
namespace facet {
|
||||
template <>
|
||||
struct FacetImplementation<xo::scm::AExpression,
|
||||
xo::scm::DDefineExpr>
|
||||
{
|
||||
using ImplType = xo::scm::IExpression_Xfer
|
||||
<xo::scm::DDefineExpr,
|
||||
xo::scm::IExpression_DDefineExpr>;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
/** @class IExpression_DDefineExpr
|
||||
**/
|
||||
class IExpression_DDefineExpr {
|
||||
public:
|
||||
/** @defgroup scm-expression-ddefineexpr-type-traits **/
|
||||
///@{
|
||||
using TypeDescr = xo::scm::AExpression::TypeDescr;
|
||||
using Copaque = xo::scm::AExpression::Copaque;
|
||||
using Opaque = xo::scm::AExpression::Opaque;
|
||||
///@}
|
||||
/** @defgroup scm-expression-ddefineexpr-methods **/
|
||||
///@{
|
||||
// const methods
|
||||
/** expression type (constant | apply | ..) **/
|
||||
static exprtype extype(const DDefineExpr & self) noexcept;
|
||||
/** placeholder for type giving possible values for this expression **/
|
||||
static TypeRef typeref(const DDefineExpr & self) noexcept;
|
||||
/** type giving possible values for this expression. Maybe null before typecheck **/
|
||||
static TypeDescr valuetype(const DDefineExpr & self) noexcept;
|
||||
|
||||
// non-const methods
|
||||
/** assing to valuetype member. Useful when scaffolding expressions **/
|
||||
static void assign_valuetype(DDefineExpr & self, TypeDescr td) noexcept;
|
||||
///@}
|
||||
};
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end */
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
/** @file IExpression_DIfElseExpr.hpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/IExpression_DIfElseExpr.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_repr.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/IExpression_DIfElseExpr.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Expression.hpp"
|
||||
#include "Expression.hpp"
|
||||
#include "DIfElseExpr.hpp"
|
||||
|
||||
namespace xo { namespace scm { class IExpression_DIfElseExpr; } }
|
||||
|
||||
namespace xo {
|
||||
namespace facet {
|
||||
template <>
|
||||
struct FacetImplementation<xo::scm::AExpression,
|
||||
xo::scm::DIfElseExpr>
|
||||
{
|
||||
using ImplType = xo::scm::IExpression_Xfer
|
||||
<xo::scm::DIfElseExpr,
|
||||
xo::scm::IExpression_DIfElseExpr>;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
/** @class IExpression_DIfElseExpr
|
||||
**/
|
||||
class IExpression_DIfElseExpr {
|
||||
public:
|
||||
/** @defgroup scm-expression-difelseexpr-type-traits **/
|
||||
///@{
|
||||
using TypeDescr = xo::scm::AExpression::TypeDescr;
|
||||
using Copaque = xo::scm::AExpression::Copaque;
|
||||
using Opaque = xo::scm::AExpression::Opaque;
|
||||
///@}
|
||||
/** @defgroup scm-expression-difelseexpr-methods **/
|
||||
///@{
|
||||
// const methods
|
||||
/** expression type (constant | apply | ..) **/
|
||||
static exprtype extype(const DIfElseExpr & self) noexcept;
|
||||
/** placeholder for type giving possible values for this expression **/
|
||||
static TypeRef typeref(const DIfElseExpr & self) noexcept;
|
||||
/** type giving possible values for this expression. Maybe null before typecheck **/
|
||||
static TypeDescr valuetype(const DIfElseExpr & self) noexcept;
|
||||
|
||||
// non-const methods
|
||||
/** assing to valuetype member. Useful when scaffolding expressions **/
|
||||
static void assign_valuetype(DIfElseExpr & self, TypeDescr td) noexcept;
|
||||
///@}
|
||||
};
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end */
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
/** @file IExpression_DLambdaExpr.hpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/IExpression_DLambdaExpr.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_repr.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/IExpression_DLambdaExpr.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Expression.hpp"
|
||||
#include "Expression.hpp"
|
||||
#include "DLambdaExpr.hpp"
|
||||
|
||||
namespace xo { namespace scm { class IExpression_DLambdaExpr; } }
|
||||
|
||||
namespace xo {
|
||||
namespace facet {
|
||||
template <>
|
||||
struct FacetImplementation<xo::scm::AExpression,
|
||||
xo::scm::DLambdaExpr>
|
||||
{
|
||||
using ImplType = xo::scm::IExpression_Xfer
|
||||
<xo::scm::DLambdaExpr,
|
||||
xo::scm::IExpression_DLambdaExpr>;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
/** @class IExpression_DLambdaExpr
|
||||
**/
|
||||
class IExpression_DLambdaExpr {
|
||||
public:
|
||||
/** @defgroup scm-expression-dlambdaexpr-type-traits **/
|
||||
///@{
|
||||
using TypeDescr = xo::scm::AExpression::TypeDescr;
|
||||
using Copaque = xo::scm::AExpression::Copaque;
|
||||
using Opaque = xo::scm::AExpression::Opaque;
|
||||
///@}
|
||||
/** @defgroup scm-expression-dlambdaexpr-methods **/
|
||||
///@{
|
||||
// const methods
|
||||
/** expression type (constant | apply | ..) **/
|
||||
static exprtype extype(const DLambdaExpr & self) noexcept;
|
||||
/** placeholder for type giving possible values for this expression **/
|
||||
static TypeRef typeref(const DLambdaExpr & self) noexcept;
|
||||
/** type giving possible values for this expression. Maybe null before typecheck **/
|
||||
static TypeDescr valuetype(const DLambdaExpr & self) noexcept;
|
||||
|
||||
// non-const methods
|
||||
/** assing to valuetype member. Useful when scaffolding expressions **/
|
||||
static void assign_valuetype(DLambdaExpr & self, TypeDescr td) noexcept;
|
||||
///@}
|
||||
};
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end */
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
/** @file IExpression_DSequenceExpr.hpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/IExpression_DSequenceExpr.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_repr.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/IExpression_DSequenceExpr.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Expression.hpp"
|
||||
#include "Expression.hpp"
|
||||
#include "DSequenceExpr.hpp"
|
||||
|
||||
namespace xo { namespace scm { class IExpression_DSequenceExpr; } }
|
||||
|
||||
namespace xo {
|
||||
namespace facet {
|
||||
template <>
|
||||
struct FacetImplementation<xo::scm::AExpression,
|
||||
xo::scm::DSequenceExpr>
|
||||
{
|
||||
using ImplType = xo::scm::IExpression_Xfer
|
||||
<xo::scm::DSequenceExpr,
|
||||
xo::scm::IExpression_DSequenceExpr>;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
/** @class IExpression_DSequenceExpr
|
||||
**/
|
||||
class IExpression_DSequenceExpr {
|
||||
public:
|
||||
/** @defgroup scm-expression-dsequenceexpr-type-traits **/
|
||||
///@{
|
||||
using TypeDescr = xo::scm::AExpression::TypeDescr;
|
||||
using Copaque = xo::scm::AExpression::Copaque;
|
||||
using Opaque = xo::scm::AExpression::Opaque;
|
||||
///@}
|
||||
/** @defgroup scm-expression-dsequenceexpr-methods **/
|
||||
///@{
|
||||
// const methods
|
||||
/** expression type (constant | apply | ..) **/
|
||||
static exprtype extype(const DSequenceExpr & self) noexcept;
|
||||
/** placeholder for type giving possible values for this expression **/
|
||||
static TypeRef typeref(const DSequenceExpr & self) noexcept;
|
||||
/** type giving possible values for this expression. Maybe null before typecheck **/
|
||||
static TypeDescr valuetype(const DSequenceExpr & self) noexcept;
|
||||
|
||||
// non-const methods
|
||||
/** assing to valuetype member. Useful when scaffolding expressions **/
|
||||
static void assign_valuetype(DSequenceExpr & self, TypeDescr td) noexcept;
|
||||
///@}
|
||||
};
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end */
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
/** @file IExpression_DVarRef.hpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/IExpression_DVarRef.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_repr.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/IExpression_DVarRef.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Expression.hpp"
|
||||
#include "Expression.hpp"
|
||||
#include "DVarRef.hpp"
|
||||
|
||||
namespace xo { namespace scm { class IExpression_DVarRef; } }
|
||||
|
||||
namespace xo {
|
||||
namespace facet {
|
||||
template <>
|
||||
struct FacetImplementation<xo::scm::AExpression,
|
||||
xo::scm::DVarRef>
|
||||
{
|
||||
using ImplType = xo::scm::IExpression_Xfer
|
||||
<xo::scm::DVarRef,
|
||||
xo::scm::IExpression_DVarRef>;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
/** @class IExpression_DVarRef
|
||||
**/
|
||||
class IExpression_DVarRef {
|
||||
public:
|
||||
/** @defgroup scm-expression-dvarref-type-traits **/
|
||||
///@{
|
||||
using TypeDescr = xo::scm::AExpression::TypeDescr;
|
||||
using Copaque = xo::scm::AExpression::Copaque;
|
||||
using Opaque = xo::scm::AExpression::Opaque;
|
||||
///@}
|
||||
/** @defgroup scm-expression-dvarref-methods **/
|
||||
///@{
|
||||
// const methods
|
||||
/** expression type (constant | apply | ..) **/
|
||||
static exprtype extype(const DVarRef & self) noexcept;
|
||||
/** placeholder for type giving possible values for this expression **/
|
||||
static TypeRef typeref(const DVarRef & self) noexcept;
|
||||
/** type giving possible values for this expression. Maybe null before typecheck **/
|
||||
static TypeDescr valuetype(const DVarRef & self) noexcept;
|
||||
|
||||
// non-const methods
|
||||
/** assing to valuetype member. Useful when scaffolding expressions **/
|
||||
static void assign_valuetype(DVarRef & self, TypeDescr td) noexcept;
|
||||
///@}
|
||||
};
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end */
|
||||
|
|
@ -0,0 +1,103 @@
|
|||
/** @file IExpression_Xfer.hpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/Expression.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_any.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/Expression.json5]
|
||||
*
|
||||
* variables:
|
||||
* {facet_hpp_fname} -> Expression.hpp
|
||||
* {impl_hpp_subdir} -> detail
|
||||
* {facet_ns1} -> xo
|
||||
* {facet_detail_subdir} -> detail
|
||||
* {abstract_facet_fname} -> AExpression.hpp
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "AExpression.hpp"
|
||||
#include "TypeRef.hpp"
|
||||
#include "exprtype.hpp"
|
||||
#include <xo/reflect/TypeDescr.hpp>
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
/** @class IExpression_Xfer
|
||||
**/
|
||||
template <typename DRepr, typename IExpression_DRepr>
|
||||
class IExpression_Xfer : public AExpression {
|
||||
public:
|
||||
/** @defgroup scm-expression-xfer-type-traits **/
|
||||
///@{
|
||||
/** actual implementation (not generated; often delegates to DRepr) **/
|
||||
using Impl = IExpression_DRepr;
|
||||
/** integer identifying a type **/
|
||||
using typeseq = AExpression::typeseq;
|
||||
using TypeDescr = AExpression::TypeDescr;
|
||||
///@}
|
||||
|
||||
/** @defgroup scm-expression-xfer-methods **/
|
||||
///@{
|
||||
|
||||
static const DRepr & _dcast(Copaque d) { return *(const DRepr *)d; }
|
||||
static DRepr & _dcast(Opaque d) { return *(DRepr *)d; }
|
||||
|
||||
// from AExpression
|
||||
|
||||
// builtin methods
|
||||
typeseq _typeseq() const noexcept override { return s_typeseq; }
|
||||
void _drop(Opaque d) const noexcept override { _dcast(d).~DRepr(); }
|
||||
|
||||
// const methods
|
||||
exprtype extype(Copaque data) const noexcept override {
|
||||
return I::extype(_dcast(data));
|
||||
}
|
||||
TypeRef typeref(Copaque data) const noexcept override {
|
||||
return I::typeref(_dcast(data));
|
||||
}
|
||||
TypeDescr valuetype(Copaque data) const noexcept override {
|
||||
return I::valuetype(_dcast(data));
|
||||
}
|
||||
|
||||
// non-const methods
|
||||
void assign_valuetype(Opaque data, TypeDescr td) noexcept override {
|
||||
return I::assign_valuetype(_dcast(data), td);
|
||||
}
|
||||
|
||||
///@}
|
||||
|
||||
private:
|
||||
using I = Impl;
|
||||
|
||||
public:
|
||||
/** @defgroup scm-expression-xfer-member-vars **/
|
||||
///@{
|
||||
|
||||
/** typeseq for template parameter DRepr **/
|
||||
static typeseq s_typeseq;
|
||||
/** true iff satisfies facet implementation **/
|
||||
static bool _valid;
|
||||
|
||||
///@}
|
||||
};
|
||||
|
||||
template <typename DRepr, typename IExpression_DRepr>
|
||||
xo::facet::typeseq
|
||||
IExpression_Xfer<DRepr, IExpression_DRepr>::s_typeseq
|
||||
= xo::facet::typeseq::id<DRepr>();
|
||||
|
||||
template <typename DRepr, typename IExpression_DRepr>
|
||||
bool
|
||||
IExpression_Xfer<DRepr, IExpression_DRepr>::_valid
|
||||
= xo::facet::valid_facet_implementation<AExpression,
|
||||
IExpression_Xfer>();
|
||||
|
||||
} /*namespace scm */
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end IExpression_Xfer.hpp */
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
/** @file IGCObject_DApplyExpr.hpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/IGCObject_DApplyExpr.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_repr.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/IGCObject_DApplyExpr.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "GCObject.hpp"
|
||||
#include <xo/alloc2/GCObject.hpp>
|
||||
#include <xo/alloc2/Allocator.hpp>
|
||||
#include "DApplyExpr.hpp"
|
||||
|
||||
namespace xo { namespace scm { class IGCObject_DApplyExpr; } }
|
||||
|
||||
namespace xo {
|
||||
namespace facet {
|
||||
template <>
|
||||
struct FacetImplementation<xo::mm::AGCObject,
|
||||
xo::scm::DApplyExpr>
|
||||
{
|
||||
using ImplType = xo::mm::IGCObject_Xfer
|
||||
<xo::scm::DApplyExpr,
|
||||
xo::scm::IGCObject_DApplyExpr>;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
/** @class IGCObject_DApplyExpr
|
||||
**/
|
||||
class IGCObject_DApplyExpr {
|
||||
public:
|
||||
/** @defgroup scm-gcobject-dapplyexpr-type-traits **/
|
||||
///@{
|
||||
using size_type = xo::mm::AGCObject::size_type;
|
||||
using AAllocator = xo::mm::AGCObject::AAllocator;
|
||||
using AGCObjectVisitor = xo::mm::AGCObject::AGCObjectVisitor;
|
||||
using VisitReason = xo::mm::AGCObject::VisitReason;
|
||||
using Copaque = xo::mm::AGCObject::Copaque;
|
||||
using Opaque = xo::mm::AGCObject::Opaque;
|
||||
///@}
|
||||
/** @defgroup scm-gcobject-dapplyexpr-methods **/
|
||||
///@{
|
||||
// const methods
|
||||
|
||||
// non-const methods
|
||||
/** move instance using object visitor.
|
||||
Arguably abusing the word 'visitor' here **/
|
||||
static Opaque gco_shallow_move(DApplyExpr & self, obj<AGCObjectVisitor> gc) noexcept;
|
||||
/** Invoke fn.visit_child(iface,data) for each child GCObject pointer.
|
||||
Context: provides address of data pointer so it can be updated in place
|
||||
when @p fn invokes garbage collector reentry point **/
|
||||
static void visit_gco_children(DApplyExpr & self, VisitReason reason, obj<AGCObjectVisitor> fn) noexcept;
|
||||
///@}
|
||||
};
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end */
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
/** @file IGCObject_DConstant.hpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/IGCObject_DConstant.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_repr.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/IGCObject_DConstant.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "GCObject.hpp"
|
||||
#include <xo/alloc2/GCObject.hpp>
|
||||
#include <xo/alloc2/Allocator.hpp>
|
||||
#include "DConstant.hpp"
|
||||
|
||||
namespace xo { namespace scm { class IGCObject_DConstant; } }
|
||||
|
||||
namespace xo {
|
||||
namespace facet {
|
||||
template <>
|
||||
struct FacetImplementation<xo::mm::AGCObject,
|
||||
xo::scm::DConstant>
|
||||
{
|
||||
using ImplType = xo::mm::IGCObject_Xfer
|
||||
<xo::scm::DConstant,
|
||||
xo::scm::IGCObject_DConstant>;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
/** @class IGCObject_DConstant
|
||||
**/
|
||||
class IGCObject_DConstant {
|
||||
public:
|
||||
/** @defgroup scm-gcobject-dconstant-type-traits **/
|
||||
///@{
|
||||
using size_type = xo::mm::AGCObject::size_type;
|
||||
using AAllocator = xo::mm::AGCObject::AAllocator;
|
||||
using AGCObjectVisitor = xo::mm::AGCObject::AGCObjectVisitor;
|
||||
using VisitReason = xo::mm::AGCObject::VisitReason;
|
||||
using Copaque = xo::mm::AGCObject::Copaque;
|
||||
using Opaque = xo::mm::AGCObject::Opaque;
|
||||
///@}
|
||||
/** @defgroup scm-gcobject-dconstant-methods **/
|
||||
///@{
|
||||
// const methods
|
||||
|
||||
// non-const methods
|
||||
/** move instance using object visitor.
|
||||
Arguably abusing the word 'visitor' here **/
|
||||
static Opaque gco_shallow_move(DConstant & self, obj<AGCObjectVisitor> gc) noexcept;
|
||||
/** Invoke fn.visit_child(iface,data) for each child GCObject pointer.
|
||||
Context: provides address of data pointer so it can be updated in place
|
||||
when @p fn invokes garbage collector reentry point **/
|
||||
static void visit_gco_children(DConstant & self, VisitReason reason, obj<AGCObjectVisitor> fn) noexcept;
|
||||
///@}
|
||||
};
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end */
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
/** @file IGCObject_DIfElseExpr.hpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/IGCObject_DIfElseExpr.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_repr.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/IGCObject_DIfElseExpr.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "GCObject.hpp"
|
||||
#include <xo/alloc2/GCObject.hpp>
|
||||
#include <xo/alloc2/Allocator.hpp>
|
||||
#include "DIfElseExpr.hpp"
|
||||
|
||||
namespace xo { namespace scm { class IGCObject_DIfElseExpr; } }
|
||||
|
||||
namespace xo {
|
||||
namespace facet {
|
||||
template <>
|
||||
struct FacetImplementation<xo::mm::AGCObject,
|
||||
xo::scm::DIfElseExpr>
|
||||
{
|
||||
using ImplType = xo::mm::IGCObject_Xfer
|
||||
<xo::scm::DIfElseExpr,
|
||||
xo::scm::IGCObject_DIfElseExpr>;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
/** @class IGCObject_DIfElseExpr
|
||||
**/
|
||||
class IGCObject_DIfElseExpr {
|
||||
public:
|
||||
/** @defgroup scm-gcobject-difelseexpr-type-traits **/
|
||||
///@{
|
||||
using size_type = xo::mm::AGCObject::size_type;
|
||||
using AAllocator = xo::mm::AGCObject::AAllocator;
|
||||
using AGCObjectVisitor = xo::mm::AGCObject::AGCObjectVisitor;
|
||||
using VisitReason = xo::mm::AGCObject::VisitReason;
|
||||
using Copaque = xo::mm::AGCObject::Copaque;
|
||||
using Opaque = xo::mm::AGCObject::Opaque;
|
||||
///@}
|
||||
/** @defgroup scm-gcobject-difelseexpr-methods **/
|
||||
///@{
|
||||
// const methods
|
||||
|
||||
// non-const methods
|
||||
/** move instance using object visitor.
|
||||
Arguably abusing the word 'visitor' here **/
|
||||
static Opaque gco_shallow_move(DIfElseExpr & self, obj<AGCObjectVisitor> gc) noexcept;
|
||||
/** Invoke fn.visit_child(iface,data) for each child GCObject pointer.
|
||||
Context: provides address of data pointer so it can be updated in place
|
||||
when @p fn invokes garbage collector reentry point **/
|
||||
static void visit_gco_children(DIfElseExpr & self, VisitReason reason, obj<AGCObjectVisitor> fn) noexcept;
|
||||
///@}
|
||||
};
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end */
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
/** @file IGCObject_DLambdaExpr.hpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/IGCObject_DLambdaExpr.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_repr.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/IGCObject_DLambdaExpr.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "GCObject.hpp"
|
||||
#include <xo/alloc2/GCObject.hpp>
|
||||
#include <xo/alloc2/Allocator.hpp>
|
||||
#include "DLambdaExpr.hpp"
|
||||
|
||||
namespace xo { namespace scm { class IGCObject_DLambdaExpr; } }
|
||||
|
||||
namespace xo {
|
||||
namespace facet {
|
||||
template <>
|
||||
struct FacetImplementation<xo::mm::AGCObject,
|
||||
xo::scm::DLambdaExpr>
|
||||
{
|
||||
using ImplType = xo::mm::IGCObject_Xfer
|
||||
<xo::scm::DLambdaExpr,
|
||||
xo::scm::IGCObject_DLambdaExpr>;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
/** @class IGCObject_DLambdaExpr
|
||||
**/
|
||||
class IGCObject_DLambdaExpr {
|
||||
public:
|
||||
/** @defgroup scm-gcobject-dlambdaexpr-type-traits **/
|
||||
///@{
|
||||
using size_type = xo::mm::AGCObject::size_type;
|
||||
using AAllocator = xo::mm::AGCObject::AAllocator;
|
||||
using AGCObjectVisitor = xo::mm::AGCObject::AGCObjectVisitor;
|
||||
using VisitReason = xo::mm::AGCObject::VisitReason;
|
||||
using Copaque = xo::mm::AGCObject::Copaque;
|
||||
using Opaque = xo::mm::AGCObject::Opaque;
|
||||
///@}
|
||||
/** @defgroup scm-gcobject-dlambdaexpr-methods **/
|
||||
///@{
|
||||
// const methods
|
||||
|
||||
// non-const methods
|
||||
/** move instance using object visitor.
|
||||
Arguably abusing the word 'visitor' here **/
|
||||
static Opaque gco_shallow_move(DLambdaExpr & self, obj<AGCObjectVisitor> gc) noexcept;
|
||||
/** Invoke fn.visit_child(iface,data) for each child GCObject pointer.
|
||||
Context: provides address of data pointer so it can be updated in place
|
||||
when @p fn invokes garbage collector reentry point **/
|
||||
static void visit_gco_children(DLambdaExpr & self, VisitReason reason, obj<AGCObjectVisitor> fn) noexcept;
|
||||
///@}
|
||||
};
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end */
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
/** @file IGCObject_DSequenceExpr.hpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/IGCObject_DSequenceExpr.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_repr.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/IGCObject_DSequenceExpr.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "GCObject.hpp"
|
||||
#include <xo/alloc2/GCObject.hpp>
|
||||
#include <xo/alloc2/Allocator.hpp>
|
||||
#include "DSequenceExpr.hpp"
|
||||
|
||||
namespace xo { namespace scm { class IGCObject_DSequenceExpr; } }
|
||||
|
||||
namespace xo {
|
||||
namespace facet {
|
||||
template <>
|
||||
struct FacetImplementation<xo::mm::AGCObject,
|
||||
xo::scm::DSequenceExpr>
|
||||
{
|
||||
using ImplType = xo::mm::IGCObject_Xfer
|
||||
<xo::scm::DSequenceExpr,
|
||||
xo::scm::IGCObject_DSequenceExpr>;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
/** @class IGCObject_DSequenceExpr
|
||||
**/
|
||||
class IGCObject_DSequenceExpr {
|
||||
public:
|
||||
/** @defgroup scm-gcobject-dsequenceexpr-type-traits **/
|
||||
///@{
|
||||
using size_type = xo::mm::AGCObject::size_type;
|
||||
using AAllocator = xo::mm::AGCObject::AAllocator;
|
||||
using AGCObjectVisitor = xo::mm::AGCObject::AGCObjectVisitor;
|
||||
using VisitReason = xo::mm::AGCObject::VisitReason;
|
||||
using Copaque = xo::mm::AGCObject::Copaque;
|
||||
using Opaque = xo::mm::AGCObject::Opaque;
|
||||
///@}
|
||||
/** @defgroup scm-gcobject-dsequenceexpr-methods **/
|
||||
///@{
|
||||
// const methods
|
||||
|
||||
// non-const methods
|
||||
/** move instance using object visitor.
|
||||
Arguably abusing the word 'visitor' here **/
|
||||
static Opaque gco_shallow_move(DSequenceExpr & self, obj<AGCObjectVisitor> gc) noexcept;
|
||||
/** Invoke fn.visit_child(iface,data) for each child GCObject pointer.
|
||||
Context: provides address of data pointer so it can be updated in place
|
||||
when @p fn invokes garbage collector reentry point **/
|
||||
static void visit_gco_children(DSequenceExpr & self, VisitReason reason, obj<AGCObjectVisitor> fn) noexcept;
|
||||
///@}
|
||||
};
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end */
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
/** @file IGCObject_DVarRef.hpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/IGCObject_DVarRef.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_repr.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/IGCObject_DVarRef.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "GCObject.hpp"
|
||||
#include <xo/alloc2/GCObject.hpp>
|
||||
#include <xo/alloc2/Allocator.hpp>
|
||||
#include "DVarRef.hpp"
|
||||
|
||||
namespace xo { namespace scm { class IGCObject_DVarRef; } }
|
||||
|
||||
namespace xo {
|
||||
namespace facet {
|
||||
template <>
|
||||
struct FacetImplementation<xo::mm::AGCObject,
|
||||
xo::scm::DVarRef>
|
||||
{
|
||||
using ImplType = xo::mm::IGCObject_Xfer
|
||||
<xo::scm::DVarRef,
|
||||
xo::scm::IGCObject_DVarRef>;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
/** @class IGCObject_DVarRef
|
||||
**/
|
||||
class IGCObject_DVarRef {
|
||||
public:
|
||||
/** @defgroup scm-gcobject-dvarref-type-traits **/
|
||||
///@{
|
||||
using size_type = xo::mm::AGCObject::size_type;
|
||||
using AAllocator = xo::mm::AGCObject::AAllocator;
|
||||
using AGCObjectVisitor = xo::mm::AGCObject::AGCObjectVisitor;
|
||||
using VisitReason = xo::mm::AGCObject::VisitReason;
|
||||
using Copaque = xo::mm::AGCObject::Copaque;
|
||||
using Opaque = xo::mm::AGCObject::Opaque;
|
||||
///@}
|
||||
/** @defgroup scm-gcobject-dvarref-methods **/
|
||||
///@{
|
||||
// const methods
|
||||
|
||||
// non-const methods
|
||||
/** move instance using object visitor.
|
||||
Arguably abusing the word 'visitor' here **/
|
||||
static Opaque gco_shallow_move(DVarRef & self, obj<AGCObjectVisitor> gc) noexcept;
|
||||
/** Invoke fn.visit_child(iface,data) for each child GCObject pointer.
|
||||
Context: provides address of data pointer so it can be updated in place
|
||||
when @p fn invokes garbage collector reentry point **/
|
||||
static void visit_gco_children(DVarRef & self, VisitReason reason, obj<AGCObjectVisitor> fn) noexcept;
|
||||
///@}
|
||||
};
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end */
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
/** @file IPrintable_DApplyExpr.hpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/IPrintable_DApplyExpr.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_repr.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/IPrintable_DApplyExpr.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Printable.hpp"
|
||||
#include <xo/printable2/Printable.hpp>
|
||||
#include <xo/printable2/detail/IPrintable_Xfer.hpp>
|
||||
#include "DApplyExpr.hpp"
|
||||
|
||||
namespace xo { namespace scm { class IPrintable_DApplyExpr; } }
|
||||
|
||||
namespace xo {
|
||||
namespace facet {
|
||||
template <>
|
||||
struct FacetImplementation<xo::print::APrintable,
|
||||
xo::scm::DApplyExpr>
|
||||
{
|
||||
using ImplType = xo::print::IPrintable_Xfer
|
||||
<xo::scm::DApplyExpr,
|
||||
xo::scm::IPrintable_DApplyExpr>;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
/** @class IPrintable_DApplyExpr
|
||||
**/
|
||||
class IPrintable_DApplyExpr {
|
||||
public:
|
||||
/** @defgroup scm-printable-dapplyexpr-type-traits **/
|
||||
///@{
|
||||
using ppindentinfo = xo::print::APrintable::ppindentinfo;
|
||||
using Copaque = xo::print::APrintable::Copaque;
|
||||
using Opaque = xo::print::APrintable::Opaque;
|
||||
///@}
|
||||
/** @defgroup scm-printable-dapplyexpr-methods **/
|
||||
///@{
|
||||
// const methods
|
||||
/** Pretty-printing support for this object.
|
||||
See [xo-indentlog/xo/indentlog/pretty.hpp] **/
|
||||
static bool pretty(const DApplyExpr & self, const ppindentinfo & ppii);
|
||||
|
||||
// non-const methods
|
||||
///@}
|
||||
};
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end */
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
/** @file IPrintable_DConstant.hpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/IPrintable_DConstant.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_repr.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/IPrintable_DConstant.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Printable.hpp"
|
||||
#include <xo/printable2/Printable.hpp>
|
||||
#include <xo/printable2/detail/IPrintable_Xfer.hpp>
|
||||
#include "DConstant.hpp"
|
||||
|
||||
namespace xo { namespace scm { class IPrintable_DConstant; } }
|
||||
|
||||
namespace xo {
|
||||
namespace facet {
|
||||
template <>
|
||||
struct FacetImplementation<xo::print::APrintable,
|
||||
xo::scm::DConstant>
|
||||
{
|
||||
using ImplType = xo::print::IPrintable_Xfer
|
||||
<xo::scm::DConstant,
|
||||
xo::scm::IPrintable_DConstant>;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
/** @class IPrintable_DConstant
|
||||
**/
|
||||
class IPrintable_DConstant {
|
||||
public:
|
||||
/** @defgroup scm-printable-dconstant-type-traits **/
|
||||
///@{
|
||||
using ppindentinfo = xo::print::APrintable::ppindentinfo;
|
||||
using Copaque = xo::print::APrintable::Copaque;
|
||||
using Opaque = xo::print::APrintable::Opaque;
|
||||
///@}
|
||||
/** @defgroup scm-printable-dconstant-methods **/
|
||||
///@{
|
||||
// const methods
|
||||
/** Pretty-printing support for this object.
|
||||
See [xo-indentlog/xo/indentlog/pretty.hpp] **/
|
||||
static bool pretty(const DConstant & self, const ppindentinfo & ppii);
|
||||
|
||||
// non-const methods
|
||||
///@}
|
||||
};
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end */
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
/** @file IPrintable_DDefineExpr.hpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/IPrintable_DDefineExpr.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_repr.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/IPrintable_DDefineExpr.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Printable.hpp"
|
||||
#include <xo/printable2/Printable.hpp>
|
||||
#include <xo/printable2/detail/IPrintable_Xfer.hpp>
|
||||
#include "DDefineExpr.hpp"
|
||||
|
||||
namespace xo { namespace scm { class IPrintable_DDefineExpr; } }
|
||||
|
||||
namespace xo {
|
||||
namespace facet {
|
||||
template <>
|
||||
struct FacetImplementation<xo::print::APrintable,
|
||||
xo::scm::DDefineExpr>
|
||||
{
|
||||
using ImplType = xo::print::IPrintable_Xfer
|
||||
<xo::scm::DDefineExpr,
|
||||
xo::scm::IPrintable_DDefineExpr>;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
/** @class IPrintable_DDefineExpr
|
||||
**/
|
||||
class IPrintable_DDefineExpr {
|
||||
public:
|
||||
/** @defgroup scm-printable-ddefineexpr-type-traits **/
|
||||
///@{
|
||||
using ppindentinfo = xo::print::APrintable::ppindentinfo;
|
||||
using Copaque = xo::print::APrintable::Copaque;
|
||||
using Opaque = xo::print::APrintable::Opaque;
|
||||
///@}
|
||||
/** @defgroup scm-printable-ddefineexpr-methods **/
|
||||
///@{
|
||||
// const methods
|
||||
/** Pretty-printing support for this object.
|
||||
See [xo-indentlog/xo/indentlog/pretty.hpp] **/
|
||||
static bool pretty(const DDefineExpr & self, const ppindentinfo & ppii);
|
||||
|
||||
// non-const methods
|
||||
///@}
|
||||
};
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end */
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
/** @file IPrintable_DIfElseExpr.hpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/IPrintable_DIfElseExpr.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_repr.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/IPrintable_DIfElseExpr.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Printable.hpp"
|
||||
#include <xo/printable2/Printable.hpp>
|
||||
#include <xo/printable2/detail/IPrintable_Xfer.hpp>
|
||||
#include "DIfElseExpr.hpp"
|
||||
|
||||
namespace xo { namespace scm { class IPrintable_DIfElseExpr; } }
|
||||
|
||||
namespace xo {
|
||||
namespace facet {
|
||||
template <>
|
||||
struct FacetImplementation<xo::print::APrintable,
|
||||
xo::scm::DIfElseExpr>
|
||||
{
|
||||
using ImplType = xo::print::IPrintable_Xfer
|
||||
<xo::scm::DIfElseExpr,
|
||||
xo::scm::IPrintable_DIfElseExpr>;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
/** @class IPrintable_DIfElseExpr
|
||||
**/
|
||||
class IPrintable_DIfElseExpr {
|
||||
public:
|
||||
/** @defgroup scm-printable-difelseexpr-type-traits **/
|
||||
///@{
|
||||
using ppindentinfo = xo::print::APrintable::ppindentinfo;
|
||||
using Copaque = xo::print::APrintable::Copaque;
|
||||
using Opaque = xo::print::APrintable::Opaque;
|
||||
///@}
|
||||
/** @defgroup scm-printable-difelseexpr-methods **/
|
||||
///@{
|
||||
// const methods
|
||||
/** Pretty-printing support for this object.
|
||||
See [xo-indentlog/xo/indentlog/pretty.hpp] **/
|
||||
static bool pretty(const DIfElseExpr & self, const ppindentinfo & ppii);
|
||||
|
||||
// non-const methods
|
||||
///@}
|
||||
};
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end */
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
/** @file IPrintable_DLambdaExpr.hpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/IPrintable_DLambdaExpr.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_repr.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/IPrintable_DLambdaExpr.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Printable.hpp"
|
||||
#include <xo/printable2/Printable.hpp>
|
||||
#include <xo/printable2/detail/IPrintable_Xfer.hpp>
|
||||
#include "DLambdaExpr.hpp"
|
||||
|
||||
namespace xo { namespace scm { class IPrintable_DLambdaExpr; } }
|
||||
|
||||
namespace xo {
|
||||
namespace facet {
|
||||
template <>
|
||||
struct FacetImplementation<xo::print::APrintable,
|
||||
xo::scm::DLambdaExpr>
|
||||
{
|
||||
using ImplType = xo::print::IPrintable_Xfer
|
||||
<xo::scm::DLambdaExpr,
|
||||
xo::scm::IPrintable_DLambdaExpr>;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
/** @class IPrintable_DLambdaExpr
|
||||
**/
|
||||
class IPrintable_DLambdaExpr {
|
||||
public:
|
||||
/** @defgroup scm-printable-dlambdaexpr-type-traits **/
|
||||
///@{
|
||||
using ppindentinfo = xo::print::APrintable::ppindentinfo;
|
||||
using Copaque = xo::print::APrintable::Copaque;
|
||||
using Opaque = xo::print::APrintable::Opaque;
|
||||
///@}
|
||||
/** @defgroup scm-printable-dlambdaexpr-methods **/
|
||||
///@{
|
||||
// const methods
|
||||
/** Pretty-printing support for this object.
|
||||
See [xo-indentlog/xo/indentlog/pretty.hpp] **/
|
||||
static bool pretty(const DLambdaExpr & self, const ppindentinfo & ppii);
|
||||
|
||||
// non-const methods
|
||||
///@}
|
||||
};
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end */
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
/** @file IPrintable_DSequenceExpr.hpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/IPrintable_DSequenceExpr.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_repr.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/IPrintable_DSequenceExpr.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Printable.hpp"
|
||||
#include <xo/printable2/Printable.hpp>
|
||||
#include <xo/printable2/detail/IPrintable_Xfer.hpp>
|
||||
#include "DSequenceExpr.hpp"
|
||||
|
||||
namespace xo { namespace scm { class IPrintable_DSequenceExpr; } }
|
||||
|
||||
namespace xo {
|
||||
namespace facet {
|
||||
template <>
|
||||
struct FacetImplementation<xo::print::APrintable,
|
||||
xo::scm::DSequenceExpr>
|
||||
{
|
||||
using ImplType = xo::print::IPrintable_Xfer
|
||||
<xo::scm::DSequenceExpr,
|
||||
xo::scm::IPrintable_DSequenceExpr>;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
/** @class IPrintable_DSequenceExpr
|
||||
**/
|
||||
class IPrintable_DSequenceExpr {
|
||||
public:
|
||||
/** @defgroup scm-printable-dsequenceexpr-type-traits **/
|
||||
///@{
|
||||
using ppindentinfo = xo::print::APrintable::ppindentinfo;
|
||||
using Copaque = xo::print::APrintable::Copaque;
|
||||
using Opaque = xo::print::APrintable::Opaque;
|
||||
///@}
|
||||
/** @defgroup scm-printable-dsequenceexpr-methods **/
|
||||
///@{
|
||||
// const methods
|
||||
/** Pretty-printing support for this object.
|
||||
See [xo-indentlog/xo/indentlog/pretty.hpp] **/
|
||||
static bool pretty(const DSequenceExpr & self, const ppindentinfo & ppii);
|
||||
|
||||
// non-const methods
|
||||
///@}
|
||||
};
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end */
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
/** @file IPrintable_DVarRef.hpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/IPrintable_DVarRef.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_repr.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/IPrintable_DVarRef.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Printable.hpp"
|
||||
#include <xo/printable2/Printable.hpp>
|
||||
#include <xo/printable2/detail/IPrintable_Xfer.hpp>
|
||||
#include "DVarRef.hpp"
|
||||
|
||||
namespace xo { namespace scm { class IPrintable_DVarRef; } }
|
||||
|
||||
namespace xo {
|
||||
namespace facet {
|
||||
template <>
|
||||
struct FacetImplementation<xo::print::APrintable,
|
||||
xo::scm::DVarRef>
|
||||
{
|
||||
using ImplType = xo::print::IPrintable_Xfer
|
||||
<xo::scm::DVarRef,
|
||||
xo::scm::IPrintable_DVarRef>;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
/** @class IPrintable_DVarRef
|
||||
**/
|
||||
class IPrintable_DVarRef {
|
||||
public:
|
||||
/** @defgroup scm-printable-dvarref-type-traits **/
|
||||
///@{
|
||||
using ppindentinfo = xo::print::APrintable::ppindentinfo;
|
||||
using Copaque = xo::print::APrintable::Copaque;
|
||||
using Opaque = xo::print::APrintable::Opaque;
|
||||
///@}
|
||||
/** @defgroup scm-printable-dvarref-methods **/
|
||||
///@{
|
||||
// const methods
|
||||
/** Pretty-printing support for this object.
|
||||
See [xo-indentlog/xo/indentlog/pretty.hpp] **/
|
||||
static bool pretty(const DVarRef & self, const ppindentinfo & ppii);
|
||||
|
||||
// non-const methods
|
||||
///@}
|
||||
};
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end */
|
||||
94
xo-expression2/include/xo/expression2/detail/RExpression.hpp
Normal file
94
xo-expression2/include/xo/expression2/detail/RExpression.hpp
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
/** @file RExpression.hpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/Expression.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_any.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/Expression.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "AExpression.hpp"
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
|
||||
/** @class RExpression
|
||||
**/
|
||||
template <typename Object>
|
||||
class RExpression : public Object {
|
||||
private:
|
||||
using O = Object;
|
||||
|
||||
public:
|
||||
/** @defgroup scm-expression-router-type-traits **/
|
||||
///@{
|
||||
using ObjectType = Object;
|
||||
using DataPtr = Object::DataPtr;
|
||||
using typeseq = xo::reflect::typeseq;
|
||||
using TypeDescr = AExpression::TypeDescr;
|
||||
///@}
|
||||
|
||||
/** @defgroup scm-expression-router-ctors **/
|
||||
///@{
|
||||
RExpression() {}
|
||||
RExpression(Object::DataPtr data) : Object{std::move(data)} {}
|
||||
RExpression(const AExpression * iface, void * data)
|
||||
requires std::is_same_v<typename Object::DataType, xo::facet::DVariantPlaceholder>
|
||||
: Object(iface, data) {}
|
||||
|
||||
///@}
|
||||
/** @defgroup scm-expression-router-methods **/
|
||||
///@{
|
||||
|
||||
// explicit injected content
|
||||
|
||||
// builtin methods
|
||||
typeseq _typeseq() const noexcept { return O::iface()->_typeseq(); }
|
||||
void _drop() const noexcept { O::iface()->_drop(O::data()); }
|
||||
|
||||
// const methods
|
||||
exprtype extype() const noexcept {
|
||||
return O::iface()->extype(O::data());
|
||||
}
|
||||
TypeRef typeref() const noexcept {
|
||||
return O::iface()->typeref(O::data());
|
||||
}
|
||||
TypeDescr valuetype() const noexcept {
|
||||
return O::iface()->valuetype(O::data());
|
||||
}
|
||||
|
||||
// non-const methods (still const in router!)
|
||||
void assign_valuetype(TypeDescr td) noexcept {
|
||||
return O::iface()->assign_valuetype(O::data(), td);
|
||||
}
|
||||
|
||||
///@}
|
||||
/** @defgroup scm-expression-member-vars **/
|
||||
///@{
|
||||
|
||||
static bool _valid;
|
||||
|
||||
///@}
|
||||
};
|
||||
|
||||
template <typename Object>
|
||||
bool
|
||||
RExpression<Object>::_valid = xo::facet::valid_object_router<Object>();
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
namespace xo { namespace facet {
|
||||
template <typename Object>
|
||||
struct RoutingFor<xo::scm::AExpression, Object> {
|
||||
using RoutingType = xo::scm::RExpression<Object>;
|
||||
};
|
||||
} }
|
||||
|
||||
/* end RExpression.hpp */
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
/** @file expression2_register_types.hpp
|
||||
*
|
||||
* @author Roland Conybeare, Dec 2025
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <xo/alloc2/Collector.hpp>
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
}
|
||||
}
|
||||
|
||||
/* end expression2_register_types.hpp */
|
||||
98
xo-expression2/include/xo/expression2/exprtype.hpp
Normal file
98
xo-expression2/include/xo/expression2/exprtype.hpp
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
/** @file exprtype.hpp
|
||||
*
|
||||
* Author: Roland Conybeare
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <ostream>
|
||||
//#include <cstdint>
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
/** @enum exprtype
|
||||
* @brief enum to identify subclasses of xo::scm::Expression.
|
||||
*
|
||||
**/
|
||||
enum class exprtype {
|
||||
/** sentinel value **/
|
||||
invalid = -1,
|
||||
|
||||
/** literal constant. must satisfy both standard_layout_type + trivial **/
|
||||
constant,
|
||||
#ifdef NOT_YET
|
||||
/** a literal constant that refers to a linkable named function **/
|
||||
primitive,
|
||||
#endif
|
||||
/** variable/function definition **/
|
||||
define,
|
||||
#ifdef NOT_YET
|
||||
/** variable assignment **/
|
||||
assign,
|
||||
#endif
|
||||
/** function call **/
|
||||
apply,
|
||||
|
||||
/** function definition **/
|
||||
lambda,
|
||||
|
||||
/** variable definition **/
|
||||
variable,
|
||||
/** variabele reference (possibly non-local) **/
|
||||
varref,
|
||||
/** if-then-else **/
|
||||
ifexpr,
|
||||
/** sequence **/
|
||||
sequence,
|
||||
#ifdef NOT_YET
|
||||
) /** type conversion **/
|
||||
convert,
|
||||
#endif
|
||||
|
||||
/** not an expression. comes last, counts entries **/
|
||||
N
|
||||
};
|
||||
|
||||
inline const char *
|
||||
expr2str(exprtype x)
|
||||
{
|
||||
switch(x) {
|
||||
case exprtype::invalid: return "?exprtype";
|
||||
case exprtype::constant: return "constant";
|
||||
#ifdef NOT_YET
|
||||
case exprtype::primitive: return "primitive";
|
||||
#endif
|
||||
case exprtype::define: return "define";
|
||||
#ifdef NOT_YET
|
||||
case exprtype::assign: return "assign";
|
||||
#endif
|
||||
case exprtype::apply: return "apply";
|
||||
case exprtype::lambda: return "lambda";
|
||||
case exprtype::variable: return "variable";
|
||||
case exprtype::varref: return "varref";
|
||||
case exprtype::ifexpr: return "if_expr";
|
||||
case exprtype::sequence: return "sequence";
|
||||
#ifdef NOT_YET
|
||||
case exprtype::convert: return "convert";
|
||||
#endif
|
||||
case exprtype::N: break;
|
||||
//default: break;
|
||||
}
|
||||
|
||||
return "???exprtype???";
|
||||
}
|
||||
|
||||
/** @brief number of built-in expression types, repr convenient for array sizing **/
|
||||
static constexpr std::size_t n_exprtype = static_cast<std::size_t>(exprtype::N);
|
||||
|
||||
inline std::ostream &
|
||||
operator<<(std::ostream & os,
|
||||
exprtype x)
|
||||
{
|
||||
os << expr2str(x);
|
||||
return os;
|
||||
}
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end exprtype.hpp */
|
||||
21
xo-expression2/include/xo/expression2/init_expression2.hpp
Normal file
21
xo-expression2/include/xo/expression2/init_expression2.hpp
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
/** @file init_expression2.hpp
|
||||
*
|
||||
* @author Roland Conybeare, Jan 2026
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <xo/subsys/Subsystem.hpp>
|
||||
|
||||
namespace xo {
|
||||
/* tag to represent the xo-expression2/ subsystem within ordered initialization */
|
||||
enum S_expression2_tag {};
|
||||
|
||||
template <>
|
||||
struct InitSubsys<S_expression2_tag> {
|
||||
static void init();
|
||||
static InitEvidence require();
|
||||
};
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end init_expression2.hpp */
|
||||
|
|
@ -0,0 +1,82 @@
|
|||
/** @file ASymbolTable.hpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/SymbolTable.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [abstract_facet.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/SymbolTable.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
// includes (via {facet_includes})
|
||||
#include "Binding.hpp"
|
||||
#include "DUniqueString.hpp"
|
||||
#include <xo/facet/obj.hpp>
|
||||
#include <xo/facet/facet_implementation.hpp>
|
||||
#include <xo/facet/typeseq.hpp>
|
||||
|
||||
// {pretext} here
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
|
||||
using Copaque = const void *;
|
||||
using Opaque = void *;
|
||||
|
||||
/**
|
||||
Map symbols to schematika expressions. Output of schematika parser
|
||||
**/
|
||||
class ASymbolTable {
|
||||
public:
|
||||
/** @defgroup scm-symboltable-type-traits **/
|
||||
///@{
|
||||
// types
|
||||
/** integer identifying a type **/
|
||||
using typeseq = xo::facet::typeseq;
|
||||
using Copaque = const void *;
|
||||
using Opaque = void *;
|
||||
///@}
|
||||
|
||||
/** @defgroup scm-symboltable-methods **/
|
||||
///@{
|
||||
// const methods
|
||||
/** An uninitialized ASymbolTable instance will have zero vtable pointer (per {linux,osx} abi).
|
||||
* Use case for this is narrow. We go to some lengths to avoid null vtable pointers. For example
|
||||
* obj<AFacet> will have non-null vtable (via IFacet_Any) with all methods terminating.
|
||||
**/
|
||||
bool _has_null_vptr() const noexcept { return *reinterpret_cast<const void * const *>(this) == nullptr; }
|
||||
/** RTTI: unique id# for actual runtime data representation **/
|
||||
virtual typeseq _typeseq() const noexcept = 0;
|
||||
/** destroy instance @p d; calls c++ dtor only for actual runtime type; does not recover memory **/
|
||||
virtual void _drop(Opaque d) const noexcept = 0;
|
||||
/** true iff this is toplevel (global) symbol table. **/
|
||||
virtual bool is_global_symtab(Copaque data) const noexcept = 0;
|
||||
/** report ingredients needed to address variable at runtime. **/
|
||||
virtual Binding lookup_binding(Copaque data, const DUniqueString * sym) const noexcept = 0;
|
||||
|
||||
// nonconst methods
|
||||
///@}
|
||||
}; /*ASymbolTable*/
|
||||
|
||||
/** Implementation ISymbolTable_DRepr of ASymbolTable for state DRepr
|
||||
* should provide a specialization:
|
||||
*
|
||||
* template <>
|
||||
* struct xo::facet::FacetImplementation<ASymbolTable, DRepr> {
|
||||
* using Impltype = ISymbolTable_DRepr;
|
||||
* };
|
||||
*
|
||||
* then ISymbolTable_ImplType<DRepr> --> ISymbolTable_DRepr
|
||||
**/
|
||||
template <typename DRepr>
|
||||
using ISymbolTable_ImplType = xo::facet::FacetImplType<ASymbolTable, DRepr>;
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* ASymbolTable.hpp */
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
/** @file IGCObject_DGlobalSymtab.hpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/IGCObject_DGlobalSymtab.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_repr.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/IGCObject_DGlobalSymtab.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "GCObject.hpp"
|
||||
#include <xo/alloc2/GCObject.hpp>
|
||||
#include <xo/alloc2/Allocator.hpp>
|
||||
#include "DGlobalSymtab.hpp"
|
||||
|
||||
namespace xo { namespace scm { class IGCObject_DGlobalSymtab; } }
|
||||
|
||||
namespace xo {
|
||||
namespace facet {
|
||||
template <>
|
||||
struct FacetImplementation<xo::mm::AGCObject,
|
||||
xo::scm::DGlobalSymtab>
|
||||
{
|
||||
using ImplType = xo::mm::IGCObject_Xfer
|
||||
<xo::scm::DGlobalSymtab,
|
||||
xo::scm::IGCObject_DGlobalSymtab>;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
/** @class IGCObject_DGlobalSymtab
|
||||
**/
|
||||
class IGCObject_DGlobalSymtab {
|
||||
public:
|
||||
/** @defgroup scm-gcobject-dglobalsymtab-type-traits **/
|
||||
///@{
|
||||
using size_type = xo::mm::AGCObject::size_type;
|
||||
using AAllocator = xo::mm::AGCObject::AAllocator;
|
||||
using AGCObjectVisitor = xo::mm::AGCObject::AGCObjectVisitor;
|
||||
using VisitReason = xo::mm::AGCObject::VisitReason;
|
||||
using Copaque = xo::mm::AGCObject::Copaque;
|
||||
using Opaque = xo::mm::AGCObject::Opaque;
|
||||
///@}
|
||||
/** @defgroup scm-gcobject-dglobalsymtab-methods **/
|
||||
///@{
|
||||
// const methods
|
||||
|
||||
// non-const methods
|
||||
/** move instance using object visitor.
|
||||
Arguably abusing the word 'visitor' here **/
|
||||
static Opaque gco_shallow_move(DGlobalSymtab & self, obj<AGCObjectVisitor> gc) noexcept;
|
||||
/** Invoke fn.visit_child(iface,data) for each child GCObject pointer.
|
||||
Context: provides address of data pointer so it can be updated in place
|
||||
when @p fn invokes garbage collector reentry point **/
|
||||
static void visit_gco_children(DGlobalSymtab & self, VisitReason reason, obj<AGCObjectVisitor> fn) noexcept;
|
||||
///@}
|
||||
};
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end */
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
/** @file IGCObject_DLocalSymtab.hpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/IGCObject_DLocalSymtab.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_repr.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/IGCObject_DLocalSymtab.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "GCObject.hpp"
|
||||
#include <xo/alloc2/GCObject.hpp>
|
||||
#include <xo/alloc2/Allocator.hpp>
|
||||
#include "DLocalSymtab.hpp"
|
||||
|
||||
namespace xo { namespace scm { class IGCObject_DLocalSymtab; } }
|
||||
|
||||
namespace xo {
|
||||
namespace facet {
|
||||
template <>
|
||||
struct FacetImplementation<xo::mm::AGCObject,
|
||||
xo::scm::DLocalSymtab>
|
||||
{
|
||||
using ImplType = xo::mm::IGCObject_Xfer
|
||||
<xo::scm::DLocalSymtab,
|
||||
xo::scm::IGCObject_DLocalSymtab>;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
/** @class IGCObject_DLocalSymtab
|
||||
**/
|
||||
class IGCObject_DLocalSymtab {
|
||||
public:
|
||||
/** @defgroup scm-gcobject-dlocalsymtab-type-traits **/
|
||||
///@{
|
||||
using size_type = xo::mm::AGCObject::size_type;
|
||||
using AAllocator = xo::mm::AGCObject::AAllocator;
|
||||
using AGCObjectVisitor = xo::mm::AGCObject::AGCObjectVisitor;
|
||||
using VisitReason = xo::mm::AGCObject::VisitReason;
|
||||
using Copaque = xo::mm::AGCObject::Copaque;
|
||||
using Opaque = xo::mm::AGCObject::Opaque;
|
||||
///@}
|
||||
/** @defgroup scm-gcobject-dlocalsymtab-methods **/
|
||||
///@{
|
||||
// const methods
|
||||
|
||||
// non-const methods
|
||||
/** move instance using object visitor.
|
||||
Arguably abusing the word 'visitor' here **/
|
||||
static Opaque gco_shallow_move(DLocalSymtab & self, obj<AGCObjectVisitor> gc) noexcept;
|
||||
/** Invoke fn.visit_child(iface,data) for each child GCObject pointer.
|
||||
Context: provides address of data pointer so it can be updated in place
|
||||
when @p fn invokes garbage collector reentry point **/
|
||||
static void visit_gco_children(DLocalSymtab & self, VisitReason reason, obj<AGCObjectVisitor> fn) noexcept;
|
||||
///@}
|
||||
};
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end */
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
/** @file IPrintable_DGlobalSymtab.hpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/IPrintable_DGlobalSymtab.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_repr.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/IPrintable_DGlobalSymtab.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Printable.hpp"
|
||||
#include <xo/printable2/Printable.hpp>
|
||||
#include <xo/printable2/detail/IPrintable_Xfer.hpp>
|
||||
#include "DGlobalSymtab.hpp"
|
||||
|
||||
namespace xo { namespace scm { class IPrintable_DGlobalSymtab; } }
|
||||
|
||||
namespace xo {
|
||||
namespace facet {
|
||||
template <>
|
||||
struct FacetImplementation<xo::print::APrintable,
|
||||
xo::scm::DGlobalSymtab>
|
||||
{
|
||||
using ImplType = xo::print::IPrintable_Xfer
|
||||
<xo::scm::DGlobalSymtab,
|
||||
xo::scm::IPrintable_DGlobalSymtab>;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
/** @class IPrintable_DGlobalSymtab
|
||||
**/
|
||||
class IPrintable_DGlobalSymtab {
|
||||
public:
|
||||
/** @defgroup scm-printable-dglobalsymtab-type-traits **/
|
||||
///@{
|
||||
using ppindentinfo = xo::print::APrintable::ppindentinfo;
|
||||
using Copaque = xo::print::APrintable::Copaque;
|
||||
using Opaque = xo::print::APrintable::Opaque;
|
||||
///@}
|
||||
/** @defgroup scm-printable-dglobalsymtab-methods **/
|
||||
///@{
|
||||
// const methods
|
||||
/** Pretty-printing support for this object.
|
||||
See [xo-indentlog/xo/indentlog/pretty.hpp] **/
|
||||
static bool pretty(const DGlobalSymtab & self, const ppindentinfo & ppii);
|
||||
|
||||
// non-const methods
|
||||
///@}
|
||||
};
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end */
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
/** @file IPrintable_DLocalSymtab.hpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/IPrintable_DLocalSymtab.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_repr.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/IPrintable_DLocalSymtab.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Printable.hpp"
|
||||
#include <xo/printable2/Printable.hpp>
|
||||
#include <xo/printable2/detail/IPrintable_Xfer.hpp>
|
||||
#include "DLocalSymtab.hpp"
|
||||
|
||||
namespace xo { namespace scm { class IPrintable_DLocalSymtab; } }
|
||||
|
||||
namespace xo {
|
||||
namespace facet {
|
||||
template <>
|
||||
struct FacetImplementation<xo::print::APrintable,
|
||||
xo::scm::DLocalSymtab>
|
||||
{
|
||||
using ImplType = xo::print::IPrintable_Xfer
|
||||
<xo::scm::DLocalSymtab,
|
||||
xo::scm::IPrintable_DLocalSymtab>;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
/** @class IPrintable_DLocalSymtab
|
||||
**/
|
||||
class IPrintable_DLocalSymtab {
|
||||
public:
|
||||
/** @defgroup scm-printable-dlocalsymtab-type-traits **/
|
||||
///@{
|
||||
using ppindentinfo = xo::print::APrintable::ppindentinfo;
|
||||
using Copaque = xo::print::APrintable::Copaque;
|
||||
using Opaque = xo::print::APrintable::Opaque;
|
||||
///@}
|
||||
/** @defgroup scm-printable-dlocalsymtab-methods **/
|
||||
///@{
|
||||
// const methods
|
||||
/** Pretty-printing support for this object.
|
||||
See [xo-indentlog/xo/indentlog/pretty.hpp] **/
|
||||
static bool pretty(const DLocalSymtab & self, const ppindentinfo & ppii);
|
||||
|
||||
// non-const methods
|
||||
///@}
|
||||
};
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end */
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
/** @file ISymbolTable_Any.hpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/SymbolTable.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_any.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/SymbolTable.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "ASymbolTable.hpp"
|
||||
#include <xo/facet/obj.hpp>
|
||||
|
||||
namespace xo { namespace scm { class ISymbolTable_Any; } }
|
||||
|
||||
namespace xo {
|
||||
namespace facet {
|
||||
|
||||
template <>
|
||||
struct FacetImplementation<xo::scm::ASymbolTable,
|
||||
DVariantPlaceholder>
|
||||
{
|
||||
using ImplType = xo::scm::ISymbolTable_Any;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
|
||||
/** @class ISymbolTable_Any
|
||||
* @brief ASymbolTable implementation for empty variant instance
|
||||
**/
|
||||
class ISymbolTable_Any : public ASymbolTable {
|
||||
public:
|
||||
/** @defgroup scm-symboltable-any-type-traits **/
|
||||
///@{
|
||||
|
||||
/** integer identifying a type **/
|
||||
using typeseq = xo::facet::typeseq;
|
||||
|
||||
///@}
|
||||
/** @defgroup scm-symboltable-any-methods **/
|
||||
///@{
|
||||
|
||||
const ASymbolTable * iface() const { return std::launder(this); }
|
||||
|
||||
// from ASymbolTable
|
||||
|
||||
// builtin methods
|
||||
typeseq _typeseq() const noexcept override { return s_typeseq; }
|
||||
[[noreturn]] void _drop(Opaque) const noexcept override { _fatal(); }
|
||||
|
||||
// const methods
|
||||
[[noreturn]] bool is_global_symtab(Copaque) const noexcept override { _fatal(); }
|
||||
[[noreturn]] Binding lookup_binding(Copaque, const DUniqueString *) const noexcept override { _fatal(); }
|
||||
|
||||
// nonconst methods
|
||||
|
||||
///@}
|
||||
|
||||
private:
|
||||
/** @defgraoup scm-symboltable-any-private-methods **/
|
||||
///@{
|
||||
|
||||
[[noreturn]] static void _fatal();
|
||||
|
||||
///@}
|
||||
|
||||
public:
|
||||
/** @defgroup scm-symboltable-any-member-vars **/
|
||||
///@{
|
||||
|
||||
static typeseq s_typeseq;
|
||||
static bool _valid;
|
||||
|
||||
///@}
|
||||
};
|
||||
|
||||
} /*namespace scm */
|
||||
} /*namespace xo */
|
||||
|
||||
/* ISymbolTable_Any.hpp */
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue