Adapted GrammarParser for reading rules with head corners.