Skip to content

sparshb/Compilers-Lab

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 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.

About

A compiler for C like Language.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Yacc 50.9%
  • C 44.5%
  • C++ 3.3%
  • Lex 1.3%