import { resolveGrammar as resolveGrammar$1 } from "./lib-src-parse-grammar-resolver.js";
import { validateGrammar as validateGrammar$1 } from "./lib-src-parse-grammar-checks.js";
import { defaultGrammarResolverErrorProvider, defaultGrammarValidatorErrorProvider } from "./lib-src-parse-errors_public.js";
import defaults from "../lodash-es/defaults2.js";
import forEach from "../lodash-es/forEach2.js";
function resolveGrammar(options) {
  const actualOptions = defaults(options, {
    errMsgProvider: defaultGrammarResolverErrorProvider
  });
  const topRulesTable = {};
  forEach(options.rules, (rule) => {
    topRulesTable[rule.name] = rule;
  });
  return resolveGrammar$1(topRulesTable, actualOptions.errMsgProvider);
}
function validateGrammar(options) {
  options = defaults(options, {
    errMsgProvider: defaultGrammarValidatorErrorProvider
  });
  return validateGrammar$1(options.rules, options.tokenTypes, options.errMsgProvider, options.grammarName);
}
export {
  resolveGrammar,
  validateGrammar
};
//# sourceMappingURL=lib-src-parse-grammar-gast-gast_resolver_public.js.map
