COMP2000 Assignment 4 Cross-reference solved

$35.00

Category: You will receive a download link of the .ZIP file upon Payment

Description

5/5 - (1 vote)

Name of program: crossref.c
Write a program to produce a cross-reference listing of the user identifiers in a C program.

Output consists of the given program with the lines numbered. This is followed by an alphabetical listing of the identifiers; each identifier is followed by the line number(s) in which the identifier appears. Identifiers within string constants (delimited by double quotes) or comments (delimited by /* and */) are not to be included. Identifiers within // comments are not to be included. Identifiers within single quotes (character constants) are not to be included. Reserved words are not to be included.

Identifiers must be kept in a binary search tree and the line number(s) for a given identifier held on a linked list.

Input: List of reserved words (in no particular order and any number per line) terminated by the word ENDOFLIST. This is followed by the program to be cross-referenced.