Transformations on Context Free Grammars

Joachim Niehren

provides
x-ozlib://niehren/context-free-grammar/convert.ozf
x-ozlib://niehren/context-free-grammar/empty-category.ozf
x-ozlib://niehren/context-free-grammar/bnf.ozf

Purpose

convert.toCFG converts a context free grammar (CFG) into Backus-Naur-Form (BNF).

empty-categories.simplify removes all unreachable empty categories (non-terminals) from a CFG.

bnf.toCFG converts a BNF back into the usual format with grammar rules and lexicon entries.

bnf.toFile writes a BNF as a string onto a file. These strings are in Lernout&Hauspie (L&H) format for speech recognition with the ASR 1600.

Note that parsers for context free grammars can be generated with the package unification grammars as every context free grammar is a unification grammar (without any change or syntactic manipulation).

Installation

You can install the package niehren-context-free-grammar-1.0.pkg by using ozmake: ozmake --install --package=niehren-context-free-grammar-1.0 or extact (and later on compile) the source code (again with ozmake): ozmake --extract --package=niehren-context-free-grammar-1.0


Joachim Niehren