UNPKG

@flowscripter/mpeg-sdl-parser

Version:

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

25 lines (22 loc) 821 B
import type { Token } from "../token/Token.ts"; import type { AbstractNode } from "./AbstractNode.ts"; import { AbstractStatement } from "./AbstractStatement.ts"; import { StatementKind } from "./enum/statement_kind.ts"; import type { NumberLiteral } from "./NumberLiteral.ts"; import type { AbstractExpression } from "./AbstractExpression.ts"; import type { Identifier } from "./Identifier.ts"; export class ExpressionStatement extends AbstractStatement { constructor( public readonly expression: AbstractExpression | Identifier | NumberLiteral, public readonly semicolonPunctuator: Token, ) { super( StatementKind.EXPRESSION, expression.startToken, semicolonPunctuator, ); } override *getChildNodeIterable(): IterableIterator<AbstractNode> { yield this.expression; } }