python2ib
Version:
Convert Python code to IB Pseudocode format
41 lines • 2 kB
TypeScript
/**
* Operator conversion mappings for Python to IB Pseudocode
*/
/** Assignment operators mapping */
export declare const ASSIGNMENT_OPERATORS: Record<string, string>;
/** Comparison operators mapping */
export declare const COMPARISON_OPERATORS: Record<string, string>;
/** Arithmetic operators mapping */
export declare const ARITHMETIC_OPERATORS: Record<string, string>;
/** Logical operators mapping */
export declare const LOGICAL_OPERATORS: Record<string, string>;
/** Bitwise operators (not commonly used in IB but included for completeness) */
export declare const BITWISE_OPERATORS: Record<string, string>;
/** All operators combined */
export declare const ALL_OPERATORS: {
[x: string]: string;
};
/** Operator conversion utilities */
export declare class OperatorConverter {
/** Convert Python assignment operator to IB Pseudocode */
static convertAssignment(operator: string, variable: string): string;
/** Convert Python comparison operator to IB Pseudocode */
static convertComparison(operator: string): string;
/** Convert Python arithmetic operator to IB Pseudocode */
static convertArithmetic(operator: string): string;
/** Convert Python logical operator to IB Pseudocode */
static convertLogical(operator: string): string;
/** Convert any Python operator to IB Pseudocode */
static convert(operator: string, variable?: string): string;
/** Check if operator is supported */
static isSupported(operator: string): boolean;
/** Get all supported operators */
static getSupportedOperators(): string[];
/** Expand compound assignment to full assignment */
static expandCompoundAssignment(variable: string, operator: string, value: string): string;
}
/** Operator precedence for expression parsing */
export declare const OPERATOR_PRECEDENCE: Record<string, number>;
/** Check if operator is left-associative */
export declare function isLeftAssociative(operator: string): boolean;
//# sourceMappingURL=operators.d.ts.map