UNPKG

antlr-ng

Version:

Next generation ANTLR Tool

40 lines (39 loc) 1.24 kB
var __defProp = Object.defineProperty; var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); import { Action } from "./Action.js"; import { OutputModelObject } from "./OutputModelObject.js"; class OutputFile extends OutputModelObject { static { __name(this, "OutputFile"); } fileName; grammarFileName; TokenLabelType; inputSymbolType; /** * This is the version the runtimes test against for their compatibility. We use the version of the old ANTLR4 * tool here, until we start implementing the new target infrastructure. */ ANTLRVersion = "4.13.2"; constructor(factory, fileName) { super(factory); this.fileName = fileName; const g = factory.g; this.grammarFileName = g.fileName.replace("\\", "/"); this.TokenLabelType = g.getOptionString("TokenLabelType"); this.inputSymbolType = this.TokenLabelType; } buildNamedActions(g, filter) { const namedActions = /* @__PURE__ */ new Map(); for (const name of g.namedActions.keys()) { const ast = g.namedActions.get(name); if (!filter || filter(ast)) { namedActions.set(name, new Action(this.factory, ast)); } } return namedActions; } } export { OutputFile };