UNPKG

@flowscripter/mpeg-sdl-parser

Version:

ISO/IEC 14496-34 Syntactic Description Language (MPEG SDL) parser implemented in TypeScript

28 lines (25 loc) 897 B
import { AbstractCompositeNode } from "./AbstractCompositeNode.ts"; import type { AbstractNode } from "./AbstractNode.ts"; import type { ClassDeclaration } from "./ClassDeclaration.ts"; import type { ComputedElementaryTypeDefinition } from "./ComputedElementaryTypeDefinition.ts"; import { NodeKind } from "./enum/node_kind.ts"; import type { MapDeclaration } from "./MapDeclaration.ts"; export class Specification extends AbstractCompositeNode { constructor( public readonly globals: Array< ComputedElementaryTypeDefinition | MapDeclaration | ClassDeclaration >, ) { super( NodeKind.SPECIFICATION, globals[0].startToken, globals[globals.length - 1].endToken, ); this.globals = globals; } override *getChildNodeIterable(): IterableIterator<AbstractNode> { for (const currentGlobal of this.globals) { yield currentGlobal; } } }