Method: Crokus::AstPrinter#print
- Defined in:
- lib/crokus/ast_printer.rb
#print(ast) ⇒ Object
entry method
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/crokus/ast_printer.rb', line 14 def print ast #entry method @verbose=false @nodes_decl=Code.new @nodes_cnx=Code.new @printed_cnx={} #Cosmetic ! to keep track of already printed cnx source->sink @code=Code.new code << "digraph G {" code.indent=2 code << "ordering=out;" code << "ranksep=.4;" code << "bgcolor=\"lightgrey\";" code.newline code << "node [shape=box, fixedsize=false, fontsize=12, fontname=\"Helvetica-bold\", fontcolor=\"blue\"" code << " width=.25, height=.25, color=\"black\", fillcolor=\"white\", style=\"filled, solid, bold\"];" code << "edge [arrowsize=.5, color=\"black\", style=\"bold\"]" process(ast) code << @nodes_decl code << @nodes_cnx code.indent=0 code << "}" clean(code) return code end |