UNPKG

@fauton/cfg

Version:

A package to work with context free grammars and LL1 parsers

8 lines (7 loc) 464 B
import { IContextFreeGrammarInput } from './types'; /** * Removes productions that has no rules and updates rules to remove those rules that references empty production variables * @param cfg Variables array and production rules record of cfg * @returns New production rules and variables without empty rule variables */ export declare function removeEmptyProduction(inputCfg: Pick<IContextFreeGrammarInput, 'variables' | 'productionRules'>): string[];