-------------------------------------------------------------------- -- a3.ads -- This file is the specification file for the types -- and functions used in the recursive descent -- parser of Assignment 3, CS 152, Fall 2000. -------------------------------------------------------------------- with TEXT_IO; use TEXT_IO; package a3 is -- These types, procedures, and functions -- make up the interface with the test program. -- Note that the parse tree is known to be -- represented by a pointer. type parse_tree is private; type parse_tree_ptr is access parse_tree; -- This function takes the name of a text file, attempts -- to parse the tree using the grammar implemented -- by the parser, and returns a parse tree for the -- text in the file. It returns a dummy tree if the file is -- not found, or the text cannot be parsed. It returns -- an appropriate error message in case either of -- these errors occurs. function parse(filename:string) return parse_tree_ptr; -- This function prints an indented representation -- of an ordered tree, one line per node. procedure traverse(p:parse_tree_ptr); -- This function prints the yield of a parse tree (that is, it -- traverses the leaves). All data is printed on one line. procedure display_yield(p:parse_tree_ptr); private -- your material goes here end a3;