Home Experiences Projects Awards Blogs
Back

Pascal-S Compiler

C++
No image

Description

This project implements a compiler for Pascal-S, a simplified subset of the Pascal programming language. The compiler performs lexical analysis using Deterministic Finite Automaton (DFA), syntax analysis using Recursive Descent Parser, and semantic analysis with type checking and symbol table construction.

Project Milestones:

Milestone 1 - Lexical Analysis : Lexer using DFA to tokenize Pascal-S source code

Milestone 2 - Syntax Analysis : Parser using Recursive Descent to build Parse Tree from tokens

Milestone 3 - Semantic Analysis : Semantic Analyzer for type checking and symbol table construction

The compiler will execute three stages sequentially:

  1. Lexical Analysis - Tokenizes the source code using DFA
  2. Syntax Analysis - Builds Parse Tree using Recursive Descent Parser
  3. Semantic Analysis - Constructs AST and Symbol Table with type checking

Project Structure

KFA-Tubes-IF2224/
├── src/                    # Source code
│   ├── main.cpp           # Entry point
│   ├── lexer/             # Lexical analyzer (DFA-based tokenizer)
│   ├── parser/            # Syntax analyzer (Recursive Descent)
│   └── semantic/          # Semantic analyzer (AST & Symbol Table)
├── config/                 # Configuration files
│   └── lexer.txt          # DFA state transition table
├── test/                   # Test cases for each milestone
│   ├── milestone-1/       # Lexical analysis tests
│   ├── milestone-2/       # Syntax analysis tests
│   └── milestone-3/       # Semantic analysis tests
├── doc/                    # Documentation and reports
└── CMakeLists.txt         # CMake build configuration

Contributors

NIM Name
13523063 Syahrizal Bani Khairan
13523091 Carlo Angkisan
13523095 Rafif Farras
13523101 Barru Adi Utomo