python2igcse
Version:
Convert Python code to IGCSE Pseudocode format
83 lines • 1.97 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
*/
private parseToIR;
/**
* Preprocess source code
*/
private preprocessSource;
/**
* Count functions from IR
*/
private countFunctionsFromIR;
/**
* Count classes from IR
*/
private countClassesFromIR;
/**
* Count variables from IR
*/
private countVariablesFromIR;
/**
* Preprocess source code (internal implementation)
*/
private preprocess;
/**
* Post-process IR
*/
/**
* Optimize IR
*/
private optimizeIR;
/**
* Merge consecutive comments
*/
private mergeConsecutiveComments;
/**
* Validate IR (temporarily disabled)
*/
/**
* パーサーの統計情報を取得
*/
getStats(ir?: IR): {
totalVariables: number;
totalFunctions: number;
totalScopes: number;
maxNestingDepth: number;
};
/**
* 変数の使用状況を分析
*/
analyzeVariableUsage(): Map<string, {
defined: boolean;
used: boolean;
type: import('../types/igcse').IGCSEDataType;
scope: string;
}>;
/**
* 関数の使用状況を分析
*/
analyzeFunctionUsage(): Map<string, {
defined: boolean;
called: boolean;
parameters: import('../types/parser').ParameterInfo[];
returnType?: import('../types/igcse').IGCSEDataType;
}>;
/**
* パーサーの状態をリセット
*/
reset(): void;
}
//# sourceMappingURL=python-parser.d.ts.map