"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const interpreter = require("./lib-src-parse-grammar-interpreter.cjs");
const isUndefined = require("../lodash-es/isUndefined2.cjs");
const head = require("../lodash-es/head.cjs");
class ContentAssist {
  initContentAssist() {
  }
  computeContentAssist(startRuleName, precedingInput) {
    const startRuleGast = this.gastProductionsCache[startRuleName];
    if (isUndefined.default(startRuleGast)) {
      throw Error(`Rule ->${startRuleName}<- does not exist in this grammar.`);
    }
    return interpreter.nextPossibleTokensAfter([startRuleGast], precedingInput, this.tokenMatcher, this.maxLookahead);
  }
  // TODO: should this be a member method or a utility? it does not have any state or usage of 'this'...
  // TODO: should this be more explicitly part of the public API?
  getNextPossibleTokenTypes(grammarPath) {
    const topRuleName = head.default(grammarPath.ruleStack);
    const gastProductions = this.getGAstProductions();
    const topProduction = gastProductions[topRuleName];
    const nextPossibleTokenTypes = new interpreter.NextAfterTokenWalker(topProduction, grammarPath).startWalking();
    return nextPossibleTokenTypes;
  }
}
exports.ContentAssist = ContentAssist;
//# sourceMappingURL=lib-src-parse-parser-traits-context_assist.cjs.map
