polserver/pol-core/bscript/compiler/codegen/AbstractSyntaxTreeStringGenerator.cpp
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

15 lines
No EOL
472 B
C++

#include "AbstractSyntaxTreeStringGenerator.h"
#include "bscript/compiler/ast/Node.h"
#include "bscript/compiler/file/SourceFileIdentifier.h"
namespace Pol::Bscript::Compiler
{
AbstractSyntaxTreeStringGenerator::AbstractSyntaxTreeStringGenerator() {}
void AbstractSyntaxTreeStringGenerator::visit_children( Node& parent )
{
if ( parent.source_location.source_file_identifier->index == 0 )
_tree += parent.to_string_tree();
}
} // namespace Pol::Bscript::Compiler