python2igcse
Version:
Convert Python code to IGCSE Pseudocode format
83 lines • 1.94 kB
TypeScript
import { BaseParser } from './base-parser';
import { ParserOptions, ParseResult } from '../types/parser';
import { IR } from '../types/ir';
/**
* Parser for converting Python to IGCSE Pseudocode
*/
export declare class PythonParser extends BaseParser {
constructor(options?: ParserOptions);
/**
* Parse Python source code and convert to IR
*/
parse(source: string): ParseResult;
/**
* Parse to IR processing
*/
private parseToIR;
/**
* Source code preprocessing
*/
private preprocessSource;
/**
* Count functions from IR
*/
private countFunctionsFromIR;
/**
* Count classes from IR
*/
private countClassesFromIR;
/**
* Count variables from IR
*/
private countVariablesFromIR;
/**
* Source code preprocessing (internal implementation)
*/
private preprocess;
/**
* IR post-processing
*/
/**
* IR optimization
*/
private optimizeIR;
/**
* Merge consecutive comments
*/
private mergeConsecutiveComments;
/**
* IR validation (temporarily disabled)
*/
/**
* Get parser statistics
*/
getStats(ir?: IR): {
totalVariables: number;
totalFunctions: number;
totalScopes: number;
maxNestingDepth: number;
};
/**
* Analyze variable usage
*/
analyzeVariableUsage(): Map<string, {
defined: boolean;
used: boolean;
type: import('../types/igcse').IGCSEDataType;
scope: string;
}>;
/**
* Analyze function usage
*/
analyzeFunctionUsage(): Map<string, {
defined: boolean;
called: boolean;
parameters: import('../types/parser').ParameterInfo[];
returnType?: import('../types/igcse').IGCSEDataType;
}>;
/**
* Reset parser state
*/
reset(): void;
}
//# sourceMappingURL=python-parser.d.ts.map