Answered You can hire a professional tutor to get the answer.
Prog := Slist Slist :
a test program for your parser. The program takes zero or one command line argument. If zero command line arguments are specified, the program should take input from the standard input. If one command line argument is specified, the program should use the argument as a file name and take input from that file. If the file cannot be opened, the program should print COULD NOT OPEN followed by the name of the file, and should then stop. If more than one command line argument is specified, the program should print TOO MANY FILENAMES, and should then stop. The result of an unsuccessful parse is a set of error messages printed by the parse functions. If the parse fails, the program should stop after the parse function returns. The assignment does not specify the exact error messages that should be printed out by the parse; however the format of the message should be the line number, followed by a colon and a space, followed by some descriptive text. Suggested messages might include "No statements in program", "Missing semicolon", "Missing identifier after set", etc. The result of a successful parse is a parse tree. Assignment 3 is meant to test that you can properly detect poorly formed programs, and that you can traverse the parse tree for well formed programs. If a parse tree has been generated, it should be traversed to perform various tests.
The following information must be printed out for the parse tree:
1. Number of leaves (Format is LEAF COUNT: N, where N is the number of leaves)
2. Number of string constants (Format is STRING COUNT: N)
3. Number of identifiers (Format is IDENT COUNT: N, where N is the number of identifiers)
4. Comma separated list of the most frequently used identifiers If there are no identifiers, steps 3 and 4 can be skipped NOTE that your program might be graded using different input file names and error cases.
SOLVE THE GENERAL PROBLEM and DO NOT HARDCODE output for test cases.
If there are no identifiers, steps 3 and 4 can be skipped NOTE that your program might be graded using different input file names and error cases. SOLVE THE GENERAL PROBLEM and DO NOT HARDCODE output for test cases.
PART 1: ● Compiles ● Argument error cases ● Files that cannot be opened ● Too many filenames
PART 2: ● Statement lists, statements, and all primaries
PART 3 ● Everything else