Module: Dentaku::Visitor::Infix

Defined in:
lib/dentaku/visitor/infix.rb

Instance Method Summary collapse

Instance Method Details

#process(_ast) ⇒ Object

Raises:

  • (NotImplementedError)


16
17
18
# File 'lib/dentaku/visitor/infix.rb', line 16

def process(_ast)
  raise NotImplementedError
end

#visit(ast) ⇒ Object



12
13
14
# File 'lib/dentaku/visitor/infix.rb', line 12

def visit(ast)
  ast.accept(self)
end

#visit_access(node) ⇒ Object



69
70
71
# File 'lib/dentaku/visitor/infix.rb', line 69

def visit_access(node)
  process(node)
end

#visit_array(node) ⇒ Object



81
82
83
# File 'lib/dentaku/visitor/infix.rb', line 81

def visit_array(node)
  process(node)
end

#visit_case(node) ⇒ Object



41
42
43
# File 'lib/dentaku/visitor/infix.rb', line 41

def visit_case(node)
  process(node)
end

#visit_case_conditional(node) ⇒ Object



49
50
51
# File 'lib/dentaku/visitor/infix.rb', line 49

def visit_case_conditional(node)
  process(node)
end

#visit_else(node) ⇒ Object



61
62
63
# File 'lib/dentaku/visitor/infix.rb', line 61

def visit_else(node)
  process(node)
end

#visit_function(node) ⇒ Object



20
21
22
23
24
25
# File 'lib/dentaku/visitor/infix.rb', line 20

def visit_function(node)
  node.args.each do |arg|
    visit(arg)
  end
  process(node)
end

#visit_identifier(node) ⇒ Object



27
28
29
# File 'lib/dentaku/visitor/infix.rb', line 27

def visit_identifier(node)
  process(node)
end

#visit_literal(node) ⇒ Object



73
74
75
# File 'lib/dentaku/visitor/infix.rb', line 73

def visit_literal(node)
  process(node)
end

#visit_negation(node) ⇒ Object



65
66
67
# File 'lib/dentaku/visitor/infix.rb', line 65

def visit_negation(node)
  process(node)
end

#visit_nil(node) ⇒ Object



77
78
79
# File 'lib/dentaku/visitor/infix.rb', line 77

def visit_nil(node)
  process(node)
end

#visit_operand(node) ⇒ Object



37
38
39
# File 'lib/dentaku/visitor/infix.rb', line 37

def visit_operand(node)
  process(node)
end

#visit_operation(node) ⇒ Object



31
32
33
34
35
# File 'lib/dentaku/visitor/infix.rb', line 31

def visit_operation(node)
  visit(node.left) if node.left
  process(node)
  visit(node.right) if node.right
end

#visit_switch(node) ⇒ Object



45
46
47
# File 'lib/dentaku/visitor/infix.rb', line 45

def visit_switch(node)
process(node)
end

#visit_then(node) ⇒ Object



57
58
59
# File 'lib/dentaku/visitor/infix.rb', line 57

def visit_then(node)
  process(node)
end

#visit_when(node) ⇒ Object



53
54
55
# File 'lib/dentaku/visitor/infix.rb', line 53

def visit_when(node)
  process(node)
end