123456789_123456789_123456789_123456789_123456789_

Class: ActionDispatch::Journey::Visitors::FunctionalVisitor

Do not use. This class is for internal use only.
Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Subclasses:
Inherits: Object
Defined in: actionpack/lib/action_dispatch/journey/visitors.rb

Constant Summary

Instance Method Summary

Instance Method Details

#accept(node, seed)

[ GitHub ]

  
# File 'actionpack/lib/action_dispatch/journey/visitors.rb', line 100

def accept(node, seed)
  visit(node, seed)
end

#binary(node, seed)

[ GitHub ]

  
# File 'actionpack/lib/action_dispatch/journey/visitors.rb', line 108

def binary(node, seed)
  visit(node.right, visit(node.left, seed))
end

#nary(node, seed)

[ GitHub ]

  
# File 'actionpack/lib/action_dispatch/journey/visitors.rb', line 113

def nary(node, seed)
  node.children.inject(seed) { |s, c| visit(c, s) }
end

#terminal(node, seed)

[ GitHub ]

  
# File 'actionpack/lib/action_dispatch/journey/visitors.rb', line 124

def terminal(node, seed);   seed; end

#unary(node, seed)

[ GitHub ]

  
# File 'actionpack/lib/action_dispatch/journey/visitors.rb', line 118

def unary(node, seed)
  visit(node.left, seed)
end

#visit(node, seed)

[ GitHub ]

  
# File 'actionpack/lib/action_dispatch/journey/visitors.rb', line 104

def visit(node, seed)
  send(DISPATCH_CACHE[node.type], node, seed)
end

#visit_CAT(n, seed)

[ GitHub ]

  
# File 'actionpack/lib/action_dispatch/journey/visitors.rb', line 111

def visit_CAT(n, seed); binary(n, seed); end

#visit_DOT(n, seed)

[ GitHub ]

  
# File 'actionpack/lib/action_dispatch/journey/visitors.rb', line 128

def visit_DOT(n, seed);     terminal(n, seed); end

#visit_GROUP(n, seed)

[ GitHub ]

  
# File 'actionpack/lib/action_dispatch/journey/visitors.rb', line 121

def visit_GROUP(n, seed); unary(n, seed); end

#visit_LITERAL(n, seed)

[ GitHub ]

  
# File 'actionpack/lib/action_dispatch/journey/visitors.rb', line 125

def visit_LITERAL(n, seed); terminal(n, seed); end

#visit_OR(n, seed)

[ GitHub ]

  
# File 'actionpack/lib/action_dispatch/journey/visitors.rb', line 116

def visit_OR(n, seed); nary(n, seed); end

#visit_SLASH(n, seed)

[ GitHub ]

  
# File 'actionpack/lib/action_dispatch/journey/visitors.rb', line 127

def visit_SLASH(n, seed);   terminal(n, seed); end

#visit_STAR(n, seed)

[ GitHub ]

  
# File 'actionpack/lib/action_dispatch/journey/visitors.rb', line 122

def visit_STAR(n, seed); unary(n, seed); end

#visit_SYMBOL(n, seed)

[ GitHub ]

  
# File 'actionpack/lib/action_dispatch/journey/visitors.rb', line 126

def visit_SYMBOL(n, seed);  terminal(n, seed); end