UNPKG

java2ib

Version:

TypeScript library that converts Java code into IB Computer Science pseudocode format

66 lines 2.88 kB
"use strict"; /** * Java to IB Pseudocode Converter * * A TypeScript library that converts Java source code into IB Computer Science * pseudocode format according to the official IB specification. This library is * designed for educational purposes, enabling teachers and students to automatically * convert Java code examples into the standardized pseudocode format used in the * IB Computer Science curriculum. * * ## Features * * - **Complete Java Syntax Support**: Variables, control structures, methods, arrays, and OOP constructs * - **IB Specification Compliance**: Follows official IB pseudocode rules and formatting * - **Intelligent Transformations**: Converts Java naming conventions, operators, and syntax to IB format * - **Comprehensive Error Handling**: Detailed error messages with line numbers for debugging * - **TypeScript Support**: Full type definitions for enhanced development experience * - **Educational Focus**: Designed specifically for IB Computer Science curriculum needs * * ## Quick Start * * ```typescript * import { JavaToIBConverter } from 'java-to-ib-pseudocode'; * * const converter = new JavaToIBConverter(); * const result = converter.convert('int x = 5;'); * * if (result.success) { * console.log(result.pseudocode); // Output: X = 5 * } else { * console.error('Conversion failed:', result.errors); * } * ``` * * ## Main Exports * * - {@link JavaToIBConverter} - The main converter class * - {@link ConversionOptions} - Configuration options for conversion * - {@link ConversionResult} - Result object containing converted pseudocode and metadata * - {@link ConversionError} - Error information for failed conversions * - {@link Lexer} - Low-level lexical analyzer (for advanced use) * - Various type definitions and enums for TypeScript support * * @packageDocumentation */ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; Object.defineProperty(exports, "__esModule", { value: true }); // Export the main converter class and types __exportStar(require("./converter"), exports); __exportStar(require("./types"), exports); // Export lexer for advanced users who need low-level access __exportStar(require("./lexer"), exports); //# sourceMappingURL=index.js.map