Modified loki grammar