Class: QuickPrinter
- Inherits:
-
SexpProcessor
- Object
- SexpProcessor
- QuickPrinter
- Defined in:
- lib/parsetree/demo/printer.rb
Instance Method Summary collapse
-
#initialize ⇒ QuickPrinter
constructor
A new instance of QuickPrinter.
- #process_defn(exp) ⇒ Object
Constructor Details
#initialize ⇒ QuickPrinter
Returns a new instance of QuickPrinter.
6 7 8 9 10 |
# File 'lib/parsetree/demo/printer.rb', line 6 def initialize super self.strict = false self.auto_shift_type = true end |
Instance Method Details
#process_defn(exp) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/parsetree/demo/printer.rb', line 11 def process_defn(exp) name = exp.shift args = process exp.shift body = process exp.shift puts " def #{name}" return s(:defn, name, args, body) end |