UNPKG

@flowscripter/mpeg-sdl-parser

Version:

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

30 lines (27 loc) 1.07 kB
import type { Token } from "../token/Token.ts"; import type { AbstractExpression } from "./AbstractExpression.ts"; import type { AbstractNode } from "./AbstractNode.ts"; import { AbstractStatement } from "./AbstractStatement.ts"; import type { CompoundStatement } from "./CompoundStatement.ts"; import { StatementKind } from "./enum/statement_kind.ts"; import type { Identifier } from "./Identifier.ts"; import type { NumberLiteral } from "./NumberLiteral.ts"; export class WhileStatement extends AbstractStatement { constructor( public readonly condition: AbstractExpression | Identifier | NumberLiteral, public readonly compoundStatement: CompoundStatement, public readonly whileKeyword: Token, public readonly openParenthesisPunctuator: Token, public readonly closeParenthesisPunctuator: Token, ) { super( StatementKind.WHILE, whileKeyword, closeParenthesisPunctuator, ); } override *getChildNodeIterable(): IterableIterator<AbstractNode> { yield this.condition; yield this.compoundStatement; } }