Developing a C compiler

The compiler is an essential tool in the software development process, and the development of a compiler encapsulates many advanced concepts in the realm of computer science. In this project, a C compiler is developed from scratch. The compiler is capable of translating C11-compliant source code int...

Full description

Bibliographic Details
Main Author: Zhong, Ruoyu
Other Authors: Huang Shell Ying
Format: Final Year Project (FYP)
Language:English
Published: Nanyang Technological University 2024
Subjects:
Online Access:https://hdl.handle.net/10356/175271
_version_ 1811690979430760448
author Zhong, Ruoyu
author2 Huang Shell Ying
author_facet Huang Shell Ying
Zhong, Ruoyu
author_sort Zhong, Ruoyu
collection NTU
description The compiler is an essential tool in the software development process, and the development of a compiler encapsulates many advanced concepts in the realm of computer science. In this project, a C compiler is developed from scratch. The compiler is capable of translating C11-compliant source code into the target machine's native code. It is designed with a modern, modular architecture with seven major components, including the lexer, the parser, the semantic analyser, the intermediate code generator, the target-independent optimiser, the target-specific optimiser, and the code generator. LLVM Core libraries are used to support the code generation and optimisation stages. Special techniques are employed to address the implementation challenges, which include recovery of symbol table state in backtracking, disambiguation of typedef names with identifiers, and inference of complex type names.
first_indexed 2024-10-01T06:12:36Z
format Final Year Project (FYP)
id ntu-10356/175271
institution Nanyang Technological University
language English
last_indexed 2024-10-01T06:12:36Z
publishDate 2024
publisher Nanyang Technological University
record_format dspace
spelling ntu-10356/1752712024-04-26T15:44:13Z Developing a C compiler Zhong, Ruoyu Huang Shell Ying School of Computer Science and Engineering ASSYHUANG@ntu.edu.sg Computer and Information Science Compiler C LLVM The compiler is an essential tool in the software development process, and the development of a compiler encapsulates many advanced concepts in the realm of computer science. In this project, a C compiler is developed from scratch. The compiler is capable of translating C11-compliant source code into the target machine's native code. It is designed with a modern, modular architecture with seven major components, including the lexer, the parser, the semantic analyser, the intermediate code generator, the target-independent optimiser, the target-specific optimiser, and the code generator. LLVM Core libraries are used to support the code generation and optimisation stages. Special techniques are employed to address the implementation challenges, which include recovery of symbol table state in backtracking, disambiguation of typedef names with identifiers, and inference of complex type names. Bachelor's degree 2024-04-23T05:36:26Z 2024-04-23T05:36:26Z 2024 Final Year Project (FYP) Zhong, R. (2024). Developing a C compiler. Final Year Project (FYP), Nanyang Technological University, Singapore. https://hdl.handle.net/10356/175271 https://hdl.handle.net/10356/175271 en SCSE23-0413 application/pdf Nanyang Technological University
spellingShingle Computer and Information Science
Compiler
C
LLVM
Zhong, Ruoyu
Developing a C compiler
title Developing a C compiler
title_full Developing a C compiler
title_fullStr Developing a C compiler
title_full_unstemmed Developing a C compiler
title_short Developing a C compiler
title_sort developing a c compiler
topic Computer and Information Science
Compiler
C
LLVM
url https://hdl.handle.net/10356/175271
work_keys_str_mv AT zhongruoyu developingaccompiler