UNPKG

antlr-ng

Version:

Next generation ANTLR Tool

42 lines (41 loc) 1.01 kB
var __defProp = Object.defineProperty; var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); import { GrammarASTWithOptions } from "./GrammarASTWithOptions.js"; class BlockAST extends GrammarASTWithOptions { static { __name(this, "BlockAST"); } /** What are the default options for a subrule? */ static defaultBlockOptions = /* @__PURE__ */ new Map(); static defaultLexerBlockOptions = /* @__PURE__ */ new Map(); constructor(...args) { if (args.length === 1) { if (args[0] instanceof BlockAST) { const [node] = args; super(node); } else { super(args[0]); } } else { let type; let t; let text; if (typeof args[0] === "number") { [type, t, text] = args; } else { [t, text] = args; type = t.type; } super(type, t, text); } } dupNode() { return new BlockAST(this); } visit(v) { return v.visit(this); } } export { BlockAST };