From 483ce1598813ebca644dd305495458cbb31a398f Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Mon, 28 Jul 2025 10:13:25 -0400 Subject: [PATCH] refactor xo::ast -> xo::scm + restore nodef ppdetail_atomic build --- xo-expression/example/ex1/ex1.cpp | 6 ++-- xo-expression/include/xo/expression/Apply.hpp | 4 +-- .../include/xo/expression/AssignExpr.hpp | 4 +-- .../include/xo/expression/Constant.hpp | 4 +-- .../xo/expression/ConstantInterface.hpp | 4 +-- .../include/xo/expression/ConvertExpr.hpp | 4 +-- .../include/xo/expression/DefineExpr.hpp | 4 +-- .../include/xo/expression/Environment.hpp | 4 +-- .../include/xo/expression/Expression.hpp | 4 +-- .../xo/expression/FunctionInterface.hpp | 4 +-- .../xo/expression/GeneralizedExpression.hpp | 4 +-- .../include/xo/expression/GlobalEnv.hpp | 4 +-- .../include/xo/expression/IfExpr.hpp | 4 +-- .../include/xo/expression/Lambda.hpp | 4 +-- .../include/xo/expression/LocalEnv.hpp | 4 +-- .../include/xo/expression/Primitive.hpp | 4 +-- .../xo/expression/PrimitiveInterface.hpp | 4 +-- .../include/xo/expression/Sequence.hpp | 4 +-- .../include/xo/expression/Variable.hpp | 4 +-- .../include/xo/expression/binding_path.hpp | 4 +-- .../include/xo/expression/exprtype.hpp | 6 ++-- .../include/xo/expression/llvmintrinsic.hpp | 8 ++--- .../xo/expression/pretty_expression.hpp | 8 ++--- .../include/xo/expression/pretty_localenv.hpp | 10 +++--- .../include/xo/expression/pretty_variable.hpp | 4 +-- xo-expression/src/expression/Apply.cpp | 4 +-- xo-expression/src/expression/AssignExpr.cpp | 4 +-- xo-expression/src/expression/ConvertExpr.cpp | 4 +-- xo-expression/src/expression/DefineExpr.cpp | 4 +-- xo-expression/src/expression/Expression.cpp | 4 +-- .../src/expression/GeneralizedExpression.cpp | 4 +-- xo-expression/src/expression/GlobalEnv.cpp | 4 +-- xo-expression/src/expression/IfExpr.cpp | 4 +-- xo-expression/src/expression/Lambda.cpp | 4 +-- xo-expression/src/expression/LocalEnv.cpp | 4 +-- xo-expression/src/expression/Primitive.cpp | 2 +- xo-expression/src/expression/Sequence.cpp | 2 +- xo-expression/src/expression/Variable.cpp | 6 ++-- .../xo/indentlog/print/ppdetail_atomic.hpp | 4 +-- xo-jit/example/ex1/ex1.cpp | 14 ++++---- xo-jit/example/ex2_jit/ex2_jit.cpp | 14 ++++---- xo-jit/include/xo/jit/MachPipeline.hpp | 28 ++++++++-------- xo-jit/include/xo/jit/activation_record.hpp | 4 +-- xo-jit/include/xo/jit/type2llvm.hpp | 4 +-- xo-jit/src/jit/MachPipeline.cpp | 28 ++++++++-------- xo-jit/src/jit/MachPipeline.new.cpp | 22 ++++++------- xo-jit/src/jit/MachPipeline.orig.cpp | 22 ++++++------- xo-jit/utest/MachPipeline.test.cpp | 14 ++++---- .../src/pyexpression/pyexpression.cpp | 32 +++++++++---------- xo-pyjit/src/pyjit/pyjit.cpp | 8 ++--- xo-reader/examples/exprreplxx/exprreplxx.cpp | 2 +- xo-reader/include/xo/reader/apply_xs.hpp | 4 ++- xo-reader/include/xo/reader/define_xs.hpp | 4 +-- xo-reader/include/xo/reader/envframe.hpp | 6 ++-- xo-reader/include/xo/reader/envframestack.hpp | 4 +-- .../xo/reader/expect_formal_arglist_xs.hpp | 2 +- xo-reader/include/xo/reader/exprstate.hpp | 6 ++-- xo-reader/include/xo/reader/if_else_xs.hpp | 4 ++- xo-reader/include/xo/reader/lambda_xs.hpp | 6 ++-- xo-reader/include/xo/reader/let1_xs.hpp | 2 +- xo-reader/include/xo/reader/parser.hpp | 2 +- xo-reader/include/xo/reader/parser_result.hpp | 2 +- .../include/xo/reader/parserstatemachine.hpp | 6 ++-- xo-reader/include/xo/reader/reader.hpp | 2 +- xo-reader/include/xo/reader/sequence_xs.hpp | 8 ++--- xo-reader/src/reader/envframe.cpp | 2 +- xo-reader/src/reader/envframestack.cpp | 4 +-- xo-reader/src/reader/expect_expr_xs.cpp | 2 +- xo-reader/src/reader/expect_formal_xs.cpp | 2 +- xo-reader/src/reader/exprseq_xs.cpp | 6 ++-- xo-reader/src/reader/exprstate.cpp | 2 +- xo-reader/src/reader/lambda_xs.cpp | 4 +-- xo-reader/src/reader/let1_xs.cpp | 16 +++++----- xo-reader/src/reader/parser.cpp | 4 +-- xo-reader/src/reader/parserstatemachine.cpp | 4 +-- xo-reader/src/reader/progress_xs.cpp | 8 ++--- xo-reader/src/reader/sequence_xs.cpp | 2 +- xo-reader/utest/parser.test.cpp | 2 +- 78 files changed, 243 insertions(+), 237 deletions(-) diff --git a/xo-expression/example/ex1/ex1.cpp b/xo-expression/example/ex1/ex1.cpp index 0c69cab4..470941af 100644 --- a/xo-expression/example/ex1/ex1.cpp +++ b/xo-expression/example/ex1/ex1.cpp @@ -16,9 +16,9 @@ double xo_sqrt(double x) { int main() { - using xo::ast::make_constant; - using xo::ast::make_primitive; - using xo::ast::llvmintrinsic; + using xo::scm::make_constant; + using xo::scm::make_primitive; + using xo::scm::llvmintrinsic; using std::cout; using std::endl; diff --git a/xo-expression/include/xo/expression/Apply.hpp b/xo-expression/include/xo/expression/Apply.hpp index dc961feb..161806fc 100644 --- a/xo-expression/include/xo/expression/Apply.hpp +++ b/xo-expression/include/xo/expression/Apply.hpp @@ -10,7 +10,7 @@ //#include namespace xo { - namespace ast { + namespace scm { /** @class Apply * @brief syntax for a function call. @@ -210,7 +210,7 @@ namespace xo { : Apply(apply_valuetype, fn, argv) {} }; - } /*namespace ast*/ + } /*namespace scm*/ } /*namespace xo*/ diff --git a/xo-expression/include/xo/expression/AssignExpr.hpp b/xo-expression/include/xo/expression/AssignExpr.hpp index 8cc2b7c7..0672e8c2 100644 --- a/xo-expression/include/xo/expression/AssignExpr.hpp +++ b/xo-expression/include/xo/expression/AssignExpr.hpp @@ -9,7 +9,7 @@ #include "Variable.hpp" namespace xo { - namespace ast { + namespace scm { /** @class AssignExpr * @brief Provide expression for assigning to a variable * @@ -55,7 +55,7 @@ namespace xo { /** free variables for this assignment **/ std::set free_var_set_; }; - } /*namespace ast*/ + } /*namespace scm*/ } /*namespace xo*/ diff --git a/xo-expression/include/xo/expression/Constant.hpp b/xo-expression/include/xo/expression/Constant.hpp index 9da00a3a..a302a43b 100644 --- a/xo-expression/include/xo/expression/Constant.hpp +++ b/xo-expression/include/xo/expression/Constant.hpp @@ -10,7 +10,7 @@ #include namespace xo { - namespace ast { + namespace scm { /** @class Constant * @brief syntax for a literal constant. * @@ -104,7 +104,7 @@ namespace xo { return Constant::make(x); } - } /*namespace ast*/ + } /*namespace scm*/ } /*namespace xo*/ /** end Constant.hpp **/ diff --git a/xo-expression/include/xo/expression/ConstantInterface.hpp b/xo-expression/include/xo/expression/ConstantInterface.hpp index 0e4c9580..474f8f3f 100644 --- a/xo-expression/include/xo/expression/ConstantInterface.hpp +++ b/xo-expression/include/xo/expression/ConstantInterface.hpp @@ -11,7 +11,7 @@ #include namespace xo { - namespace ast { + namespace scm { /** @class ConstantInterface * @brief syntax for a literal constant. **/ @@ -44,7 +44,7 @@ namespace xo { }; /*ConstantInterface*/ - } /*namespace ast*/ + } /*namespace scm*/ } /*namespace xo*/ /** end ConstantInterface.hpp **/ diff --git a/xo-expression/include/xo/expression/ConvertExpr.hpp b/xo-expression/include/xo/expression/ConvertExpr.hpp index d8969eb8..9b6808bf 100644 --- a/xo-expression/include/xo/expression/ConvertExpr.hpp +++ b/xo-expression/include/xo/expression/ConvertExpr.hpp @@ -8,7 +8,7 @@ #include "Expression.hpp" namespace xo { - namespace ast { + namespace scm { /** @class Convertexpr * @brief Convenience for automatic type conversion * @@ -103,7 +103,7 @@ namespace xo { std::move(arg)) {} }; - } /*namespace ast*/ + } /*namespace scm*/ } /*namespace xo*/ diff --git a/xo-expression/include/xo/expression/DefineExpr.hpp b/xo-expression/include/xo/expression/DefineExpr.hpp index ce6e84ec..5df7ea1a 100644 --- a/xo-expression/include/xo/expression/DefineExpr.hpp +++ b/xo-expression/include/xo/expression/DefineExpr.hpp @@ -8,7 +8,7 @@ #include "Expression.hpp" namespace xo { - namespace ast { + namespace scm { /** @class DefineExpr * @brief Provide definition for a constant, variable or function * @@ -125,7 +125,7 @@ namespace xo { {} }; - } /*namespace ast*/ + } /*namespace scm*/ } /*namespace xo*/ /* end DefineExpr.hpp */ diff --git a/xo-expression/include/xo/expression/Environment.hpp b/xo-expression/include/xo/expression/Environment.hpp index 92103553..51746d99 100644 --- a/xo-expression/include/xo/expression/Environment.hpp +++ b/xo-expression/include/xo/expression/Environment.hpp @@ -11,7 +11,7 @@ namespace xo { - namespace ast { + namespace scm { class Expression; class Environment : public ref::Refcount { @@ -45,7 +45,7 @@ namespace xo { x.print(os); return os; } - } /*namespace ast*/ + } /*namespace scm*/ } /*namespace xo*/ diff --git a/xo-expression/include/xo/expression/Expression.hpp b/xo-expression/include/xo/expression/Expression.hpp index 3e7b9c67..07ac6afe 100644 --- a/xo-expression/include/xo/expression/Expression.hpp +++ b/xo-expression/include/xo/expression/Expression.hpp @@ -10,7 +10,7 @@ #include namespace xo { - namespace ast { + namespace scm { class Variable; /* see Variable.hpp */ class Lambda; /* see Lamnbda.hpp */ class Environment; /* see Environment.hpp */ @@ -84,7 +84,7 @@ namespace xo { }; /*Expression*/ - } /*namespace ast*/ + } /*namespace scm*/ } /*namespace xo*/ /** end Expression.hpp **/ diff --git a/xo-expression/include/xo/expression/FunctionInterface.hpp b/xo-expression/include/xo/expression/FunctionInterface.hpp index 4b369e00..a568a71d 100644 --- a/xo-expression/include/xo/expression/FunctionInterface.hpp +++ b/xo-expression/include/xo/expression/FunctionInterface.hpp @@ -9,7 +9,7 @@ //#include namespace xo { - namespace ast { + namespace scm { class FunctionInterface : public Expression { public: FunctionInterface(exprtype extype, TypeDescr fn_type) @@ -27,7 +27,7 @@ namespace xo { private: }; /*FunctionInterface*/ - } /*namespace ast*/ + } /*namespace scm*/ } /*namespace xo*/ /** end FunctionInterface.hpp **/ diff --git a/xo-expression/include/xo/expression/GeneralizedExpression.hpp b/xo-expression/include/xo/expression/GeneralizedExpression.hpp index 0c7c2f84..4096aaca 100644 --- a/xo-expression/include/xo/expression/GeneralizedExpression.hpp +++ b/xo-expression/include/xo/expression/GeneralizedExpression.hpp @@ -11,7 +11,7 @@ #include "exprtype.hpp" namespace xo { - namespace ast { + namespace scm { /** @class GeneralizedExpression * @brief abstract syntax tree (non-executable) for schematica * @@ -65,7 +65,7 @@ namespace xo { x.display(os); return os; } - } /*namespace ast*/ + } /*namespace scm*/ } /*namespace xo*/ diff --git a/xo-expression/include/xo/expression/GlobalEnv.hpp b/xo-expression/include/xo/expression/GlobalEnv.hpp index 798c8c76..b9cc026e 100644 --- a/xo-expression/include/xo/expression/GlobalEnv.hpp +++ b/xo-expression/include/xo/expression/GlobalEnv.hpp @@ -10,7 +10,7 @@ #include namespace xo { - namespace ast { + namespace scm { class GlobalEnv : public Environment { public: /** create instance. Probably only need one of these **/ @@ -53,7 +53,7 @@ namespace xo { */ std::map> global_map_; }; - } /*namespace ast*/ + } /*namespace scm*/ } /*namespace xo*/ diff --git a/xo-expression/include/xo/expression/IfExpr.hpp b/xo-expression/include/xo/expression/IfExpr.hpp index 462a049f..b6dd0cc9 100644 --- a/xo-expression/include/xo/expression/IfExpr.hpp +++ b/xo-expression/include/xo/expression/IfExpr.hpp @@ -11,7 +11,7 @@ //#include namespace xo { - namespace ast { + namespace scm { /** @class IfExpr * @brief abstract syntax tree for a function definition * @@ -168,7 +168,7 @@ namespace xo { std::move(when_true), std::move(when_false)) {} }; - } /*namespace ast*/ + } /*namespace scm*/ } /*namespace xo*/ /** end IfExpr.hpp **/ diff --git a/xo-expression/include/xo/expression/Lambda.hpp b/xo-expression/include/xo/expression/Lambda.hpp index 040420bb..0b480d8f 100644 --- a/xo-expression/include/xo/expression/Lambda.hpp +++ b/xo-expression/include/xo/expression/Lambda.hpp @@ -15,7 +15,7 @@ //#include namespace xo { - namespace ast { + namespace scm { /** @class Lambda * @brief abstract syntax tree for a function definition * @@ -237,7 +237,7 @@ namespace xo { }; - } /*namespace ast*/ + } /*namespace scm*/ } /*namespace xo*/ /** end Lambda.hpp **/ diff --git a/xo-expression/include/xo/expression/LocalEnv.hpp b/xo-expression/include/xo/expression/LocalEnv.hpp index 8ae757ea..ea4e7e0a 100644 --- a/xo-expression/include/xo/expression/LocalEnv.hpp +++ b/xo-expression/include/xo/expression/LocalEnv.hpp @@ -10,7 +10,7 @@ #include "xo/reflect/TypeDescr.hpp" namespace xo { - namespace ast { + namespace scm { class Lambda; /** @brief LocalEnv @@ -103,7 +103,7 @@ namespace xo { rp parent_env_; }; - } /*namespace ast*/ + } /*namespace scm*/ } /*namespace xo*/ diff --git a/xo-expression/include/xo/expression/Primitive.hpp b/xo-expression/include/xo/expression/Primitive.hpp index 43b4690c..fbcd201c 100644 --- a/xo-expression/include/xo/expression/Primitive.hpp +++ b/xo-expression/include/xo/expression/Primitive.hpp @@ -19,7 +19,7 @@ extern "C" { }; namespace xo { - namespace ast { + namespace scm { /** @class Primitive * @brief syntax for a constant that refers to a known function. * @@ -245,7 +245,7 @@ namespace xo { /** div2_f64: divide two 64-bit floating-point numbers **/ static rp make_div2_f64(); }; - } /*namespace ast*/ + } /*namespace scm*/ } /*namespace xo*/ diff --git a/xo-expression/include/xo/expression/PrimitiveInterface.hpp b/xo-expression/include/xo/expression/PrimitiveInterface.hpp index b3fb7bd3..2654a535 100644 --- a/xo-expression/include/xo/expression/PrimitiveInterface.hpp +++ b/xo-expression/include/xo/expression/PrimitiveInterface.hpp @@ -12,7 +12,7 @@ #include namespace xo { - namespace ast { + namespace scm { class PrimitiveInterface : public FunctionInterface { public: using void_function_type = void (*)(); @@ -70,7 +70,7 @@ namespace xo { private: }; /*PrimitiveInterface*/ - } /*namespace ast*/ + } /*namespace scm*/ } /*namespace xo*/ diff --git a/xo-expression/include/xo/expression/Sequence.hpp b/xo-expression/include/xo/expression/Sequence.hpp index 6faa0d12..416c0c6c 100644 --- a/xo-expression/include/xo/expression/Sequence.hpp +++ b/xo-expression/include/xo/expression/Sequence.hpp @@ -8,7 +8,7 @@ #include "Expression.hpp" namespace xo { - namespace ast { + namespace scm { class Sequence : public Expression { public: Sequence(const std::vector> & xv) @@ -44,7 +44,7 @@ namespace xo { **/ std::vector> expr_v_; }; - } /*namespace ast*/ + } /*namespace scm*/ } /*namespace xo*/ diff --git a/xo-expression/include/xo/expression/Variable.hpp b/xo-expression/include/xo/expression/Variable.hpp index 2b4d70df..846be5ab 100644 --- a/xo-expression/include/xo/expression/Variable.hpp +++ b/xo-expression/include/xo/expression/Variable.hpp @@ -9,7 +9,7 @@ #include "binding_path.hpp" namespace xo { - namespace ast { + namespace scm { /** @class Variable * @brief syntax for a variable reference @@ -91,7 +91,7 @@ namespace xo { reflect::TypeDescr var_type) { return Variable::make(name, var_type); } - } /*namespace ast*/ + } /*namespace scm*/ } /*namespace xo*/ diff --git a/xo-expression/include/xo/expression/binding_path.hpp b/xo-expression/include/xo/expression/binding_path.hpp index 7aef8c51..61e48e87 100644 --- a/xo-expression/include/xo/expression/binding_path.hpp +++ b/xo-expression/include/xo/expression/binding_path.hpp @@ -6,7 +6,7 @@ #pragma once namespace xo { - namespace ast { + namespace scm { /** @class path * * @brief path from the *use* of a variable to the environment @@ -22,7 +22,7 @@ namespace xo { **/ int j_slot_ = 0; }; /*binding_path*/ - } /*namespace ast*/ + } /*namespace scm*/ } /*namespace xo*/ diff --git a/xo-expression/include/xo/expression/exprtype.hpp b/xo-expression/include/xo/expression/exprtype.hpp index e9b8393c..a32961ee 100644 --- a/xo-expression/include/xo/expression/exprtype.hpp +++ b/xo-expression/include/xo/expression/exprtype.hpp @@ -9,9 +9,9 @@ //#include namespace xo { - namespace ast { + namespace scm { /** @enum exprtype - * @brief enum to identify subclasses of xo::ast::Expression. + * @brief enum to identify subclasses of xo::scm::Expression. * **/ enum class exprtype { @@ -74,7 +74,7 @@ namespace xo { os << expr2str(x); return os; } - } /*namespace ast*/ + } /*namespace scm*/ } /*namespace xo*/ diff --git a/xo-expression/include/xo/expression/llvmintrinsic.hpp b/xo-expression/include/xo/expression/llvmintrinsic.hpp index ede8719a..fcc26734 100644 --- a/xo-expression/include/xo/expression/llvmintrinsic.hpp +++ b/xo-expression/include/xo/expression/llvmintrinsic.hpp @@ -8,20 +8,20 @@ //#include namespace xo { - namespace ast { + namespace scm { /** @enum llvminstrinsic * @brief enum to identify an LLVM instrinsic, e.g. @c IRBuilder::CreateFAdd * * Associate an @c llvminstrinsic with an AST @c Primitive p. * Later, in @c xo::jit::IrPipeline - * - when generating code for @c xo::ast::Apply + * - when generating code for @c xo::scm::Apply * - with *p* is in the function-call position * can use the associated llvm instrinsic instead of generating a function call * @c Primitive::value * * @note llvm will still sometimes need to use * @c Primitive::value (and generate a function call sequence), - * for example when handling an @c xo::ast::Apply instance + * for example when handling an @c xo::scm::Apply instance * where the function position is a computed function. * @endnote * @@ -153,7 +153,7 @@ namespace xo { return "???llvmintrinsic???"; } /*llvmintrinsic2str*/ - } /*namespace ast*/ + } /*namespace scm*/ } /*namespace xo*/ /** end llvmintrinsic.hpp **/ diff --git a/xo-expression/include/xo/expression/pretty_expression.hpp b/xo-expression/include/xo/expression/pretty_expression.hpp index 44045a66..a4e07a84 100644 --- a/xo-expression/include/xo/expression/pretty_expression.hpp +++ b/xo-expression/include/xo/expression/pretty_expression.hpp @@ -12,17 +12,17 @@ namespace xo { namespace print { template<> - struct ppdetail { + struct ppdetail { static bool print_pretty(const ppindentinfo & ppii, - const xo::ast::GeneralizedExpression & x) { + const xo::scm::GeneralizedExpression & x) { return x.pretty_print(ppii); } }; template <> - struct ppdetail { + struct ppdetail { static bool print_pretty(const ppindentinfo & ppii, - const xo::ast::Expression & x) { + const xo::scm::Expression & x) { return x.pretty_print(ppii); } }; diff --git a/xo-expression/include/xo/expression/pretty_localenv.hpp b/xo-expression/include/xo/expression/pretty_localenv.hpp index 83670af8..275ec095 100644 --- a/xo-expression/include/xo/expression/pretty_localenv.hpp +++ b/xo-expression/include/xo/expression/pretty_localenv.hpp @@ -9,20 +9,20 @@ namespace xo { namespace print { template <> - struct ppdetail { - static bool print_pretty(const ppindentinfo & ppii, const xo::ast::LocalEnv & x) { + struct ppdetail { + static bool print_pretty(const ppindentinfo & ppii, const xo::scm::LocalEnv & x) { return x.pretty_print(ppii); } }; template <> - struct ppdetail { - static bool print_pretty(const ppindentinfo & ppii, const xo::ast::LocalEnv* x) { + struct ppdetail { + static bool print_pretty(const ppindentinfo & ppii, const xo::scm::LocalEnv* x) { if (x) { return x->pretty_print(ppii); } else { ppii.pps()->write("write(reflect::type_name()); + ppii.pps()->write(reflect::type_name()); ppii.pps()->write(">"); return ppii.pps()->has_margin(); } diff --git a/xo-expression/include/xo/expression/pretty_variable.hpp b/xo-expression/include/xo/expression/pretty_variable.hpp index 07eb9910..d0440b8e 100644 --- a/xo-expression/include/xo/expression/pretty_variable.hpp +++ b/xo-expression/include/xo/expression/pretty_variable.hpp @@ -11,8 +11,8 @@ namespace xo { namespace print { template <> - struct ppdetail { - static bool print_pretty(const ppindentinfo & ppii, const xo::ast::Expression & x) { + struct ppdetail { + static bool print_pretty(const ppindentinfo & ppii, const xo::scm::Expression & x) { return x.pretty_print(ppii); } }; diff --git a/xo-expression/src/expression/Apply.cpp b/xo-expression/src/expression/Apply.cpp index 86582bdc..91172c63 100644 --- a/xo-expression/src/expression/Apply.cpp +++ b/xo-expression/src/expression/Apply.cpp @@ -9,7 +9,7 @@ #include namespace xo { - namespace ast { + namespace scm { rp Apply::make(const rp & fn, const std::vector> & argv) @@ -196,7 +196,7 @@ namespace xo { #endif } - } /*namespace ast*/ + } /*namespace scm*/ } /*namespace xo*/ diff --git a/xo-expression/src/expression/AssignExpr.cpp b/xo-expression/src/expression/AssignExpr.cpp index 2d07f4e7..26dc7bed 100644 --- a/xo-expression/src/expression/AssignExpr.cpp +++ b/xo-expression/src/expression/AssignExpr.cpp @@ -10,7 +10,7 @@ #include namespace xo { - namespace ast { + namespace scm { rp AssignExpr::make(const rp & lhs, const rp & rhs) @@ -96,7 +96,7 @@ namespace xo { refrtag("lhs", lhs_), refrtag("rhs", rhs_)); } - } /*namespace ast*/ + } /*namespace scm*/ } /*namespace xo*/ diff --git a/xo-expression/src/expression/ConvertExpr.cpp b/xo-expression/src/expression/ConvertExpr.cpp index f09e1eb9..bb3f9099 100644 --- a/xo-expression/src/expression/ConvertExpr.cpp +++ b/xo-expression/src/expression/ConvertExpr.cpp @@ -7,7 +7,7 @@ #include "pretty_expression.hpp" namespace xo { - namespace ast { + namespace scm { rp ConvertExpr::make(TypeDescr dest_type, rp arg) @@ -54,7 +54,7 @@ namespace xo { return new ConvertExprAccess(nullptr /*dest_type*/, nullptr /*arg*/); } - } /*namespace ast*/ + } /*namespace scm*/ } /*namespace xo*/ diff --git a/xo-expression/src/expression/DefineExpr.cpp b/xo-expression/src/expression/DefineExpr.cpp index 0e09d000..093503d8 100644 --- a/xo-expression/src/expression/DefineExpr.cpp +++ b/xo-expression/src/expression/DefineExpr.cpp @@ -9,7 +9,7 @@ #include namespace xo { - namespace ast { + namespace scm { rp DefineExpr::make(std::string lhs_name, rp rhs) @@ -117,7 +117,7 @@ namespace xo { this->free_var_set_ = this->calc_free_variables(); } - } /*namespace ast*/ + } /*namespace scm*/ } /*namespace xo*/ diff --git a/xo-expression/src/expression/Expression.cpp b/xo-expression/src/expression/Expression.cpp index e9f02932..16b31171 100644 --- a/xo-expression/src/expression/Expression.cpp +++ b/xo-expression/src/expression/Expression.cpp @@ -3,8 +3,8 @@ #include "Expression.hpp" namespace xo { - namespace ast { - } /*namespace ast*/ + namespace scm { + } /*namespace scm*/ } /*namespace xo*/ diff --git a/xo-expression/src/expression/GeneralizedExpression.cpp b/xo-expression/src/expression/GeneralizedExpression.cpp index 9365241e..b0aa6faf 100644 --- a/xo-expression/src/expression/GeneralizedExpression.cpp +++ b/xo-expression/src/expression/GeneralizedExpression.cpp @@ -5,7 +5,7 @@ #include namespace xo { - namespace ast { + namespace scm { namespace { using xo::scm::prefix_type; @@ -70,7 +70,7 @@ namespace xo { return ppii.upto() ? pps->scan_no_newline(saved) : true; } #endif - } /*namespace ast*/ + } /*namespace scm*/ } /*namespace xo*/ /* end GeneralizedExpression.cpp */ diff --git a/xo-expression/src/expression/GlobalEnv.cpp b/xo-expression/src/expression/GlobalEnv.cpp index 8ae06f69..23962fd0 100644 --- a/xo-expression/src/expression/GlobalEnv.cpp +++ b/xo-expression/src/expression/GlobalEnv.cpp @@ -8,7 +8,7 @@ #include "Expression.hpp" namespace xo { - namespace ast { + namespace scm { GlobalEnv::GlobalEnv() = default; bp @@ -49,5 +49,5 @@ namespace xo { return false; } } - } /*namespace ast*/ + } /*namespace scm*/ } /*namespace xo*/ diff --git a/xo-expression/src/expression/IfExpr.cpp b/xo-expression/src/expression/IfExpr.cpp index 7027f433..b08fe6e7 100644 --- a/xo-expression/src/expression/IfExpr.cpp +++ b/xo-expression/src/expression/IfExpr.cpp @@ -6,7 +6,7 @@ //#include "xo/indentlog/print/vector.hpp" namespace xo { - namespace ast { + namespace scm { auto IfExpr::check_consistent_valuetype(const rp & when_true, const rp & when_false) -> TypeDescr { @@ -95,7 +95,7 @@ namespace xo { { this->when_false_ = std::move(x); } - } /*namespace ast*/ + } /*namespace scm*/ } /*namespace xo*/ diff --git a/xo-expression/src/expression/Lambda.cpp b/xo-expression/src/expression/Lambda.cpp index cdcbdb27..3988d9c9 100644 --- a/xo-expression/src/expression/Lambda.cpp +++ b/xo-expression/src/expression/Lambda.cpp @@ -17,7 +17,7 @@ namespace xo { using xo::reflect::FunctionTdxInfo; using std::stringstream; - namespace ast { + namespace scm { TypeDescr Lambda::assemble_lambda_td(const std::vector> & argv, TypeDescr return_td) @@ -404,7 +404,7 @@ namespace xo { this->complete_assembly_from_body(); } - } /*namespace ast*/ + } /*namespace scm*/ } /*namespace xo*/ /* end Lambda.cpp */ diff --git a/xo-expression/src/expression/LocalEnv.cpp b/xo-expression/src/expression/LocalEnv.cpp index f0458cbc..d8a15474 100644 --- a/xo-expression/src/expression/LocalEnv.cpp +++ b/xo-expression/src/expression/LocalEnv.cpp @@ -10,7 +10,7 @@ namespace xo { - namespace ast { + namespace scm { rp LocalEnv::make_empty() { return new LocalEnv(std::vector>(), nullptr); @@ -142,7 +142,7 @@ namespace xo { } } - } /*namespace ast*/ + } /*namespace scm*/ } /*namespace xo*/ diff --git a/xo-expression/src/expression/Primitive.cpp b/xo-expression/src/expression/Primitive.cpp index d6657b55..4a69ef8e 100644 --- a/xo-expression/src/expression/Primitive.cpp +++ b/xo-expression/src/expression/Primitive.cpp @@ -84,7 +84,7 @@ extern "C" { } namespace xo { - namespace ast { + namespace scm { auto Primitive_cmp_i64::make_cmp_eq2_i64() -> rp { diff --git a/xo-expression/src/expression/Sequence.cpp b/xo-expression/src/expression/Sequence.cpp index 3153c06e..cce57945 100644 --- a/xo-expression/src/expression/Sequence.cpp +++ b/xo-expression/src/expression/Sequence.cpp @@ -5,7 +5,7 @@ #include namespace xo { - namespace ast { + namespace scm { std::set Sequence::get_free_variables() const { std::set retval; diff --git a/xo-expression/src/expression/Variable.cpp b/xo-expression/src/expression/Variable.cpp index 4ad50357..903321d2 100644 --- a/xo-expression/src/expression/Variable.cpp +++ b/xo-expression/src/expression/Variable.cpp @@ -5,7 +5,7 @@ #include "pretty_expression.hpp" namespace xo { - namespace ast { + namespace scm { std::string Variable::gensym(const std::string & prefix) { static std::size_t s_counter = 0; @@ -46,11 +46,11 @@ namespace xo { */ return ppii.pps()->pretty_struct(ppii, "Variable", refrtag("name", name_), - rtag("type", print::quot(this->valuetype() + rtag("type", print::unq(this->valuetype() ? this->valuetype()->short_name() : "nullptr"))); } - } /*namespace ast*/ + } /*namespace scm*/ } /*namespace xo*/ diff --git a/xo-indentlog/include/xo/indentlog/print/ppdetail_atomic.hpp b/xo-indentlog/include/xo/indentlog/print/ppdetail_atomic.hpp index aa1f469a..dfeaf415 100644 --- a/xo-indentlog/include/xo/indentlog/print/ppdetail_atomic.hpp +++ b/xo-indentlog/include/xo/indentlog/print/ppdetail_atomic.hpp @@ -16,7 +16,7 @@ namespace xo { // Defining this means ppdetail_atomic is not used. // In that case where not explicitly specialized ppdetail will revert to ordinary printing for a type, // instead of giving compile-time error about missing template specialization of ppdetail. -//#define ppdetail_atomic ppdetail +#define ppdetail_atomic ppdetail struct ppindentinfo { ppindentinfo(ppstate * pps, std::uint32_t ci0, std::uint32_t indent_width, bool upto) @@ -127,7 +127,7 @@ namespace xo { using voidptr = void*; PPDETAIL_ATOMIC(voidptr); -#endif +#endif // #ifndef ppdetail_atomic } /*namespace print*/ } /*namespace xo*/ diff --git a/xo-jit/example/ex1/ex1.cpp b/xo-jit/example/ex1/ex1.cpp index f5eb1d1d..cc642dcb 100644 --- a/xo-jit/example/ex1/ex1.cpp +++ b/xo-jit/example/ex1/ex1.cpp @@ -56,18 +56,18 @@ int main() { using xo::scope; using xo::jit::MachPipeline; - using xo::ast::make_constant; - using xo::ast::make_primitive; - using xo::ast::llvmintrinsic; - using xo::ast::make_apply; - using xo::ast::make_var; - using xo::ast::make_lambda; + using xo::scm::make_constant; + using xo::scm::make_primitive; + using xo::scm::llvmintrinsic; + using xo::scm::make_apply; + using xo::scm::make_var; + using xo::scm::make_lambda; using xo::reflect::Reflect; using xo::xtag; using std::cerr; using std::endl; - //using xo::ast::make_constant; + //using xo::scm::make_constant; static llvm::ExitOnError llvm_exit_on_err; diff --git a/xo-jit/example/ex2_jit/ex2_jit.cpp b/xo-jit/example/ex2_jit/ex2_jit.cpp index dc948afb..b0f32643 100644 --- a/xo-jit/example/ex2_jit/ex2_jit.cpp +++ b/xo-jit/example/ex2_jit/ex2_jit.cpp @@ -47,18 +47,18 @@ main() { using xo::scope; using xo::jit::MachPipeline; using xo::jit::activation_record; - using xo::ast::make_constant; - using xo::ast::make_primitive; - using xo::ast::llvmintrinsic; - using xo::ast::make_apply; - using xo::ast::make_var; - using xo::ast::make_lambda; + using xo::scm::make_constant; + using xo::scm::make_primitive; + using xo::scm::llvmintrinsic; + using xo::scm::make_apply; + using xo::scm::make_var; + using xo::scm::make_lambda; using xo::reflect::Reflect; using xo::xtag; using std::cerr; using std::endl; - //using xo::ast::make_constant; + //using xo::scm::make_constant; static llvm::ExitOnError llvm_exit_on_err; diff --git a/xo-jit/include/xo/jit/MachPipeline.hpp b/xo-jit/include/xo/jit/MachPipeline.hpp index 9839ebe3..829bd646 100644 --- a/xo-jit/include/xo/jit/MachPipeline.hpp +++ b/xo-jit/include/xo/jit/MachPipeline.hpp @@ -56,13 +56,13 @@ namespace xo { **/ class MachPipeline : public ref::Refcount { public: - using Expression = xo::ast::Expression; - using Lambda = xo::ast::Lambda; - using GlobalEnv = xo::ast::GlobalEnv; + using Expression = xo::scm::Expression; + using Lambda = xo::scm::Lambda; + using GlobalEnv = xo::scm::GlobalEnv; using TypeDescr = xo::reflect::TypeDescr; using ExecutionSession = llvm::orc::ExecutionSession; using DataLayout = llvm::DataLayout; - //using ConstantInterface = xo::ast::ConstantInterface; + //using ConstantInterface = xo::scm::ConstantInterface; public: /* tracking KaleidoscopeJIT::Create() here.. */ @@ -109,8 +109,8 @@ namespace xo { * @c llvm::Type instances are *immortal* (llvm interns them into opaque global lookup tables) **/ llvm::Type * codegen_type(TypeDescr td); - llvm::Value * codegen_constant(bp expr); - llvm::Function * codegen_primitive(bp expr); + llvm::Value * codegen_constant(bp expr); + llvm::Function * codegen_primitive(bp expr); /** like @ref codegen_primitive , but create wrapper function that accepts (and discards) * environment pointer as first argument. @@ -118,7 +118,7 @@ namespace xo { * Implementation consists of tail call to natural primitive, that skips the unused * environment pointer **/ - llvm::Function * codegen_primitive_wrapper(bp expr, + llvm::Function * codegen_primitive_wrapper(bp expr, llvm::IRBuilder<> & ir_builder); /** Generate closure for invoking a primitive function. @@ -126,17 +126,17 @@ namespace xo { * to support function-pointer-like behavior for a target function * that may resolve to primitive-or-lambda at runtime **/ - llvm::Value * codegen_primitive_closure(bp expr, + llvm::Value * codegen_primitive_closure(bp expr, llvm::IRBuilder<> & ir_builder); - llvm::Value * codegen_apply(bp expr, + llvm::Value * codegen_apply(bp expr, llvm::Value * envptr, llvm::IRBuilder<> & ir_builder); /* NOTE: codegen_lambda() needs to be reentrant too. * for example can have a lambda in apply position. */ - llvm::Function * codegen_lambda_decl(bp expr); - llvm::Function * codegen_lambda_defn(bp expr, llvm::IRBuilder<> & ir_builder); + llvm::Function * codegen_lambda_decl(bp expr); + llvm::Function * codegen_lambda_defn(bp expr, llvm::IRBuilder<> & ir_builder); /** Generate closure for invoking a lambda (user-defined function). * See @ref MachPipeline::codegen_apply for invocation * Same ABI as @ref MachPipeline::codegen_primitive_closure @@ -147,13 +147,13 @@ namespace xo { * @ref MachPipeline::codegen_toplevel and friends are responsible for * assembling and propagating this. **/ - llvm::Value * codegen_lambda_closure(bp lambda, + llvm::Value * codegen_lambda_closure(bp lambda, llvm::Value * envptr, llvm::IRBuilder<> & ir_builder); - llvm::Value * codegen_variable(bp var, + llvm::Value * codegen_variable(bp var, llvm::Value * envptr, llvm::IRBuilder<> & ir_builder); - llvm::Value * codegen_ifexpr(bp ifexpr, + llvm::Value * codegen_ifexpr(bp ifexpr, llvm::Value * envptr, llvm::IRBuilder<> & ir_builder); diff --git a/xo-jit/include/xo/jit/activation_record.hpp b/xo-jit/include/xo/jit/activation_record.hpp index ff59e9bf..ae834986 100644 --- a/xo-jit/include/xo/jit/activation_record.hpp +++ b/xo-jit/include/xo/jit/activation_record.hpp @@ -17,7 +17,7 @@ namespace xo { namespace jit { - /** analagous to xo::ast::binding_path, + /** analagous to xo::scm::binding_path, * but with locations renumbered to include only vars that belong to an explict runtime * environment object; in other words we exclude vars with stack-only storage **/ @@ -119,7 +119,7 @@ namespace xo { **/ class activation_record { public: - using Lambda = xo::ast::Lambda; + using Lambda = xo::scm::Lambda; using TypeDescr = xo::reflect::TypeDescr; public: diff --git a/xo-jit/include/xo/jit/type2llvm.hpp b/xo-jit/include/xo/jit/type2llvm.hpp index f0efc87f..7801309f 100644 --- a/xo-jit/include/xo/jit/type2llvm.hpp +++ b/xo-jit/include/xo/jit/type2llvm.hpp @@ -20,8 +20,8 @@ namespace xo { **/ struct type2llvm { public: - using FunctionInterface = xo::ast::FunctionInterface; - using Lambda = xo::ast::Lambda; + using FunctionInterface = xo::scm::FunctionInterface; + using Lambda = xo::scm::Lambda; using TypeDescr = xo::reflect::TypeDescr; public: diff --git a/xo-jit/src/jit/MachPipeline.cpp b/xo-jit/src/jit/MachPipeline.cpp index 85fcc7e6..462ed4a4 100644 --- a/xo-jit/src/jit/MachPipeline.cpp +++ b/xo-jit/src/jit/MachPipeline.cpp @@ -7,17 +7,17 @@ #include namespace xo { - using xo::ast::exprtype; - using xo::ast::Expression; - using xo::ast::ConstantInterface; - //using xo::ast::FunctionInterface; - using xo::ast::PrimitiveInterface; - using xo::ast::Lambda; - using xo::ast::Variable; - using xo::ast::Apply; - using xo::ast::IfExpr; - using xo::ast::GlobalEnv; - using xo::ast::llvmintrinsic; + using xo::scm::exprtype; + using xo::scm::Expression; + using xo::scm::ConstantInterface; + //using xo::scm::FunctionInterface; + using xo::scm::PrimitiveInterface; + using xo::scm::Lambda; + using xo::scm::Variable; + using xo::scm::Apply; + using xo::scm::IfExpr; + using xo::scm::GlobalEnv; + using xo::scm::llvmintrinsic; using xo::reflect::Reflect; using xo::reflect::StructMember; using xo::reflect::TypeDescr; @@ -369,7 +369,7 @@ namespace xo { } /*codegen_primitive_wrapper*/ llvm::Value * - MachPipeline::codegen_primitive_closure(bp expr, + MachPipeline::codegen_primitive_closure(bp expr, llvm::IRBuilder<> & ir_builder) { constexpr bool c_debug_flag = true; @@ -435,7 +435,7 @@ namespace xo { /* we don't need any special checking here. * already know (from xo-level checking) that pointer has the right type. * - * Specifically, xo::ast::Apply::make() requires the expression in function position + * Specifically, xo::scm::Apply::make() requires the expression in function position * have suitable function type. * * Now: we have an llvm::Value (fn_value) representing the pointer. @@ -1026,7 +1026,7 @@ namespace xo { */ /* WIP. STRATEGY: - * - xo::ast::ClosureExpr (an expression that generates a closure) + * - xo::scm::ClosureExpr (an expression that generates a closure) * closure = {lambda, env} * * - pass 1: diff --git a/xo-jit/src/jit/MachPipeline.new.cpp b/xo-jit/src/jit/MachPipeline.new.cpp index c4faff4a..7a03e4a0 100644 --- a/xo-jit/src/jit/MachPipeline.new.cpp +++ b/xo-jit/src/jit/MachPipeline.new.cpp @@ -4,16 +4,16 @@ #include namespace xo { - using xo::ast::exprtype; - using xo::ast::Expression; - using xo::ast::ConstantInterface; - //using xo::ast::FunctionInterface; - using xo::ast::PrimitiveInterface; - using xo::ast::Lambda; - using xo::ast::Variable; - using xo::ast::Apply; - using xo::ast::IfExpr; - using xo::ast::llvmintrinsic; + using xo::scm::exprtype; + using xo::scm::Expression; + using xo::scm::ConstantInterface; + //using xo::scm::FunctionInterface; + using xo::scm::PrimitiveInterface; + using xo::scm::Lambda; + using xo::scm::Variable; + using xo::scm::Apply; + using xo::scm::IfExpr; + using xo::scm::llvmintrinsic; using xo::reflect::Reflect; using xo::reflect::StructMember; using xo::reflect::TypeDescr; @@ -465,7 +465,7 @@ namespace xo { /* we don't need any special checking here. * already know (from xo-level checking) that pointer has the right type. * - * Specifically, xo::ast::Apply::make() requires the expression in function position + * Specifically, xo::scm::Apply::make() requires the expression in function position * have suitable function type. * * Now: we have an llvm::Value (fn_value) representing the pointer. diff --git a/xo-jit/src/jit/MachPipeline.orig.cpp b/xo-jit/src/jit/MachPipeline.orig.cpp index 69cf0d02..786ca581 100644 --- a/xo-jit/src/jit/MachPipeline.orig.cpp +++ b/xo-jit/src/jit/MachPipeline.orig.cpp @@ -4,16 +4,16 @@ #include namespace xo { - using xo::ast::exprtype; - using xo::ast::Expression; - using xo::ast::ConstantInterface; - //using xo::ast::FunctionInterface; - using xo::ast::PrimitiveInterface; - using xo::ast::Lambda; - using xo::ast::Variable; - using xo::ast::Apply; - using xo::ast::IfExpr; - using xo::ast::llvmintrinsic; + using xo::scm::exprtype; + using xo::scm::Expression; + using xo::scm::ConstantInterface; + //using xo::scm::FunctionInterface; + using xo::scm::PrimitiveInterface; + using xo::scm::Lambda; + using xo::scm::Variable; + using xo::scm::Apply; + using xo::scm::IfExpr; + using xo::scm::llvmintrinsic; using xo::reflect::Reflect; using xo::reflect::StructMember; using xo::reflect::TypeDescr; @@ -465,7 +465,7 @@ namespace xo { /* we don't need any special checking here. * already know (from xo-level checking) that pointer has the right type. * - * Specifically, xo::ast::Apply::make() requires the expression in function position + * Specifically, xo::scm::Apply::make() requires the expression in function position * have suitable function type. * * Now: we have an llvm::Value (fn_value) representing the pointer. diff --git a/xo-jit/utest/MachPipeline.test.cpp b/xo-jit/utest/MachPipeline.test.cpp index 5cf81227..f615427a 100644 --- a/xo-jit/utest/MachPipeline.test.cpp +++ b/xo-jit/utest/MachPipeline.test.cpp @@ -10,13 +10,13 @@ namespace xo { using xo::jit::MachPipeline; - using xo::ast::make_apply; - using xo::ast::make_var; - using xo::ast::make_primitive; - using xo::ast::llvmintrinsic; - using xo::ast::Expression; - using xo::ast::Lambda; - using xo::ast::exprtype; + using xo::scm::make_apply; + using xo::scm::make_var; + using xo::scm::make_primitive; + using xo::scm::llvmintrinsic; + using xo::scm::Expression; + using xo::scm::Lambda; + using xo::scm::exprtype; using xo::reflect::Reflect; using xo::reflect::reflect_struct; using xo::ref::brw; diff --git a/xo-pyexpression/src/pyexpression/pyexpression.cpp b/xo-pyexpression/src/pyexpression/pyexpression.cpp index 8536e34e..dd7dffaf 100644 --- a/xo-pyexpression/src/pyexpression/pyexpression.cpp +++ b/xo-pyexpression/src/pyexpression/pyexpression.cpp @@ -17,21 +17,21 @@ #include namespace xo { - namespace ast { - using xo::ast::exprtype; - using xo::ast::Expression; - using xo::ast::make_apply; - using xo::ast::PrimitiveInterface; - using xo::ast::Primitive; - using xo::ast::make_primitive; - using xo::ast::ConstantInterface; - using xo::ast::Constant; - using xo::ast::Variable; - using xo::ast::make_var; - using xo::ast::Lambda; - using xo::ast::make_lambda; - using xo::ast::IfExpr; - using xo::ast::make_ifexpr; + namespace scm { + using xo::scm::exprtype; + using xo::scm::Expression; + using xo::scm::make_apply; + using xo::scm::PrimitiveInterface; + using xo::scm::Primitive; + using xo::scm::make_primitive; + using xo::scm::ConstantInterface; + using xo::scm::Constant; + using xo::scm::Variable; + using xo::scm::make_var; + using xo::scm::Lambda; + using xo::scm::make_lambda; + using xo::scm::IfExpr; + using xo::scm::make_ifexpr; using xo::reflect::TaggedPtr; using xo::rp; namespace py = pybind11; @@ -188,7 +188,7 @@ namespace xo { m.def("make_ifexpr", &make_ifexpr); } /*pyexpresion*/ - } /*namespace ast*/ + } /*namespace scm*/ } /*namespace xo*/ /* end pyexpression.cpp */ diff --git a/xo-pyjit/src/pyjit/pyjit.cpp b/xo-pyjit/src/pyjit/pyjit.cpp index c83ef36a..7d0e25c1 100644 --- a/xo-pyjit/src/pyjit/pyjit.cpp +++ b/xo-pyjit/src/pyjit/pyjit.cpp @@ -12,9 +12,9 @@ namespace xo { namespace jit { - using xo::ast::Expression; - using xo::ast::make_primitive; - using xo::ast::llvmintrinsic; + using xo::scm::Expression; + using xo::scm::make_primitive; + using xo::scm::llvmintrinsic; using xo::pyutil::pycaller_base; using xo::pyutil::pycaller; using xo::reflect::Reflect; @@ -105,7 +105,7 @@ namespace xo { pycaller_store::s_instance; PYBIND11_MODULE(XO_PYJIT_MODULE_NAME(), m) { - // e.g. for xo::ast::Expression + // e.g. for xo::scm::Expression XO_PYEXPRESSION_IMPORT_MODULE(); // py::module_::import("pyexpression"); m.doc() = "pybind11 plugin for xo-jit"; diff --git a/xo-reader/examples/exprreplxx/exprreplxx.cpp b/xo-reader/examples/exprreplxx/exprreplxx.cpp index 862a1d05..db1f3e1c 100644 --- a/xo-reader/examples/exprreplxx/exprreplxx.cpp +++ b/xo-reader/examples/exprreplxx/exprreplxx.cpp @@ -61,7 +61,7 @@ int main() { using namespace replxx; using namespace xo::scm; - using xo::ast::Expression; + using xo::scm::Expression; using xo::print::ppconfig; using xo::print::ppstate_standalone; using xo::rp; diff --git a/xo-reader/include/xo/reader/apply_xs.hpp b/xo-reader/include/xo/reader/apply_xs.hpp index cf57b9ab..9c4cf99f 100644 --- a/xo-reader/include/xo/reader/apply_xs.hpp +++ b/xo-reader/include/xo/reader/apply_xs.hpp @@ -57,7 +57,7 @@ namespace xo { */ class apply_xs : public exprstate { public: - using Apply = xo::ast::Apply; + using Apply = xo::scm::Apply; public: explicit apply_xs(); @@ -109,7 +109,9 @@ namespace xo { } /*namespace scm */ namespace print { +#ifndef ppdetail_atomic PPDETAIL_ATOMIC(xo::scm::applyexprstatetype); +#endif } } /*namespace xo*/ diff --git a/xo-reader/include/xo/reader/define_xs.hpp b/xo-reader/include/xo/reader/define_xs.hpp index 76e1bcd8..47a4712d 100644 --- a/xo-reader/include/xo/reader/define_xs.hpp +++ b/xo-reader/include/xo/reader/define_xs.hpp @@ -67,8 +67,8 @@ namespace xo { **/ class define_xs : public exprstate { public: - using DefineExprAccess = xo::ast::DefineExprAccess; - using ConvertExprAccess = xo::ast::ConvertExprAccess; + using DefineExprAccess = xo::scm::DefineExprAccess; + using ConvertExprAccess = xo::scm::ConvertExprAccess; public: define_xs(rp def_expr); diff --git a/xo-reader/include/xo/reader/envframe.hpp b/xo-reader/include/xo/reader/envframe.hpp index a949379e..237b1402 100644 --- a/xo-reader/include/xo/reader/envframe.hpp +++ b/xo-reader/include/xo/reader/envframe.hpp @@ -21,9 +21,9 @@ namespace xo { **/ class envframe { public: - using Environment = xo::ast::Environment; - using LocalEnv = xo::ast::LocalEnv; - using Variable = xo::ast::Variable; + using Environment = xo::scm::Environment; + using LocalEnv = xo::scm::LocalEnv; + using Variable = xo::scm::Variable; public: envframe() = default; diff --git a/xo-reader/include/xo/reader/envframestack.hpp b/xo-reader/include/xo/reader/envframestack.hpp index 9e6a1d6f..81de3ec3 100644 --- a/xo-reader/include/xo/reader/envframestack.hpp +++ b/xo-reader/include/xo/reader/envframestack.hpp @@ -14,8 +14,8 @@ namespace xo { **/ class envframestack { public: - using LocalEnv = xo::ast::LocalEnv; - using Variable = xo::ast::Variable; + using LocalEnv = xo::scm::LocalEnv; + using Variable = xo::scm::Variable; using ppstate = xo::print::ppstate; using ppindentinfo = xo::print::ppindentinfo; diff --git a/xo-reader/include/xo/reader/expect_formal_arglist_xs.hpp b/xo-reader/include/xo/reader/expect_formal_arglist_xs.hpp index ee3a7a48..509fe194 100644 --- a/xo-reader/include/xo/reader/expect_formal_arglist_xs.hpp +++ b/xo-reader/include/xo/reader/expect_formal_arglist_xs.hpp @@ -48,7 +48,7 @@ namespace xo { **/ class expect_formal_arglist_xs : public exprstate { public: - using Variable = xo::ast::Variable; + using Variable = xo::scm::Variable; public: expect_formal_arglist_xs(); diff --git a/xo-reader/include/xo/reader/exprstate.hpp b/xo-reader/include/xo/reader/exprstate.hpp index 24e5f6d0..f3b00d51 100644 --- a/xo-reader/include/xo/reader/exprstate.hpp +++ b/xo-reader/include/xo/reader/exprstate.hpp @@ -95,9 +95,9 @@ namespace xo { **/ class exprstate { public: - using Expression = xo::ast::Expression; - using Variable = xo::ast::Variable; - using exprtype = xo::ast::exprtype; + using Expression = xo::scm::Expression; + using Variable = xo::scm::Variable; + using exprtype = xo::scm::exprtype; using token_type = token; using TypeDescr = xo::reflect::TypeDescr; diff --git a/xo-reader/include/xo/reader/if_else_xs.hpp b/xo-reader/include/xo/reader/if_else_xs.hpp index 04efb75c..05ab0c60 100644 --- a/xo-reader/include/xo/reader/if_else_xs.hpp +++ b/xo-reader/include/xo/reader/if_else_xs.hpp @@ -51,7 +51,7 @@ namespace xo { **/ class if_else_xs : public exprstate { public: - using IfExprAccess = xo::ast::IfExprAccess; + using IfExprAccess = xo::scm::IfExprAccess; public: if_else_xs(rp if_expr); @@ -100,7 +100,9 @@ namespace xo { } /*namespace scm*/ namespace print { +#ifndef ppdetail_atomic PPDETAIL_ATOMIC(xo::scm::ifexprstatetype); +#endif } } /*namespace xo*/ diff --git a/xo-reader/include/xo/reader/lambda_xs.hpp b/xo-reader/include/xo/reader/lambda_xs.hpp index b51ac191..91118447 100644 --- a/xo-reader/include/xo/reader/lambda_xs.hpp +++ b/xo-reader/include/xo/reader/lambda_xs.hpp @@ -55,8 +55,8 @@ namespace xo { **/ class lambda_xs : public exprstate { public: - using Environment = xo::ast::Environment; - using LocalEnv = xo::ast::LocalEnv; + using Environment = xo::scm::Environment; + using LocalEnv = xo::scm::LocalEnv; public: lambda_xs(); @@ -111,7 +111,9 @@ namespace xo { } /*namespace scm*/ namespace print { +#ifndef ppdetail_atomic PPDETAIL_ATOMIC(xo::scm::lambdastatetype); +#endif } } /*namespace xo*/ diff --git a/xo-reader/include/xo/reader/let1_xs.hpp b/xo-reader/include/xo/reader/let1_xs.hpp index ca6f237c..3377081f 100644 --- a/xo-reader/include/xo/reader/let1_xs.hpp +++ b/xo-reader/include/xo/reader/let1_xs.hpp @@ -12,7 +12,7 @@ namespace xo { namespace scm { class let1_xs : public exprstate { public: - using LocalEnv = xo::ast::LocalEnv; + using LocalEnv = xo::scm::LocalEnv; public: /** given local definition equivalent to diff --git a/xo-reader/include/xo/reader/parser.hpp b/xo-reader/include/xo/reader/parser.hpp index c45278a1..6f6b459b 100644 --- a/xo-reader/include/xo/reader/parser.hpp +++ b/xo-reader/include/xo/reader/parser.hpp @@ -153,7 +153,7 @@ namespace xo { **/ class parser { public: - using Expression = xo::ast::Expression; + using Expression = xo::scm::Expression; using token_type = exprstate::token_type; // token; public: diff --git a/xo-reader/include/xo/reader/parser_result.hpp b/xo-reader/include/xo/reader/parser_result.hpp index 204a29a6..8ccee992 100644 --- a/xo-reader/include/xo/reader/parser_result.hpp +++ b/xo-reader/include/xo/reader/parser_result.hpp @@ -19,7 +19,7 @@ namespace xo { }; struct parser_result { - using Expression = xo::ast::Expression; + using Expression = xo::scm::Expression; public: parser_result() = default; diff --git a/xo-reader/include/xo/reader/parserstatemachine.hpp b/xo-reader/include/xo/reader/parserstatemachine.hpp index d243bbe2..cecf5c95 100644 --- a/xo-reader/include/xo/reader/parserstatemachine.hpp +++ b/xo-reader/include/xo/reader/parserstatemachine.hpp @@ -22,9 +22,9 @@ namespace xo { **/ class parserstatemachine { public: - using Expression = xo::ast::Expression; - using Variable = xo::ast::Variable; - using LocalEnv = xo::ast::LocalEnv; + using Expression = xo::scm::Expression; + using Variable = xo::scm::Variable; + using LocalEnv = xo::scm::LocalEnv; using token_type = token; public: diff --git a/xo-reader/include/xo/reader/reader.hpp b/xo-reader/include/xo/reader/reader.hpp index 3283065f..69c42885 100644 --- a/xo-reader/include/xo/reader/reader.hpp +++ b/xo-reader/include/xo/reader/reader.hpp @@ -17,7 +17,7 @@ namespace xo { * @brief Result object returned from reader::read_expr **/ struct reader_result { - using Expression = xo::ast::Expression; + using Expression = xo::scm::Expression; using span_type = span; reader_result(rp expr, span_type rem, std::size_t psz, const reader_error & error) diff --git a/xo-reader/include/xo/reader/sequence_xs.hpp b/xo-reader/include/xo/reader/sequence_xs.hpp index 22e9a325..fa648c95 100644 --- a/xo-reader/include/xo/reader/sequence_xs.hpp +++ b/xo-reader/include/xo/reader/sequence_xs.hpp @@ -9,14 +9,14 @@ #include namespace xo { - namespace ast { class Sequence; } - namespace ast { class Lambda; } + namespace scm { class Sequence; } + namespace scm { class Lambda; } namespace scm { class sequence_xs : public exprstate { public: - using Sequence = xo::ast::Sequence; - using Lambda = xo::ast::Lambda; + using Sequence = xo::scm::Sequence; + using Lambda = xo::scm::Lambda; public: /** start parsing a sequence-expr. diff --git a/xo-reader/src/reader/envframe.cpp b/xo-reader/src/reader/envframe.cpp index 3e0e5858..985bc1c6 100644 --- a/xo-reader/src/reader/envframe.cpp +++ b/xo-reader/src/reader/envframe.cpp @@ -7,7 +7,7 @@ #include "xo/indentlog/print/vector.hpp" namespace xo { - using xo::ast::Variable; + using xo::scm::Variable; namespace scm { #ifdef OBSOLETE diff --git a/xo-reader/src/reader/envframestack.cpp b/xo-reader/src/reader/envframestack.cpp index 9db3146a..3dff60da 100644 --- a/xo-reader/src/reader/envframestack.cpp +++ b/xo-reader/src/reader/envframestack.cpp @@ -8,8 +8,8 @@ #include "pretty_localenv.hpp" namespace xo { - using xo::ast::LocalEnv; - using xo::ast::Variable; + using xo::scm::LocalEnv; + using xo::scm::Variable; namespace scm { bp diff --git a/xo-reader/src/reader/expect_expr_xs.cpp b/xo-reader/src/reader/expect_expr_xs.cpp index 37a33bde..5bf7571a 100644 --- a/xo-reader/src/reader/expect_expr_xs.cpp +++ b/xo-reader/src/reader/expect_expr_xs.cpp @@ -17,7 +17,7 @@ #include "xo/expression/pretty_expression.hpp" namespace xo { - using xo::ast::Constant; + using xo::scm::Constant; namespace scm { diff --git a/xo-reader/src/reader/expect_formal_xs.cpp b/xo-reader/src/reader/expect_formal_xs.cpp index 28e19ce4..3bb72dad 100644 --- a/xo-reader/src/reader/expect_formal_xs.cpp +++ b/xo-reader/src/reader/expect_formal_xs.cpp @@ -11,7 +11,7 @@ #include "xo/expression/Variable.hpp" namespace xo { - using xo::ast::Variable; + using xo::scm::Variable; using xo::reflect::TypeDescr; namespace scm{ diff --git a/xo-reader/src/reader/exprseq_xs.cpp b/xo-reader/src/reader/exprseq_xs.cpp index 77c5e696..f58f846d 100644 --- a/xo-reader/src/reader/exprseq_xs.cpp +++ b/xo-reader/src/reader/exprseq_xs.cpp @@ -123,7 +123,7 @@ namespace xo { exprseq_xs::on_bool_token(const token_type & tk, parserstatemachine * p_psm) { - using xo::ast::Constant; + using xo::scm::Constant; constexpr bool c_debug_flag = true; scope log(XO_DEBUG(c_debug_flag)); @@ -150,7 +150,7 @@ namespace xo { exprseq_xs::on_i64_token(const token_type & tk, parserstatemachine * p_psm) { - using xo::ast::Constant; + using xo::scm::Constant; scope log(XO_DEBUG(p_psm->debug_flag())); @@ -176,7 +176,7 @@ namespace xo { exprseq_xs::on_f64_token(const token_type & tk, parserstatemachine * p_psm) { - using xo::ast::Constant; + using xo::scm::Constant; scope log(XO_DEBUG(p_psm->debug_flag())); diff --git a/xo-reader/src/reader/exprstate.cpp b/xo-reader/src/reader/exprstate.cpp index f7d25dcc..cbcc3560 100644 --- a/xo-reader/src/reader/exprstate.cpp +++ b/xo-reader/src/reader/exprstate.cpp @@ -18,7 +18,7 @@ //#include "xo/reflect/Reflect.hpp" namespace xo { - //using xo::ast::Constant; + //using xo::scm::Constant; //using xo::reflect::Reflect; using xo::reflect::TypeDescr; using xo::print::ppindentinfo; diff --git a/xo-reader/src/reader/lambda_xs.cpp b/xo-reader/src/reader/lambda_xs.cpp index e1dfe722..c2a2ea0f 100644 --- a/xo-reader/src/reader/lambda_xs.cpp +++ b/xo-reader/src/reader/lambda_xs.cpp @@ -10,8 +10,8 @@ #include "xo/expression/Lambda.hpp" namespace xo { - using xo::ast::Lambda; - using xo::ast::LocalEnv; + using xo::scm::Lambda; + using xo::scm::LocalEnv; namespace scm { const char * diff --git a/xo-reader/src/reader/let1_xs.cpp b/xo-reader/src/reader/let1_xs.cpp index 1a2c444e..619d677c 100644 --- a/xo-reader/src/reader/let1_xs.cpp +++ b/xo-reader/src/reader/let1_xs.cpp @@ -12,14 +12,14 @@ #include "xo/expression/Lambda.hpp" namespace xo { - using Sequence = xo::ast::Sequence; - using DefineExpr = xo::ast::DefineExpr; - using Apply = xo::ast::Apply; - using Lambda = xo::ast::Lambda; - using LambdaAccess = xo::ast::LambdaAccess; - using Environment = xo::ast::Environment; - using LocalEnv = xo::ast::LocalEnv; - using Variable = xo::ast::Variable; + using Sequence = xo::scm::Sequence; + using DefineExpr = xo::scm::DefineExpr; + using Apply = xo::scm::Apply; + using Lambda = xo::scm::Lambda; + using LambdaAccess = xo::scm::LambdaAccess; + using Environment = xo::scm::Environment; + using LocalEnv = xo::scm::LocalEnv; + using Variable = xo::scm::Variable; namespace scm { std::unique_ptr diff --git a/xo-reader/src/reader/parser.cpp b/xo-reader/src/reader/parser.cpp index fe55aa5f..e06eb4d0 100644 --- a/xo-reader/src/reader/parser.cpp +++ b/xo-reader/src/reader/parser.cpp @@ -17,8 +17,8 @@ #include namespace xo { - using xo::ast::Expression; - using xo::ast::LocalEnv; + using xo::scm::Expression; + using xo::scm::LocalEnv; using xo::reflect::TypeDescr; namespace scm { diff --git a/xo-reader/src/reader/parserstatemachine.cpp b/xo-reader/src/reader/parserstatemachine.cpp index 90c2d079..a7c97f79 100644 --- a/xo-reader/src/reader/parserstatemachine.cpp +++ b/xo-reader/src/reader/parserstatemachine.cpp @@ -11,8 +11,8 @@ #include "xo/expression/pretty_expression.hpp" namespace xo { - using xo::ast::LocalEnv; - using xo::ast::Variable; + using xo::scm::LocalEnv; + using xo::scm::Variable; namespace scm { bp diff --git a/xo-reader/src/reader/progress_xs.cpp b/xo-reader/src/reader/progress_xs.cpp index 2c94733a..e7047945 100644 --- a/xo-reader/src/reader/progress_xs.cpp +++ b/xo-reader/src/reader/progress_xs.cpp @@ -11,10 +11,10 @@ #include "xo/expression/pretty_expression.hpp" namespace xo { - using xo::ast::Expression; - using xo::ast::AssignExpr; - using xo::ast::Variable; - using xo::ast::Apply; + using xo::scm::Expression; + using xo::scm::AssignExpr; + using xo::scm::Variable; + using xo::scm::Apply; namespace scm { const char * diff --git a/xo-reader/src/reader/sequence_xs.cpp b/xo-reader/src/reader/sequence_xs.cpp index 0d5b51ab..aa41c387 100644 --- a/xo-reader/src/reader/sequence_xs.cpp +++ b/xo-reader/src/reader/sequence_xs.cpp @@ -9,7 +9,7 @@ #include "xo/expression/pretty_expression.hpp" namespace xo { - using xo::ast::DefineExpr; + using xo::scm::DefineExpr; namespace scm { std::unique_ptr diff --git a/xo-reader/utest/parser.test.cpp b/xo-reader/utest/parser.test.cpp index 18b52723..004b8497 100644 --- a/xo-reader/utest/parser.test.cpp +++ b/xo-reader/utest/parser.test.cpp @@ -16,7 +16,7 @@ namespace xo { using std::cerr; using std::endl; - //using xo::ast::Expression; + //using xo::scm::Expression; namespace ut { TEST_CASE("parser", "[parser]") {