Skip to content

Instantly share code, notes, and snippets.

@fjolnir
Created June 27, 2012 12:18
Show Gist options
  • Save fjolnir/3003700 to your computer and use it in GitHub Desktop.
Save fjolnir/3003700 to your computer and use it in GitHub Desktop.
Property = obj:Variable
{
PushStack([NSMutableArray array]);
}
- PropSubscr+
{
NSMutableArray *subscripts = PopStack();
$$ = [TQNodeMemberAccess nodeWithReceiver:obj property:[subscript objectAtIndex:0]];
for(int i = 1; i < [subscripts count]; ++i) {
$$ = [TQNodeMemberAccess nodeWithReceiver:$$ property:[subscript objectAtIndex:i]];
}
}
PropSubscr = "#" - prop:Identifier { [StackTop addObject:prop]; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment