My tiny language, Foam, is coming along nicely! The following code:
tv := @textView
as := tv typingAttributes. mutableCopy
as setObject:@defaultParagraphStyle forKey:NSParagraphStyleAttributeName
@defaultTypingAttributes = as
tv setTypingAttributes:@defaultTypingAttributes
tv setDefaultParagraphStyle:@defaultParagraphStyle
options := {"NSValueTransformerName": "BlahBlahTransformer"}
tv bind:"value" toObject:@document withKeyPath:"text" options:options
...translates to the following:
id tv = self.textView
id as = [[tv typingAttributes] mutableCopy];
[as setObject:self.defaultParagraphStyle forKey:NSParagraphStyleAttributeName];
self.defaultTypingAttributes = as
[tv setTypingAttributes:self.defaultTypingAttributes];
[tv setDefaultParagraphStyle:self.defaultParagraphStyle];
id options = [NSDictionary dictionaryWithObjectsAndKeys:@"BlahBlahTransformer",@"NSValueTransformerName",nil];
[tv bind:@"value" toObject:self.document withKeyPath:@"text" options:options];
To see the annotated source of its parser, go here: http://jonsterling.github.com/Foam/Parse.hs.html.