Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
ITP4510 DSA: Concepts & Implementation
A Cross-Reference Map for a program is a list of all the identifiers employed in the program, along
with the line numbers on which they appear. It is often useful that a programmer has this information
on his or her hand during the debugging stage of programming.
Identifiers are words used in programs to name variables, classes, methods, or labels and are
subjected to strict rules. None of the Java keywords/reserved words may be used as identifiers.
An identifier can begin with a letter, a dollar sign ($) or an underscore character ( _ ). The following
is a list of Java keywords/reserved words for your reference.
zero-length String or null will be ignoredIMPLEMENTATION REQUIREMENTS:
Employ the techniques discussed in the ITP4510 DSA teaching materials to develop the linked
list package (use of interface, comparator and list exceptions are recommended).
Use an array to hold the Java keywords/reserved words in ascending or descending order.
Devise an efficient searching algorithm (linear or binary search) for the ordered keyword array.
The searching is used to determine if a given token/word is a java keyword or an identifier.
Tokenize the Java source using the code provided in the Tokenizer section.
Implement exception handlers for your program. Specifically, you may want to define custom
exception to catch illegal identifiers that are extracted by the Tokenizer.
Format the program output as close as possible to the sample outputs given. The first part of the
output is the source labelled with line number and the second part is the cross-reference map.
Except the number of total identifier found, you should provide more statistical data pertaining
to the input Java file.
This tokenizer will extract Java program tokens from the string parameter based on the DELIMITER. It
returns an array of strings/tokens. Sample program elements recognized by the tokenizer are identifier,
keyword, numeric literal, and character literal. It will also return invalid elements like unclosed string.
Refer to the note “2 – Exception” for an example on split method.
INSTRUCTIONS:
1. This assignment is an individual assignment and each student submits his/her own work.
Plagiarism is a serious offence and any assignments that involve any plagiarism will be given
ZERO marks. The award of Zero marks will apply to all parties, regardless of whether a student
is the original author or the plagiarist. Further disciplinary action will follow.
2. You are asked to include the following documentation at the top of your program.
3. You are NOT ALLOWED to use data structure classes provided by Java API. You must use the
linked list (and/or other data structures) developed in this module for the assignment. However,
it is at your discretion on extending the classes with attributes/methods to suit your case.
Page 3Page 4
4. Your programs must follow the coding standard stated in Java coding standard maintained by
Oracle.
Marks will be deducted if the coding standard is not followed.
5. Program, class and method documentation are essential. Inline comments should be placed as
appropriate. User-defined names should be descriptive as much as possible. Marks are given
based on correctness, readability, style and quality.
6. All work is to be submitted to Moodle on/before 13 th April 2024 11:59pm. Late submission
without valid reasons will be given ZERO mark.