UNPKG

python2igcse

Version:

Convert Python code to IGCSE Pseudocode format

121 lines 2.45 kB
import { IR } from '../types/ir'; import { EmitResult, EmitterOptions } from '../types/emitter'; import { BaseEmitter } from './base-emitter'; /** * Emitter that outputs IGCSE Pseudocode in plain text format */ export declare class TextEmitter extends BaseEmitter { private nodesProcessed; constructor(options?: Partial<EmitterOptions>); /** * Convert IR to plain text */ emit(ir: IR | IR[]): EmitResult; /** * Process IR node */ protected emitNode(node: IR): void; /** * Output assignment statement */ private emitAssign; /** * Output block */ private emitBlock; /** * Output output statement */ private emitOutput; /** * Output input statement */ private emitInput; /** * Output IF statement * Uses structured consequent/alternate fields */ private emitIf; /** * Output ELSE statement * Uses structured consequent field */ private emitElse; /** * Output ELSE IF statement */ private emitElseIf; /** * Output ENDIF statement */ private emitEndif; /** * Output FOR statement */ private emitFor; /** * Output WHILE statement */ private emitWhile; /** * Output ENDWHILE statement */ private emitEndwhile; /** * Output REPEAT statement */ private emitRepeat; /** * Output UNTIL statement */ private emitUntil; /** * Output procedure */ protected emitProcedure(node: IR): void; /** * Output FUNCTION statement */ protected emitFunction(node: IR): void; /** * Output RETURN statement */ private emitReturn; /** * Output array declaration */ private emitArray; /** * Output TYPE definition */ private emitType; /** * Output CLASS definition */ private emitClass; /** * Output CASE statement */ private emitCase; /** * Output expression */ private emitExpression; /** * Output statement */ private emitStatement; /** * Output compound statement */ private emitCompound; /** * Add header comment */ addHeader(title: string, author?: string, date?: string): void; /** * Add footer comment */ addFooter(): void; } //# sourceMappingURL=text-emitter.d.ts.map