#ifndef grr_nonempty_H #define grr_nonempty_H /* grr_nonempty.c - procedures for removing empty strings from the grammar */ /* Last edited on 2024-12-21 11:47:08 by stolfi */ #include #include #include #include #include #include Grammar_t *grr_remove_empty_rules(Grammar_t *G); /* Given an arbitrary grammar {G}, returns an almost-equivalent empty-free grammar {G1}. The new grammar {G1} has the same symbols as {G}, but (1) every symbol generates the same terminal strings as in {G}, except the empty string; (2) every derivation tree in {G1} is a derivation tree of {G} with a non-empty terminal phrase, with all subtrees leading to the empty string deleted. */ #endif