Class: DotGraphPrinter

Inherits:
Object show all
Defined in:
lib/rpdf2txt-rockit/graphdrawing.rb

Direct Known Subclasses

SyntaxTreeAsDotGraph

Instance Method Summary collapse

Constructor Details

#initialize(size = "11,9", orientation = "landscape") ⇒ DotGraphPrinter

Returns a new instance of DotGraphPrinter.



31
32
33
# File 'lib/rpdf2txt-rockit/graphdrawing.rb', line 31

def initialize(size = "11,9", orientation = "landscape")
  @size, @orientation = size, orientation
end

Instance Method Details

#to_graph(ast) ⇒ Object



35
36
37
38
39
# File 'lib/rpdf2txt-rockit/graphdrawing.rb', line 35

def to_graph(ast)
  @nodes, @links = Hash.new, Hash.new
  eval_to_dot(ast, nil)
  to_graph_from_nodes_and_links(@nodes, @links)
end