Skip to content

Rohitjk/Compiler-for-subset-of-C

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Compiler-for-subset-of-C

A compiler for subset of C using lex and yacc.

Getting Started

Prerequisites

lex
yacc

Running the tests

chmod -x compile
./compile
./parser test-case.txt

Features

  • Nested code blocks
  • +=, -= supported
  • for loops and nested for loops
  • integer assignment and declaration
  • if-else handled
  • array assignment, array declaration
  • comma separated initialization/declaration e.g int a=10,b;
  • support for short, long , long long , signed and unsigned
  • while statements supported
  • unary expressions supported in both lhs, rhs and standalone statements
  • display specific errors with line numbers

Built With

  • LEX
  • YACC

About

A compiler for subset of C using lex and yacc.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published