mirror of
https://github.com/polserver/polserver
synced 2026-08-13 08:23:08 -04:00
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
This commit is contained in:
parent
599000d467
commit
87e0c534f4
20 changed files with 150 additions and 15 deletions
|
|
@ -0,0 +1,15 @@
|
|||
#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
|
||||
Loading…
Add table
Add a link
Reference in a new issue