import { Alternative as e } from "../../../../../@chevrotain/gast/lib/src/model.js";
import { RestWalker as t } from "./rest.js";
import { first as n } from "./first.js";
import { IN as r } from "../constants.js";
//#region ../../node_modules/chevrotain/lib/src/parse/grammar/follow.js
var i = class extends t {
	constructor(e) {
		super(), this.topProd = e, this.follows = {};
	}
	startWalking() {
		return this.walk(this.topProd), this.follows;
	}
	walkTerminal(e, t, n) {}
	walkProdRef(t, r, i) {
		let a = o(t.referencedRule, t.idx) + this.topProd.name, s = n(new e({ definition: r.concat(i) }));
		this.follows[a] = s;
	}
};
function a(e) {
	let t = {};
	return e.forEach((e) => {
		let n = new i(e).startWalking();
		Object.assign(t, n);
	}), t;
}
function o(e, t) {
	return e.name + t + r;
}
//#endregion
export { a as computeAllProdsFollows };
