Hammer icon indicating copy to clipboard operation
Hammer copied to clipboard

Parsing and pattern matching in Objective-C

Results 19 Hammer issues
Sort by recently updated
recently updated
newest added

Instead of binding out to a thread local array during pattern matching, capturing the result would allow us to handle backtracking/etc more naturally and would reuse the existing machinery for...

Should be able to pipeline lexing and parsing: ``` [parser parse:[lexer parse:input]] ``` From the side, that looks like: ``` [[input red_reduce:lexer usingBlock:^(id into, id each) { return produce([into derivative:each]);...

Should include the source information.

Inverting matches is often useful. But what is the derivative…?

Would force unambiguous matches?

Would show using Hammer to destructure e.g. a dictionary: ``` [self addSubview:HMRMatch(petsByName, @[ [HMRPair(HMRAny(), HMRBind(HMRProperty(@"fluffiness", @(ExtremeFluffiness)))) then:^(Pet *pet) { return [PetView petViewWithExtremelyFluffyPet:pet]; }], ])]; ``` Depends on #78 probably.

example

Nonterminals will probably want to use fixpoints for both of these. Terminals have no need. - [x] `-hash` - [ ] `-isEqual:`

`-isEqual:` is introducing all kinds of headaches for cyclic grammars.

Fixpoint accumulating a set of combinators, assigning identities, mapping to syntax

Proposed ToC: ## On languages and the derivative of parser combinators ### Introduction - languages and the Chomsky hierarchy - production systems - normal forms - correspondence between classes of...