5#include "slang/ast/ASTVisitor.h"
6#include "slang/text/FormatBuffer.h"
12 :
public ast::ASTVisitor<ReportPorts, ast::VisitFlags::Expressions |
13 ast::VisitFlags::Canonical> {
16 ast::ArgumentDirection direction;
17 SourceLocation location;
20 ast::Compilation &compilation;
21 std::vector<PortInfo> ports;
25 : compilation(compilation) {}
31 for (
auto port : ports) {
34 std::string(toString(port.direction)), port.name, loc});
39 void handle(
const ast::PortSymbol &symbol) {
41 .name = symbol.getHierarchicalPath(),
42 .direction = symbol.direction,
43 .location = symbol.location,
45 ports.push_back(port);
ReportPorts(ast::Compilation &compilation)
Definition ReportPorts.hpp:24
void report(FormatBuffer &buffer)
Renders the collected variable information to the given format buffer.
Definition ReportPorts.hpp:28
void handle(const ast::PortSymbol &symbol)
Definition ReportPorts.hpp:39
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