Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Problem statement

Imagine the syntax of a programming language construct such as while-loop --

while ( condition ) 
begin 
      statement ; 
            : 
end

where while, begin, end are keywords; condition can be a single comparision expression (such as x == 20, etc.); and statement is the assignment to a location the result of a single arithmatic operation (eg., a = 10 * b).
Write a program that verifies whether the input follows the above syntax. Use flex to create the lexical analyser module and write a C program that performs the required task using that lexical analyser.

How to run

  • Important: flex must be installed. To install flex run sudo apt install flex
  • Run: ./script.sh
  • Input: write a simple while loop program in test.c
  • Generates an intermediate file inter