/MiniC-Compiler

A compiler for a subset of C language

Primary LanguageC

MiniC-Compiler

Note : Find all reports in Reports/

A compiler for a subset of C language

Lex helps write programs whose control flow is directed by instances of regular expressions in the input stream. It is well suited for editor-script type transformations and for segmenting input in preparation for a parsing routine. Using Lex we will design a lexical analyser for a subset of the C language.

  • It will support nested while loops.
  • It will support the char and int datatype and its subtypes (short, long, default).
  • It will read the character stream and return the appropriate tokens types.
  • It will recognise keywords supported by the C language.
  • It will support nested comments.
  • Appropriate error messages will be returned.
  • With the help of hash tables, symbol and constants table will be generated and maintained.
  • Functions scanning will be supported.
  • Error checking like unending strings, comments will be taken care of.
  • The scanner output will be presented in accordance with the guidelines provided in the course plan.
  • Most of the C operators will be supported