Computers and Technology
Computers and Technology, 19.11.2019 01:31, kelly3215

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.

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 12:10, tragesserj
1. declare a constant named cents_per_pound and initialize with 25. 2. get the shipping weight from user input storing the weight into shipweightpounds. 3. using flat_fee_cents and cents_per_pound constants, assign shipcostcents with the cost of shipping a package weighing shipweightpounds.
Answers: 2
image
Computers and Technology, 22.06.2019 22:00, noeminm105
Consider the following declarations (1, 2, 3, 5, 7)class bagtype{public: void set(string, double, double, double, double); void print() const; string getstyle() const; double getprice() const; void get(double, double, double, double); bagtype(); bagtype(string, double, double, double, double); private: string style: double l; double w; double h; double price; }; a.) write the definition of the number function set so that private members are set according to the parametersb.) write the definition of the member function print that prints the values of the data membersc.) write the definition of the default constructor of the class bagtype so that the private member variables are initialized to "", 0.0, 0.0, 0.0, 0.0, respectively d.) write a c++ statement that prints the value of the object newbag. e.) write a c++ statement that declares the object tempbag of type bagtype, and initialize the member variables of tempbag to "backpack", 15, 8, 20 and 49.99, respectively
Answers: 3
image
Computers and Technology, 23.06.2019 06:40, euniceyi56
How many nibbles can be stored in a 16-bit word?
Answers: 1
image
Computers and Technology, 23.06.2019 17:00, quanharris2k19
The camera still is bad even with the new iphone xr and especially in low light it is even worst because you can see the pixels more if its in low light. if all you apple customers want apple to fix this then lets fill there feedback with complaints about the
Answers: 1
Do you know the correct answer?
In most programming languages, the compiler carries a preprocessing step to determine if certain sta...

Questions in other subjects:

Konu
Mathematics, 25.02.2021 22:10
Konu
Chemistry, 25.02.2021 22:10
Konu
Mathematics, 25.02.2021 22:10