Class: Juli::Visitor::LineTree

Inherits:
LineAbsyn::Visitor show all
Includes:
Util
Defined in:
lib/juli/visitor/tree.rb

Instance Method Summary collapse

Methods included from Util

#camelize, conf, find_template, in_filename, juli_repo, mkdir, out_filename, str_limit, str_trim, to_wikiname, underscore, usage, visitor, visitor_list

Methods inherited from LineAbsyn::Visitor

#visit_array, #visit_macro, #visit_node

Constructor Details

#initialize(depth) ⇒ LineTree

Returns a new instance of LineTree.



9
10
11
# File 'lib/juli/visitor/tree.rb', line 9

def initialize(depth)
  @depth = depth
end

Instance Method Details



13
14
15
# File 'lib/juli/visitor/tree.rb', line 13

def print_depth
  print '| ' * @depth
end

#visit_string(n) ⇒ Object



17
18
19
20
# File 'lib/juli/visitor/tree.rb', line 17

def visit_string(n)
  print_depth
  printf "str:  %s\n", str_trim(n.str)
end

#visit_url(n) ⇒ Object



27
28
29
30
# File 'lib/juli/visitor/tree.rb', line 27

def visit_url(n)
  print_depth
  printf "url:  %s\n", str_trim(n.str)
end

#visit_wikiname(n) ⇒ Object



22
23
24
25
# File 'lib/juli/visitor/tree.rb', line 22

def visit_wikiname(n)
  print_depth
  printf "wiki: %s\n", str_trim(n.str)
end