class Rley::Formatter::BaseFormatter
Superclass for parse tree formatters.
Attributes
The IO output stream in which the formatter’s result will be sent. @return [IO] The output stream for the formatter.
Public Class Methods
Source
# File lib/rley/formatter/base_formatter.rb, line 15 def initialize(anIO) @output = anIO end
Constructor. @param anIO [IO] an output IO where the formatter’s result will be placed.
Public Instance Methods
Source
# File lib/rley/formatter/base_formatter.rb, line 22 def render(aVisitor) aVisitor.subscribe(self) aVisitor.start aVisitor.unsubscribe(self) end
Given a parse tree visitor, perform the visit and render the visit events in the output stream. @param aVisitor [ParseTreeVisitor]