Question: create a c program that fulfills the requirements 1. Prompt the user to enter a filename to parse. This file should be opened, checked to

create a c program that fulfills the requirements
create a c program that fulfills the requirements 1. Prompt the user
to enter a filename to parse. This file should be opened, checked

1. Prompt the user to enter a filename to parse. This file should be opened, checked to make sure it was correctly opened, and closed. 2. Detect the comments denoted by // (comments surrounded by // are extra credit). Since comments are ignored by compilers, we will not look at characters such as \{(D)) that appear within comments. 3. Detect and track the {(D)} characters. Ensure that: a. For every {([ there is a ])} b. That the order that these characters appear follows C syntax rules, Specifically, the type of the last parenthesis-like opening character must be matched with a closing character of the same type, before any other parenthesis-like character appears. Valid combinations include: {(Z]} and {((O)]D){}. Invalid combinations include: {(}) and {([}). c. Hint: The best data structure to solve this problem is a stack. You can implement this stack using an array. 4. Output: a. If there are no syntax errors, follow the gcc tradition and print absolutely nothing. b. If there is a syntax error, report the line number on which it was detected, and give as specific of an error message as you can

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!