xo-reader: ++ logging
This commit is contained in:
parent
84e6d3f347
commit
c46c0f1cc4
6 changed files with 43 additions and 3 deletions
|
|
@ -52,6 +52,7 @@ namespace xo {
|
|||
// ---- parsing inputs -----
|
||||
|
||||
void on_semicolon_token(const token_type & tk);
|
||||
void on_operator_token(const token_type & tk);
|
||||
void on_leftbrace_token(const token_type & tk);
|
||||
void on_rightbrace_token(const token_type & tk);
|
||||
|
||||
|
|
|
|||
|
|
@ -55,10 +55,14 @@ namespace xo {
|
|||
expect_expr_xs::on_def_token(const token_type & tk,
|
||||
parserstatemachine * p_psm)
|
||||
{
|
||||
if (allow_defs_)
|
||||
constexpr bool c_debug_flag = true;
|
||||
scope log(XO_DEBUG(c_debug_flag));
|
||||
|
||||
if (allow_defs_) {
|
||||
define_xs::start(p_psm);
|
||||
else
|
||||
} else {
|
||||
exprstate::on_def_token(tk, p_psm);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -101,6 +105,9 @@ namespace xo {
|
|||
expect_expr_xs::on_rightbrace_token(const token_type & tk,
|
||||
parserstatemachine * p_psm)
|
||||
{
|
||||
constexpr bool c_debug_flag = true;
|
||||
scope log(XO_DEBUG(c_debug_flag));
|
||||
|
||||
if (cxl_on_rightbrace_) {
|
||||
auto self = p_psm->pop_exprstate();
|
||||
|
||||
|
|
@ -116,7 +123,10 @@ namespace xo {
|
|||
expect_expr_xs::on_symbol_token(const token_type & tk,
|
||||
parserstatemachine * p_psm)
|
||||
{
|
||||
/* todo: treat symbol as variable name */
|
||||
constexpr bool c_debug_flag = true;
|
||||
scope log(XO_DEBUG(c_debug_flag));
|
||||
|
||||
log && log(xtag("tk", tk));
|
||||
|
||||
/* various possibilities when looking for rhs expression:
|
||||
*
|
||||
|
|
|
|||
|
|
@ -28,6 +28,11 @@ namespace xo {
|
|||
expect_symbol_xs::on_symbol_token(const token_type & tk,
|
||||
parserstatemachine * p_psm)
|
||||
{
|
||||
constexpr bool c_debug_flag = true;
|
||||
scope log(XO_DEBUG(c_debug_flag));
|
||||
|
||||
log && log(xtag("tk", tk));
|
||||
|
||||
/* have to do pop first, before sending symbol to
|
||||
* the o.g. symbol-requester
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -394,9 +394,17 @@ namespace xo {
|
|||
constexpr bool c_debug_flag = true;
|
||||
scope log(XO_DEBUG(c_debug_flag));
|
||||
|
||||
const char * c_self_name = "exprstate::on_expr_with_semicolon";
|
||||
|
||||
log && log(xtag("exstype", this->exs_type_),
|
||||
xtag("expr", expr));
|
||||
|
||||
throw std::runtime_error
|
||||
(tostr(c_self_name,
|
||||
": unexpected expression for parsing state",
|
||||
xtag("expr", expr),
|
||||
xtag("state", *this)));
|
||||
|
||||
assert(false);
|
||||
} /*on_expr_with_semicolon*/
|
||||
|
||||
|
|
|
|||
|
|
@ -100,6 +100,19 @@ namespace xo {
|
|||
->top_exprstate().on_semicolon_token(tk, this);
|
||||
}
|
||||
|
||||
void
|
||||
parserstatemachine::on_operator_token(const token_type & tk)
|
||||
{
|
||||
constexpr bool c_debug_flag = true;
|
||||
scope log(XO_DEBUG(c_debug_flag));
|
||||
|
||||
log && log(xtag("tk", tk),
|
||||
xtag("psm", *this));
|
||||
|
||||
this->p_stack_
|
||||
->top_exprstate().on_operator_token(tk, this);
|
||||
}
|
||||
|
||||
void
|
||||
parserstatemachine::on_leftbrace_token(const token_type & tk)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -332,6 +332,9 @@ namespace xo {
|
|||
progress_xs::on_operator_token(const token_type & tk,
|
||||
parserstatemachine * p_psm)
|
||||
{
|
||||
constexpr bool c_debug_flag = true;
|
||||
scope log(XO_DEBUG(c_debug_flag));
|
||||
|
||||
constexpr const char * c_self_name = "progress_xs::on_operator_token";
|
||||
|
||||
if (op_type_ == optype::invalid) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue