Open gropax opened 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
Add preprocessing in order to:
A -> Ba | Ba
A -> ε
A -> B
S -> a ; A -> b
S -> A ; A -> Aa