Question: 1 . General This assignment involves writing a scanner for C - - . This scanner will then be used for the remaining assignments in

1. General
This assignment involves writing a scanner for C--. This scanner will then be used for the remaining
assignments in the semester project.
2. Required functionality
2.1. Programming requirements
Your program should implement a function get_token() that behaves as follows:
It reads input from stdin.
It discards comments and whitespace (however, even though comments and whitespace are
discarded, they are significant in that they signal the end of any previous token). The syntax for
comments is given in Section 1.3 of the G0 language spec.
It identifies and returns tokens based on the tokens and patterns given in Section 1.2 of the G0
language spec.
Your program should use the following two files:
scanner.h -- a header file that defines the set of tokens together with their values; and
scanner-driver.c -- a file containing the driver code that invokes your scanner and prints out the
results.
In subsequent assignments we will replace the driver file scanner-driver.c with a different driver, so you may
not want to put your scanner implementation in this file.
You should submit a Makefile that provides (at least) the following targets:
make clean:
Deletes any object files (*.o ) as well as the file 'scanner'
make scanner:
Compiles all the files from scratch and creates an executable file named 'scanner'.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!