pretty printing -- copmlete for xo::ast::GeneralizedExpression
This commit is contained in:
parent
96aa415920
commit
2e0846823b
67 changed files with 1230 additions and 478 deletions
44
xo-reader/src/reader/pretty_parserstatemachine.cpp
Normal file
44
xo-reader/src/reader/pretty_parserstatemachine.cpp
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
/* file pretty_parserstatemachine.cpp
|
||||
*
|
||||
* author: Roland Conybeare, Jul 2025
|
||||
*/
|
||||
|
||||
#include "pretty_parserstatemachine.hpp"
|
||||
#include "pretty_exprstatestack.hpp"
|
||||
#include "pretty_envframestack.hpp"
|
||||
#include "exprstatestack.hpp"
|
||||
|
||||
namespace xo {
|
||||
namespace print {
|
||||
bool
|
||||
ppdetail<xo::scm::parserstatemachine>::print_pretty(const ppindentinfo & ppii, const xo::scm::parserstatemachine & x)
|
||||
{
|
||||
ppstate * pps = ppii.pps();
|
||||
|
||||
if (ppii.upto()) {
|
||||
if (!pps->print_upto("<psm"))
|
||||
return false;
|
||||
|
||||
if (!pps->print_upto_tag("stack", x.p_stack_))
|
||||
return false;
|
||||
|
||||
if (!pps->print_upto_tag("env_stack", x.p_env_stack_))
|
||||
return false;
|
||||
|
||||
if (!pps->print_upto_tag("emit_expr", (void*)x.p_emit_expr_))
|
||||
return false;
|
||||
|
||||
return pps->print_upto(">");
|
||||
} else {
|
||||
pps->write("<psm");
|
||||
pps->newline_pretty_tag(ppii.ci1(), "stack", x.p_stack_);
|
||||
pps->newline_pretty_tag(ppii.ci1(), "env_stack", x.p_env_stack_);
|
||||
pps->newline_pretty_tag(ppii.ci1(), "emit_expr", (void*)x.p_emit_expr_);
|
||||
pps->write(">");
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
} /*namespace print*/
|
||||
} /*namespace xo*/
|
||||
Loading…
Add table
Add a link
Reference in a new issue