Question: Use Java to solve this following problem: Write a program that will take a Java file as input, parse it and output an annotated version.

Use Java to solve this following problem:

Use Java to solve this following problem: Write a program that will

Write a program that will take a Java file as input, parse it and output an annotated version. Your program will track the nesting depth of the braces of the input file and will output an annotated version of the file. Your final program will list the nesting depth of curly braces ignore braces inside quotes or comments Use Java, Perl, or Python. As mentioned in class, if you want to use any other language, talk to the TA or the instructor first. Assume that all quoted strings begin and end on the same line. Extra credit opportunity (up to 5%) Handle block comments that cross multiple lines of the input file./* comment with ignored brace {*/Sample INPUT: import blah; class Foo {void Foo() {System. out. Println ("braces are fun! {{{{{");//ignored if (condition) {//also ignored: {int a - 1;//as is this:})}}//end of program Sample annotated OUTPUT: 0 import blah; 0 class Foo 1 {1 void Foo() 2 {2 System. out. Println ("braces are fun! {{{{{");//ignored 2 if (condition) 3 {3//also ignored: {3 int a = 1; 3//as is this:} 3} 2} 1} 0//end of program

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!