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 3c0dffe019
28 changed files with 62 additions and 56 deletions

View file

@ -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;

View file

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

View file

@ -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<DefineExprAccess> def_expr);

View file

@ -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;

View file

@ -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;

View file

@ -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();

View file

@ -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<char>;
using TypeDescr = xo::reflect::TypeDescr;

View file

@ -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<IfExprAccess> if_expr);
@ -100,7 +100,9 @@ namespace xo {
} /*namespace scm*/
namespace print {
#ifndef ppdetail_atomic
PPDETAIL_ATOMIC(xo::scm::ifexprstatetype);
#endif
}
} /*namespace xo*/

View file

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

View file

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

View file

@ -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<char>;
public:

View file

@ -19,7 +19,7 @@ namespace xo {
};
struct parser_result {
using Expression = xo::ast::Expression;
using Expression = xo::scm::Expression;
public:
parser_result() = default;

View file

@ -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<char>;
public:

View file

@ -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<const char>;
reader_result(rp<Expression> expr, span_type rem, std::size_t psz, const reader_error & error)

View file

@ -9,14 +9,14 @@
#include <vector>
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.

View file

@ -7,7 +7,7 @@
#include "xo/indentlog/print/vector.hpp"
namespace xo {
using xo::ast::Variable;
using xo::scm::Variable;
namespace scm {
#ifdef OBSOLETE

View file

@ -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<LocalEnv>

View file

@ -17,7 +17,7 @@
#include "xo/expression/pretty_expression.hpp"
namespace xo {
using xo::ast::Constant;
using xo::scm::Constant;
namespace scm {

View file

@ -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{

View file

@ -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()));

View file

@ -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;

View file

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

View file

@ -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<let1_xs>

View file

@ -17,8 +17,8 @@
#include <stdexcept>
namespace xo {
using xo::ast::Expression;
using xo::ast::LocalEnv;
using xo::scm::Expression;
using xo::scm::LocalEnv;
using xo::reflect::TypeDescr;
namespace scm {

View file

@ -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<Variable>

View file

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

View file

@ -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<sequence_xs>

View file

@ -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]") {