Skip to content

harshitag456/Compilers-Lab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Compilers-Lab

A compiler for C like Language.

Flex is used for Lexical Analysis and Bison is used for syntax and semantic Analysis.

The language supports arithmetic, relational, logical operators( with short-circuiting), iterative and conditional statements(with nesting), functions, primitive data types.

How to Run

These are the commands to be executed :-

  • bison -d bison.y
  • flex flex.l
  • g++ -std=c++11 bison.tab.c lex.yy.c
  • ./a.out < input.cpp

bison.tab.c and lex.yy.c files are automatically generated from the execution of first two commands.

input.cpp is the name of the file containing C language code which is to be compiled.

Some Sample C code files and their corresponding Intermediate Code output are also available.

About

A compiler for C like Language.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published