refactor xo::ast -> xo::scm + restore nodef ppdetail_atomic build

This commit is contained in:
Roland Conybeare 2025-07-28 10:13:25 -04:00
commit 686ceffe5c
38 changed files with 84 additions and 84 deletions

View file

@ -10,7 +10,7 @@
//#include <cstdint>
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*/

View file

@ -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<std::string> free_var_set_;
};
} /*namespace ast*/
} /*namespace scm*/
} /*namespace xo*/

View file

@ -10,7 +10,7 @@
#include <type_traits>
namespace xo {
namespace ast {
namespace scm {
/** @class Constant
* @brief syntax for a literal constant.
*
@ -104,7 +104,7 @@ namespace xo {
return Constant<T>::make(x);
}
} /*namespace ast*/
} /*namespace scm*/
} /*namespace xo*/
/** end Constant.hpp **/

View file

@ -11,7 +11,7 @@
#include <type_traits>
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 **/

View file

@ -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*/

View file

@ -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 */

View file

@ -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*/

View file

@ -10,7 +10,7 @@
#include <set>
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 **/

View file

@ -9,7 +9,7 @@
//#include <cstdint>
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 **/

View file

@ -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*/

View file

@ -10,7 +10,7 @@
#include <string>
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<std::string, rp<Expression>> global_map_;
};
} /*namespace ast*/
} /*namespace scm*/
} /*namespace xo*/

View file

@ -11,7 +11,7 @@
//#include <cstdint>
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 **/

View file

@ -15,7 +15,7 @@
//#include <cstdint>
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 **/

View file

@ -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<Environment> parent_env_;
};
} /*namespace ast*/
} /*namespace scm*/
} /*namespace xo*/

View file

@ -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<PrimitiveType> make_div2_f64();
};
} /*namespace ast*/
} /*namespace scm*/
} /*namespace xo*/

View file

@ -12,7 +12,7 @@
#include <type_traits>
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*/

View file

@ -8,7 +8,7 @@
#include "Expression.hpp"
namespace xo {
namespace ast {
namespace scm {
class Sequence : public Expression {
public:
Sequence(const std::vector<rp<Expression>> & xv)
@ -44,7 +44,7 @@ namespace xo {
**/
std::vector<rp<Expression>> expr_v_;
};
} /*namespace ast*/
} /*namespace scm*/
} /*namespace xo*/

View file

@ -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*/

View file

@ -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*/

View file

@ -9,9 +9,9 @@
//#include <cstdint>
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*/

View file

@ -8,20 +8,20 @@
//#include <cstdint>
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 **/

View file

@ -12,17 +12,17 @@
namespace xo {
namespace print {
template<>
struct ppdetail<xo::ast::GeneralizedExpression> {
struct ppdetail<xo::scm::GeneralizedExpression> {
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<xo::ast::Expression> {
struct ppdetail<xo::scm::Expression> {
static bool print_pretty(const ppindentinfo & ppii,
const xo::ast::Expression & x) {
const xo::scm::Expression & x) {
return x.pretty_print(ppii);
}
};

View file

@ -9,20 +9,20 @@
namespace xo {
namespace print {
template <>
struct ppdetail<xo::ast::LocalEnv> {
static bool print_pretty(const ppindentinfo & ppii, const xo::ast::LocalEnv & x) {
struct ppdetail<xo::scm::LocalEnv> {
static bool print_pretty(const ppindentinfo & ppii, const xo::scm::LocalEnv & x) {
return x.pretty_print(ppii);
}
};
template <>
struct ppdetail<xo::ast::LocalEnv*> {
static bool print_pretty(const ppindentinfo & ppii, const xo::ast::LocalEnv* x) {
struct ppdetail<xo::scm::LocalEnv*> {
static bool print_pretty(const ppindentinfo & ppii, const xo::scm::LocalEnv* x) {
if (x) {
return x->pretty_print(ppii);
} else {
ppii.pps()->write("<nullptr ");
ppii.pps()->write(reflect::type_name<xo::ast::LocalEnv>());
ppii.pps()->write(reflect::type_name<xo::scm::LocalEnv>());
ppii.pps()->write(">");
return ppii.pps()->has_margin();
}

View file

@ -11,8 +11,8 @@
namespace xo {
namespace print {
template <>
struct ppdetail<xo::ast::Variable> {
static bool print_pretty(const ppindentinfo & ppii, const xo::ast::Expression & x) {
struct ppdetail<xo::scm::Variable> {
static bool print_pretty(const ppindentinfo & ppii, const xo::scm::Expression & x) {
return x.pretty_print(ppii);
}
};