@fauton/cfg
Version:
A package to work with context free grammars and LL1 parsers
8 lines (7 loc) • 453 B
TypeScript
import { IContextFreeGrammarInput } from './types';
/**
* Removes unreachable variables and production of a cfg
* @param cfg Production rules, start variable and variables array of cfg
* @returns A new production rule record and variables with unreachable variable and rules removed
*/
export declare function removeUnreachableProduction(inputCfg: Pick<IContextFreeGrammarInput, 'productionRules' | 'startVariable' | 'variables'>): string[];