github.com/DanArmor/micro-Pascal ↗
Синтаксический анализатор языка micro-Pascal
Open this visualization on its own page →
Contributors
1
Lines of Code
281
From
2022-04-03
To
2022-04-22
About DanArmor/micro-Pascal
Micro-Pascal is a syntax analyzer written in C++ that parses micro-Pascal source code and generates an abstract syntax tree. The project consists of three main components: a lexer that tokenizes the input program, a syntax parser that builds the tree from tokens, and various visitor classes that traverse and process the tree for different purposes. For example, the GraphvizVisitor generates visual representations of syntax trees, while other visitors can perform different analyses or transformations.
The project is educational in scope and demonstrates compiler design concepts including lexical analysis, parsing, and tree-based program representation. It includes comprehensive documentation generated by Doxygen, syntax diagrams defined in Backus-Naur form, and class hierarchy diagrams using PlantUML. The codebase is well-documented with Doxygen comments throughout, enabling better code intelligence in IDEs and making it suitable for learning purposes.
The implementation uses several external libraries and tools: magic_enum for runtime enum introspection, Graphviz for tree visualization, Google Test for unit testing, and Valgrind for memory leak detection. The project maintains code quality through Codacy analysis and ClangFormat formatting standards. Test programs and examples are provided in dedicated directories, and the repository includes detailed object models and class diagrams to help understand the architecture.