Compiler – Lab Assignment 2- Lexical Analysis (Solution)

$ 29.99
Category:

Description

In this assignment, you will work on implementing a lexical analyzer in your preferred programming language. We will consider some basic constructs (e.g., if-else statements), understand what are the different tokens (and patterns for the tokens) in the considered language/constructs.
Implement a lexical analyzer (using any programming language) for the considered tokens/patterns. Your program should take a statement as input and return the sequence of tokens as output.
————————————————————————————————————————————-
Let us consider the example grammar for branching statements given below:

The patterns for the tokens in the language are described below:

Implement a lexical analyzer using any programming language. Your program should take a statement as input and return the sequence of tokens as output.
———————————————————————————————————————————–
– Example Input: if input<10 then output1=100 else output2>=100

– Expected output:

Reviews

There are no reviews yet.

Be the first to review “Compiler – Lab Assignment 2- Lexical Analysis (Solution)”

Your email address will not be published. Required fields are marked *