Relational version of parsing with derivatives code