subject

In most programming languages, the compiler carries a preprocessing step to determine if certain statements will compile. for instance it may check to see if parentheses match. write a java program that simulates the actions of a preprocessor, to detect if certain java constructs are syntactically correct. table 1 shows the types of java statement formats under consideration, and also example of each statement. table 1 format examplestatement data_type = expression int x = 3 + (10 – 4) * ( 10 + 4)method rt name() public void display(int n) { { int arr[ ] = new int[n]; } system. out. println( x[2] ); }class class name public class myparser { { dt fields; public static void main(string [ ] arg) name() { { display (10); method(); } } static void display(int x) { { /* } my pre-processor */ } }table 2 shows the delimiters under consideration. table 2 delimiters symbol left parenthesis ( right parenthesis ) left curly braces { right curly braces } left square brackets [ right square brackets ] forward slash / star (multiplication symbol) *note: in your implementation, design a class called preprocessor that accepts a file that represents the program to be analyzed. the class will contain, among other possible methods, a method that determines whether or not the statement in the file are valid, with respect to the delimiters of table 2. do not be concerned with other symbols.1. you will need a test class. you may want to name it mypreprocessor.2. you may have to enter all statements on a single line, unless you will be reading the input from a file, in which case the file would be read using presumable the class bufferedreader or linenumberreader.3. your output would echo the input, and say whether or not the input passed the preprocessing stage.4. you are to use the concept of stack to determine if the constructs are syntactically correct.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:30
Dave has to create animations for a game. which tool can dave use?
Answers: 3
question
Computers and Technology, 23.06.2019 07:00
You need a quick answer from a coworker. the most effective way to reach your coworker is through a. cloud server b. instant message c. teleconference d. telepresence
Answers: 1
question
Computers and Technology, 23.06.2019 19:50
Which feature is selected to practice and save the timing of a presentation
Answers: 1
question
Computers and Technology, 23.06.2019 22:20
What is a programming method that provides for interactive modules to a website?
Answers: 1
You know the right answer?
In most programming languages, the compiler carries a preprocessing step to determine if certain sta...
Questions
question
Mathematics, 04.12.2021 15:00
question
Mathematics, 04.12.2021 15:00
question
English, 04.12.2021 15:00
question
Physics, 04.12.2021 15:00
question
Mathematics, 04.12.2021 15:00
question
English, 04.12.2021 15:10
question
Mathematics, 04.12.2021 15:10
Questions on the website: 13722367