|
BashSpark
|
Visitor that converts shell nodes into JSON. More...
#include <shell_node_visitor_json.h>


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. | |
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.
|
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.
| oSession | The active shell session used during evaluation. |
| pRawNode | Pointer to the node being visited. |
Reimplemented from bs::shell_node_visitor< nlohmann::ordered_json >.