Programming assignment 3

To turn in this assignment, please submit the single file Npda.java to Moodle.

This assignment consists of a single task. Download the code and documentation for programming assignment 3, and complete the Npda class so that the accept() method works correctly. Naturally, the program should work not just on the provided test file (testnpda.txt), but on any other legitimate npda file.

Please edit and submit only the file Npda.java. In addition, please add code only at the locations marked by the string PROGASST3.

Completion of this assignment requires knowledge of (i) recursion, (ii) the Java Stack<> class, and (iii) the clone() method for Java objects. These will be briefly discussed in class, but if this proves insufficient, please seek help from a classmate or the instructor. (The simple example of recursion discussed in class is available: Node.java.)

The grade for this assignment will reflect: correctness of the code (50%); elegance of the design (25%); legibility and quality of comments (25%). Please see the main programming assignment web page for more details on what constitutes high-quality code.