"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Sequence = void 0;
const Production_js_1 = require("../core/Production.js");
const Rule_js_1 = require("./Rule.js");
class Sequence extends Rule_js_1.Rule {
    constructor(tgt, ...children) {
        super("sequence", tgt, ...children);
    }
    createBNF(grammar) {
        const p = Rule_js_1.Rule.addProduction(grammar, this, this.tgt, ...this.children);
        const that = this;
        p.onExtension((_parent, ...children) => {
            for (let c = 0; c < children.length; c++) {
                let ch = children[c];
                ch.setNthEntryInParent(c);
                ch.setName(that.getNameForChild(c));
            }
        });
        p.setAstBuilder(Production_js_1.AstBuilder.DEFAULT);
    }
}
exports.Sequence = Sequence;
//# sourceMappingURL=Sequence.js.map