Question: Write a C++ program that checks for unmatched parenthesis/brackets in a given input program. Unmatched braces are not considered invalid if they are part of

Write a C++ program that checks for unmatched parenthesis/brackets in a given input program. Unmatched braces are not considered invalid if they are part of comments or char/string literals (char c=) is a valid statement). The program should take the name of the input file as a command line argument. Run ./a.out program1.cpp The output should display either: Syntax ERROR: Missing brace type OR Hurray! All parenthesis are balanced! You will be provided with 3 test input files (prog1.cpp, prog2.cpp, and prog3.cpp), your program should correctly for all 3 of them. Display the line number on which the error occurs

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!