Alexandria  2.22.0
Please provide a description of the project.
Public Member Functions | Protected Attributes | List of all members
Pyston::TextReprVisitor Class Reference

#include <TextReprVisitor.h>

Inheritance diagram for Pyston::TextReprVisitor:
[legend]
Collaboration diagram for Pyston::TextReprVisitor:
[legend]

Public Member Functions

 TextReprVisitor (std::ostream &out_stream)
 
void enter (const NodeBase *base) override
 
void exit (const NodeBase *node) override
 

Protected Attributes

std::ostreamm_stream
 
std::list< std::list< std::string > > m_stack
 

Detailed Description

Visit a computation tree, and generate a (more or less) human readable representation of it

Definition at line 31 of file TextReprVisitor.h.

Constructor & Destructor Documentation

◆ TextReprVisitor()

Pyston::TextReprVisitor::TextReprVisitor ( std::ostream out_stream)
explicit

Constructor

Parameters
out_streamSerialize into this stream

Definition at line 24 of file TextReprVisitor.cpp.

Member Function Documentation

◆ enter()

void Pyston::TextReprVisitor::enter ( const NodeBase base)
overridevirtual

Called when a node is entered

Implements Pyston::Visitor.

Definition at line 26 of file TextReprVisitor.cpp.

References m_stack, and std::list< T >::push_back().

Here is the call graph for this function:

◆ exit()

void Pyston::TextReprVisitor::exit ( const NodeBase node)
overridevirtual

Called when a node is left

Implements Pyston::Visitor.

Definition at line 30 of file TextReprVisitor.cpp.

References std::string::back(), std::list< T >::back(), std::list< T >::empty(), std::string::front(), m_stack, m_stream, std::list< T >::pop_back(), Pyston::NodeBase::repr(), std::string::size(), and std::ostringstream::str().

Here is the call graph for this function:

Member Data Documentation

◆ m_stack

std::list<std::list<std::string> > Pyston::TextReprVisitor::m_stack
protected

Definition at line 52 of file TextReprVisitor.h.

Referenced by enter(), and exit().

◆ m_stream

std::ostream& Pyston::TextReprVisitor::m_stream
protected

Definition at line 51 of file TextReprVisitor.h.

Referenced by exit().


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