[SOLVED] 代写 html compiler CS 441 – Fall 2019 Homework 3 Due: Tue Dec 10

30 $

File Name: 代写_html_compiler_CS_441_–_Fall_2019_Homework_3_Due:_Tue_Dec_10.zip
File Size: 640.56 KB

SKU: 8316741003 Category: Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Or Upload Your Assignment Here:


CS 441 – Fall 2019 Homework 3 Due: Tue Dec 10
Write a lex script that “lexemizes” and validates input for a calculator, using the specifications given below. Write it in a text file called calc.l
Input to the scanner program should be from the standard input, and output to the standard output. The scanner should print one lexeme per line. When an error is found, it should print “error” followed
by the current yytext on a line. Note scanning will continue after an error until end of input. Use lex to create the scanner program:
lex calc.l creates lex.yy.c Use gcc to compile the scanner program with the –flf options:
gcc –lfl lex.yy.c creates a.out
A test file, along with my executable (scan), are given on Multilab in:
~kwjoiner/441/lex/
You may test the scanner using the test file by redirecting the file into the standard input:
a.out < t.txtYou may also test simply by running the a.out executable. It will wait for you to enter characters into the standard input (keyboard). Press ENTER and it will scan, print results, and wait for more input. To exit the program, use ctrl-d.Calculator Lexeme Specifications:- any sequence of one or more whitespaces constitutes a delimiter between lexemes. Whitespace includes blank, tab and newline. Whitespaces are discarded (should not be output)- A value is defined as:o oneormoredigitso optionallyfollowedby a period (decimal point) followed by one or more digits (so, at least 1 digit after a decimal point)- Simple one-character lexemes include:o operators:+-/*=o parenthesis: ( )- Note:2*-3will parse as2 * – 3and not as2 * -3lex manual:http://dinosaur.compilertools.net/lex/index.html(or search the internet…there are some other lex web sites) Submit in Canvas: only your calc.l file

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[SOLVED] 代写 html compiler CS 441 – Fall 2019 Homework 3 Due: Tue Dec 10
30 $