Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program which contains a lexical analyzer for the VSL programming language describe in the document posted on Blackboard. The input to the program

image text in transcribed

Write a program which contains a lexical analyzer for the VSL programming language describe in the document posted on Blackboard. The input to the program is a VSL program. The output will be a sequence of (lexeme.token) pairs. You are to wire your lexical analyzer using lex or flex, or you can hand code the program with a 'reasonable" programming language (Java. C. Ada. or Python.) How you handle reserved words (like if. while, etc.) is up to you. You can preload the symbol table with them. OR you can have the lexical analyzer hand e them as a special case. For example if your program is: program var N as int; var squareroot as int; begin N: reading; SORT: = 0; % go until squareroot := squareroot N do squareroot + 1; end; squareroot := squareroot - 1;% subtract one squareroot is lessthanorequalto squareroot (N) write Int squareroot end your output would look look something like this; etc. Write a program which contains a lexical analyzer for the VSL programming language describe in the document posted on Blackboard. The input to the program is a VSL program. The output will be a sequence of (lexeme.token) pairs. You are to wire your lexical analyzer using lex or flex, or you can hand code the program with a 'reasonable" programming language (Java. C. Ada. or Python.) How you handle reserved words (like if. while, etc.) is up to you. You can preload the symbol table with them. OR you can have the lexical analyzer hand e them as a special case. For example if your program is: program var N as int; var squareroot as int; begin N: reading; SORT: = 0; % go until squareroot := squareroot N do squareroot + 1; end; squareroot := squareroot - 1;% subtract one squareroot is lessthanorequalto squareroot (N) write Int squareroot end your output would look look something like this; etc

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals Design

Authors: Marion Donnie Dutton Don F. Seaman

14th Edition Globel Edition

1292107634, 978-1292107639

More Books

Students also viewed these Databases questions