Question: You will implement a syntax - checking program that mimics a function of a compiler. While compilers identify syntax errors, they often generate numerous diagnostic
You will implement a syntaxchecking program that mimics a function of a compiler. While compilers identify syntax errors, they often generate numerous diagnostic messages when a single symbol is missingsuch as a missing brace or comment startermaking it difficult to pinpoint the actual issue. To address this, your program will check for balanced symbols. This means that every right brace, bracket, and parenthesis must correspond to its left counterpart. For example, the sequence is valid, while is not. Your program should be implemented in following: Read a file ex: HelloWorld.java or HelloWorldwrong.java as an input file HelloWorld.java Check syntax errors pair of and Display output ex: No syntax errorSyntax errors occurred Test Scenarios: If the input file is HelloWorld.java, the output should be No syntax errors If the input file is HelloWorldwrong.java, the output should be Syntax errors occurred For your sample test file: o If the file contains syntax errors, the output should be Syntax errors occurred o If the file does not contain syntax errors, the output should be No syntax errors
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
