gropax / gramz

MIT License
2 stars 0 forks source link

Add a CFG grammar processor #1

Open gropax opened 9 years ago

gropax commented 9 years ago

Add preprocessing in order to:

gropax commented 9 years ago

Create a processor class for each process.

class Processor
  def initialize(grammar)
    @original = grammar
  end

  def process
  end
end

class UnreachableRulesProcessor < Processor
  condition -> { !unreachable_symbols.empty? }
  process :remove_unreachable_symbols

  def remove_unreachable_symbols
     #...
  end
end