Class: Dhaka::Grammar

Inherits:
Object
  • Object
show all
Defined in:
lib/ionize/parser.rb

Direct Known Subclasses

Ionize::Php::Grammar

Instance Method Summary collapse

Instance Method Details

#for_rule(hash) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/ionize/parser.rb', line 6

def for_rule(hash)
  i = 0
  name = hash.keys.first
  for_symbol(name) do
    hash.values.first.split("|").each do |s|
      send "#{name}_#{i += 1}", *(s.split)
    end
  end
end