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

Program that can read the obj file - wireframe model, We need an OpenGL - b...

We need an OpenGL - based visualisation of an OBJ-File that was created out of Maya3D. (important: we have to use OpenGL with Java - JOGL) In other words: we have an OBJ-file (a

Describe the if statement in java, Describe the if statement in Java ? ...

Describe the if statement in Java ? All but the most trivial computer programs required to form decisions. They test a condition and operate in a different way based on the out

Tictactoe, write complete application to play game tictactoe

write complete application to play game tictactoe

What types of new jobs are created because of computing, What types of new ...

What types of new jobs are created because of computing? And that old professions are being eliminated? Because of computing whereas people are getting benefits from automated

Alreadyboundexception thrown and by which method, When is AlreadyBoundExcep...

When is AlreadyBoundException thrown and by which method? Ans) AlreadyBoundException is thrown by bind(String name) method when a remote object is already registered with the re

Inner, #question.Hi, i hope my message find you very well. could you help m...

#question.Hi, i hope my message find you very well. could you help me please with this question . provide an example code for an anonymous inner class. Highlight what makes your e

Write a quality and complexity analysis report, In the context of this cour...

In the context of this course work, you are asked to write a quality and complexity analysis report by applying programming design and implementation metrics for the AnagramGame Ja

Describe interfaces in java langauge, Describe Interfaces in java langauge?...

Describe Interfaces in java langauge? Interfaces are the further level of abstraction. An interface is like a class along with nothing but abstract methods and final, static fi

Implement the list calss, Your next task is to implement the MovieList clas...

Your next task is to implement the MovieList class that manages the details for a list of DVD Movies read from the specified data file. The constructor will include a parameter tha

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