xo-reader: misc bugfixes + logging [wip, utests not passing]

This commit is contained in:
Roland Conybeare 2024-08-28 00:38:05 -04:00
commit ac4ee7d6b8
14 changed files with 175 additions and 17 deletions

View file

@ -21,6 +21,7 @@ namespace xo {
public:
using Expression = xo::ast::Expression;
using Variable = xo::ast::Variable;
using token_type = token<char>;
public:
parserstatemachine(exprstatestack * p_stack,
@ -42,6 +43,18 @@ namespace xo {
void push_envframe(envframe x);
void pop_envframe();
// ----- parsing outputs -----
void on_symbol(const std::string & symbol);
// ---- parsing inputs -----
void on_leftbrace_token(const token_type & tk);
void on_rightbrace_token(const token_type & tk);
/** write human-readable representation on @p os **/
void print(std::ostream & os) const;
public:
/** stack of incomplete parser work.
* generally speaking, push when to start new work for nested content;
@ -55,6 +68,12 @@ namespace xo {
**/
rp<Expression> * p_emit_expr_;
};
inline std::ostream &
operator<<(std::ostream & os, const parserstatemachine & x) {
x.print(os);
return os;
}
} /*namespace scm*/
} /*namespace xo*/