Method: EBNF::Rule#to_ruby

Defined in:
lib/ebnf/rule.rb

#to_rubyString

Return a Ruby representation of this rule

Returns:

  • (String)


239
240
241
# File 'lib/ebnf/rule.rb', line 239

def to_ruby
  "EBNF::Rule.new(#{sym.inspect}, #{id.inspect}, #{expr.inspect}#{', kind: ' + kind.inspect unless kind == :rule})"
end