[SOLVED] CCUCD - Compiler Design - Project 1 Lexical Analyzer

30.00 $

Programming resource
Digital learning resource
Category:
Practical programming resource
Suitable for guided study and reference
Tutor guidance available when needed

Description

5/5 - (1 vote)

The goal of our project this semester is to develop a prototype C compiler. This is done by compiling C programs into processors such as x86, MIPS, ARM, or pseudo assemblies.   In this    class, we     will    use     Java   assembly     code   (Jasmin, http://jasmin.sourceforge.net/) as the target code. The project is divided into several parts including language definition, lexical analyzer, C-grammar, symbol table handlings, parser, and code generation. In the first part, you will need to choose the set of language features you want to support in your compiler, and write the lexical analyzer.

 

You need to have the followings:

  • To define the subset of the language which you want to choose from C.
  • Give a set of testing programs that can illustrate the features of your C compiler. (at least 3 test programs)
  • Use the “ANTLR” to help you develop the lexical analyzer.
  • You can use C, C++, Java, or other programming languages to write your lexical analyzer. (Java is recommended)
  • Output the token-type and content of each token.

Token:1  int

Token:4  <=

 

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.