/compiler-frontend

A simple C-like compiler front-end, which can compile the source program into three address intermediate code.

Primary LanguageC++

Compiler Frontend

A simple C-like compiler front-end, which can compile the source program into three address intermediate code.

The project is implemented with C++ language, including lexical scanner, LR syntax parser, semantic analysis and intermediate code generation.

  • Lexical Scanner: include character input processing, token recognition, symbol table processing, error processing and token output functions.
  • LR Syntax Parser: use custom grammar, include state generation processing, analysis table construction, analysis stack processing, error processing and general control program.
  • Semantic Analysis and Intermediate Code Generation: achieve grammar guided translation.

Install

git clone https://github.com/zhangjunhui6/compiler-frontend

Usage

Open and run with visual studio 2019 / 2022 on Windows system

Demo