robrix / Hammer

Parsing and pattern matching in Objective-C
BSD 3-Clause "New" or "Revised" License
75 stars 1 forks source link

Conform combinators to REDReducible #57

Closed robrix closed 10 years ago

robrix commented 10 years ago

Would be nice to be able to just reduce w/ fixpoint for (near-)arbitrary operations across the grammar.

robrix commented 10 years ago

parseNull would become something like:

[[NSSet set] red_append:REDMap(grammar, ^(id<HMRCombinator> each) {
    return each.localParseForest;
})];

Compaction would be even cooler.

robrix commented 10 years ago

This would be a depth-first acyclic traversal.