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 08:00
Apex q: what does a low employment rate indicate? a. not many people are earning high salaries b. not many people are going to college c. not many people are renting their homes d. not many people have jobs
Answers: 2
question
Computers and Technology, 24.06.2019 06:00
Hey i really need some solving this problem: 1. encrypt this binary string into cipher text: 110000. include in your answer the formula the decoder would use to decrypt your cipher text in the format (coded answer) x n mod (m) = y & 2. decrypt this cipher text into a binary string: 106 you.
Answers: 2
question
Computers and Technology, 24.06.2019 09:50
Self contained sequences of actions to be performed are? a. expressions b. algorithms c. functions d. formulas
Answers: 1
question
Computers and Technology, 24.06.2019 14:30
Ahousehold consists of a married couple and their twin five-year old daughters. the couples children had no income and lived with their parents all of last year. how many exemptions can the couple claim on last years tax return or they file with the “ married filing jointly “ status? a. 4 b. 5 c. 3 d. 2
Answers: 1
You know the right answer?
In most programming languages, the compiler carries a preprocessing step to determine if certain sta...
Questions
question
Chemistry, 14.10.2020 18:01
question
Chemistry, 14.10.2020 18:01
question
Mathematics, 14.10.2020 18:01
question
History, 14.10.2020 18:01
question
Mathematics, 14.10.2020 18:01
question
Mathematics, 14.10.2020 18:01
question
Mathematics, 14.10.2020 18:01