5#include "slang/ast/ASTVisitor.h"
6#include "slang/text/FormatBuffer.h"
12 :
public ast::ASTVisitor<ReportVariables, ast::VisitFlags::Expressions |
13 ast::VisitFlags::Canonical> {
16 SourceLocation location;
19 ast::Compilation &compilation;
20 std::vector<VariableInfo> variables;
24 : compilation(compilation) {}
31 for (
auto var : variables) {
39 void handle(
const ast::VariableSymbol &symbol) {
40 auto variable = VariableInfo{.name = symbol.getHierarchicalPath(),
41 .location = symbol.location};
42 variables.push_back(variable);
void handle(const ast::VariableSymbol &symbol)
Definition ReportVariables.hpp:39
void report(FormatBuffer &buffer)
Renders the collected variable information to the given format buffer.
Definition ReportVariables.hpp:27
ReportVariables(ast::Compilation &compilation)
Definition ReportVariables.hpp:23
Definition ReportDrivers.hpp:13
std::vector< Row > Table
Definition Utilities.hpp:33
static auto locationStr(ast::Compilation const &compilation, SourceLocation location)
Return a string representation of a slang SourceLocation.
Definition Utilities.hpp:21
static auto formatTable(FormatBuffer &buffer, const Row &header, const Table &rows, TableFormatConfig cfg={})
Format a table of data into the given format buffer.
Definition Utilities.hpp:44
std::vector< std::string > Row
Definition Utilities.hpp:32