/C-Compiler

Front end of a compiler for a subset of the C Language.

Primary LanguageYacc

C-Compiler

Implementation of the front end of a compiler for a subset of C language.

Components

  • Symbol Table

    • Written in C++.
    • Produces a hash table for mapping variables used in the source program to tokens.
  • Lexical Analyzer / Scanner

    • Written in flex.
    • Generates tokens from lexemes and reports lexical errors.
  • Syntax and Semantic Analyzer / Parser

    • Written in yacc / bison.
    • Parses the tokens generated by the scanner according to specified grammar rules.
    • Reports syntax and semantic errors.
    • Takes actions for error recovery for some syntax errors.
  • Intermediate Code Genarator

    • Produces intel 8086 assembly language code from source C code.
    • Optimizes the assembly code.