BashSpark
Loading...
Searching...
No Matches
bs::shell_node_visitor_json Class Referencefinal

Visitor that converts shell nodes into JSON. More...

#include <shell_node_visitor_json.h>

Inheritance diagram for bs::shell_node_visitor_json:
Collaboration diagram for bs::shell_node_visitor_json:

Public Member Functions

nlohmann::basic_json< nlohmann::ordered_map > visit_node (shell_session &oSession, const shell_node *pRawNode) override
 Visit a generic shell node and return its JSON representation.
 

Additional Inherited Members

- Public Types inherited from bs::shell_node_visitor< nlohmann::ordered_json >
using visit_type = nlohmann::ordered_json
 Type of data resulting of visit.
 
Visit functions for each concrete shell node type.

Implement these in derived classes.

Detailed Description

Visitor that converts shell nodes into JSON.

This visitor traverses the shell AST (shell_node hierarchy) and produces a nlohmann::ordered_json structure representing the node tree. It is primarily intended as a debugging tool to visualize and understand complex parser output.

Member Function Documentation

◆ visit_node()

nlohmann::basic_json< nlohmann::ordered_map > bs::shell_node_visitor_json::visit_node ( shell_session oSession,
const shell_node pRawNode 
)
overridevirtual

Visit a generic shell node and return its JSON representation.

Dispatches the node to the appropriate specialized visit() overload inherited from shell_node_visitor, constructing a JSON object that describes the node and its children.

Parameters
oSessionThe active shell session used during evaluation.
pRawNodePointer to the node being visited.
Returns
A JSON object representing the visited node.

Reimplemented from bs::shell_node_visitor< nlohmann::ordered_json >.


The documentation for this class was generated from the following files: