python2ib
Version:
Convert Python code to IB Pseudocode format
52 lines • 2.33 kB
TypeScript
/**
* Keyword conversion mappings for Python to IB Pseudocode
*/
/** Python keywords to IB Pseudocode mapping */
export declare const KEYWORD_MAPPING: Record<string, string>;
/** Built-in function mappings */
export declare const BUILTIN_FUNCTION_MAPPING: Record<string, string>;
/** Data type mappings */
export declare const TYPE_MAPPING: Record<string, string>;
/** IB Pseudocode reserved words that should not be used as variable names */
export declare const IB_RESERVED_WORDS: Set<string>;
/** Keyword conversion utilities */
export declare class KeywordConverter {
/** Convert Python keyword to IB Pseudocode */
static convertKeyword(keyword: string): string;
/** Convert Python built-in function to IB Pseudocode */
static convertBuiltinFunction(functionName: string): string;
/** Convert Python type to IB Pseudocode type */
static convertType(typeName: string): string;
/** Check if a keyword is supported */
static isKeywordSupported(keyword: string): boolean;
/** Check if a built-in function is supported */
static isBuiltinSupported(functionName: string): boolean;
/** Check if a variable name conflicts with IB reserved words */
static isReservedWord(name: string): boolean;
/** Suggest alternative name if variable conflicts with reserved word */
static suggestAlternativeName(name: string): string;
/** Get all supported keywords */
static getSupportedKeywords(): string[];
/** Get all supported built-in functions */
static getSupportedBuiltins(): string[];
/** Convert Python boolean literal to IB Pseudocode */
static convertBooleanLiteral(value: boolean): string;
/** Convert Python None to IB Pseudocode */
static convertNone(): string;
}
/** Special handling for specific Python constructs */
export declare const SPECIAL_CONSTRUCTS: {
/** Handle print() function conversion */
convertPrint(args: string[]): string;
/** Handle input() function conversion */
convertInput(prompt?: string): string;
/** Convert range() call to IB Pseudocode FOR loop parameters */
convertRange(args: string[]): {
start: string;
end: string;
step?: string;
};
/** Handle len() function conversion */
convertLen(arg: string): string;
};
//# sourceMappingURL=keywords.d.ts.map