first try at context-sensitive parsing

PR to archive the branch