compiler design limit the loops, JAVA Programming

Assignment Help:
Problem : Compiler Design - Limit the loops
Rajni is a newbie to the programming and while learning the programming language he came to know the following rules:
???• Each program must start with ''''{'''' and end with ''''}''''.
???• Each program must contain only one main function. Main function must start with ''''<'''' and end with ''''>''''.
???• A program may or may not contain user defined function(s). There is no limitation on the number of user defined functions in the program. User defined function must start with ''''('''' and end with '''')''''.
???• Loops are allowed only inside the functions (this function can be either main function or user defined function(s)). Every loop must start with ''''{'''' and end with ''''}''''.
???• User defined function(s) are not allowed to be defined inside main function or other user defined function(s).
???• Nested loops are allowed.
???• Instructions can be anywhere inside the program.
???• Number of loops inside the program must not be more than 100.
If any of the above conditions is not satisfied, then the program will generate compilation errors. Today Rajni has written a few programs, but he is not sure about the correctness of the programs. Your task is to help him to find out whether his program will compile without any errors or not.
Input Format:

First line starts with T, number of test cases. Each test case will contain a single line L, where L is a program written by Rajni.
Output Format:

Print "No Compilation Errors" if there are no compilation errors, else print "Compilation Errors".
Constraints:
1<=T<=100
L is a text and can be composed of any of the characters {, }, (, ), <, >and P, where P will represents the instruction.
L, comprised of characters mentioned above should be single spaced delimited.
Number of characters in the text, |L| < = 10000
Sample Input and Output
SNo. Input Output
1
3
{ < > ( P ) }
{ < { } > ( { } ) )
{ ( { } ) }
No Compilation Errors
Compilation Errors
Compilation Errors

Related Discussions:- compiler design limit the loops

Basic java, Why is Java platform independent / architecturally neutral / po...

Why is Java platform independent / architecturally neutral / portable?

What are logic- or time-bombs, What are Logic- or Time-Bombs ? It execu...

What are Logic- or Time-Bombs ? It execute the payload while predetermined event occurs. For instance use kind's particular phrase and particular data is reached.

Explain rmi architecture, RMI uses a layered architecture; every of the lay...

RMI uses a layered architecture; every of the layers could be increased or replaced without affecting the rest of the system. The details of layers can be summarised as follows:

What are the advantages of jms, One of the principal benefits of JMS messag...

One of the principal benefits of JMS messaging is that it's asynchronous. Thus not all the pieces require to be up all the time for the application to function as a whole.

Describe java operators, Describe java operators? An operator is a symb...

Describe java operators? An operator is a symbol which operates on one or more arguments to generate a result. The Hello World program is so easy it doesn't use any operators,

Describe two reasons driving the termination of processes, Question 1: ...

Question 1: (a) Describe two reasons driving the termination of processes. (b) Discuss the five main steps the OS would implement once it has decided to create a new proc

Overview of struts?, Struts is a framework with set of co operating servlet...

Struts is a framework with set of co operating servlets, classes and JSP tags that create a reusable MVC 2 design.     1. Client (Browser) : A request from the cli

Write a program of student using a class, Write a program of student Using ...

Write a program of student Using a Class Objects of a class are always created on heap using "new" operator followed by constructor Student s = new Student ( ); // no po

Explain drawing rectangles in java, Explain Drawing Rectangles in java ? ...

Explain Drawing Rectangles in java ? Drawing rectangles is easy. Begin with a Graphics object g and call its drawRect() method: public void drawRect(int x, int y, int width, i

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd