UNPKG

antlr-ng

Version:

Next generation ANTLR Tool

41 lines (40 loc) 858 B
var __defProp = Object.defineProperty; var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); import { GrammarAST } from "./GrammarAST.js"; class OptionalBlockAST extends GrammarAST { static { __name(this, "OptionalBlockAST"); } greedy; constructor(...args) { switch (args.length) { case 1: { const [node] = args; super(node); this.greedy = node.greedy; break; } case 3: { const [type, t, greedy] = args; super(type, t); this.greedy = greedy; break; } default: { throw new Error("Invalid number of arguments"); } } } isGreedy() { return this.greedy; } dupNode() { return new OptionalBlockAST(this); } visit(v) { return v.visit(this); } } export { OptionalBlockAST };