UNPKG

antlr-ng

Version:

Next generation ANTLR Tool

30 lines (29 loc) 1.09 kB
import { DictType } from "../misc/types.js"; import { IAttribute } from "./IAttribute.js"; import type { GrammarAST } from "./ast/GrammarAST.js"; /** * Track the attributes within retval, arg lists etc... * * Each rule has potentially 3 scopes: return values, parameters, and an implicitly-named scope (i.e., a scope * defined in a rule). Implicitly-defined scopes are named after the rule; rules and scopes then must live in the same * name space - no collisions allowed. */ export declare class AttributeDict { name: string; ast: GrammarAST; type?: DictType; /** The list of {@link IAttribute} objects. */ readonly attributes: Map<string, IAttribute>; constructor(type?: DictType); add(a: IAttribute): IAttribute; get(name: string): IAttribute | null; getName(): string; size(): number; /** * @param other The other {@link AttributeDict} to compare with. * * @returns the set of keys that collide from {@code this} and {@code other}. */ intersection(other: AttributeDict | null): Set<string>; toString(): string; }