A Swift-based interpreter for the Pascal programming language, implementing lexer, parser, semantic analyzer, and interpreter components.
SwiftPascalInterpreter is a complete interpreter for the Pascal programming language implemented in Swift. It reads Pascal source code, parses it into an abstract syntax tree, performs semantic analysis, and executes the program. The project serves as a practical example of how interpreters work, covering all stages from lexical analysis to runtime execution.
Developers and students interested in compiler design, language implementation, or learning how interpreters function. It's particularly useful for those exploring Swift or wanting to understand Pascal's execution model.
It provides a fully functional, well-structured interpreter with clear separation of components (lexer, parser, semantic analyzer, interpreter), making it an excellent educational resource. Unlike theoretical explanations, it offers runnable code and examples to experiment with.
Simple Swift interpreter for the Pascal language inspired by the Let’s Build A Simple Interpreter article series.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
The interpreter is cleanly split into lexer, parser, semantic analyzer, and interpreter modules, providing a clear, educational structure as detailed in the README's component descriptions and diagrams.
Includes a CLI utility, Swift Playground, and example Pascal programs like a number guessing game, enabling interactive experimentation and testing without complex setup.
Built following the 'Let’s Build A Simple Interpreter' series, ensuring a pedagogically sound and well-documented approach to language implementation, as noted in the Philosophy section.
Implements standard types, functions, procedures, loops, and arrays, covering essential Pascal language elements as listed in the 'What is implemented' section with working examples.
The semantic analyzer performs only rudimentary validations like variable declaration checks, admitting in the README that it lacks advanced static analysis, type inference, or optimization capabilities.
Requires Swift 5 and Xcode for development and execution, limiting accessibility to developers outside the Apple platform and adding setup complexity for non-iOS environments.
Focused on teaching interpreter concepts, it omits production-ready features such as comprehensive error messages, performance optimizations, or support for modern Pascal extensions like units or dynamic arrays.