Java program that simulate the actions of a preprocessor
In most programming languages, the compiler carries a preprocessing step to determine of certain statements will compile. For instance it may check to see if parentheses match. Write a Java program that simulate the actions of a preprocessor to will detected of certain Java constructs are syntactically correct. 1. In your implementation design a class called Preprocessor that accepts a string that represents the statement to be analyzed. The class will contain, among other possible method, a method that determines whether or not the given statement is valid, with respect to the delimiters of Table 2. Do not be concerned with other symbols. 2. You will need a test class. You may want to name it MyPreprocessor. 3. You may have to enter all statements on a single line, unless you will be reading the input from a file, in which the file would be read using presumable the class BufferedReader or LineNumberReader. 4. Your output would echo the input, and say whether or not the input passed the preprocessing stage.
You'll get a 8.5KB .RAR file.