polserver/pol-core/bscript/compiler/codegen/AbstractSyntaxTreeStringGenerator.h
Kevin Eady 87e0c534f4
Add ecompile flag -Z to print AST (#796)
* Add -Z option to print string tree

* Simple test to print an AST

* Make CompiledScript owner of the tree

* some refactoring
- rename ecompile.cfg option
- rename AST generator class

* core-changes, docs

* fix warnings
2025-07-23 23:00:34 +02:00

22 lines
401 B
C++

#pragma once
#include "bscript/compiler/ast/NodeVisitor.h"
#include <string>
namespace Pol::Bscript::Compiler
{
class AbstractSyntaxTreeStringGenerator : public NodeVisitor
{
public:
AbstractSyntaxTreeStringGenerator();
void visit_children( Node& parent ) override;
const std::string& tree() const { return _tree; }
private:
std::string _tree;
};
} // namespace Pol::Bscript::Compiler