UNPKG

pegisland

Version:

General PEG-based parser supporting island grammars with lake symbols

26 lines 882 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TopDownSetCalculator = void 0; const utils_1 = require("../utils"); const SetCalculator_1 = require("./SetCalculator"); const set_operations_1 = require("../set-operations"); class TopDownSetCalculator extends SetCalculator_1.SetCalculator { constructor(rules, beginning) { super(rules, false); this.beginning = beginning; } getBeginning(pe) { return (0, utils_1.getValue)(this.beginning, pe); } visitNonterminal(pe) { this.set(pe.rule.rhs, (0, set_operations_1.union)(this.get(pe.rule.rhs), this.get(pe))); } visitTerminal(_pe) { // do nothing } propagateToOperand(pe) { this.propagate(pe, pe.operand); } } exports.TopDownSetCalculator = TopDownSetCalculator; //# sourceMappingURL=TopDownSetCalculator.js.map