Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Understanding Databases Concepts And Practice

Authors: Suzanne W Dietrich

1st Edition

1119827949, 9781119827948

More Books

Students also viewed these Databases questions

Question

Explain the function and purpose of the Job Level Table.

Answered: 1 week ago