semantic_parser.js 779 B

123456789101112131415161718192021222324252627
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.SemanticAbstractParser = void 0;
  4. const semantic_node_factory_js_1 = require("./semantic_node_factory.js");
  5. class SemanticAbstractParser {
  6. constructor(type) {
  7. this.type = type;
  8. this.factory_ = new semantic_node_factory_js_1.SemanticNodeFactory();
  9. }
  10. getFactory() {
  11. return this.factory_;
  12. }
  13. setFactory(factory) {
  14. this.factory_ = factory;
  15. }
  16. getType() {
  17. return this.type;
  18. }
  19. parseList(list) {
  20. const result = [];
  21. for (let i = 0, element; (element = list[i]); i++) {
  22. result.push(this.parse(element));
  23. }
  24. return result;
  25. }
  26. }
  27. exports.SemanticAbstractParser = SemanticAbstractParser;