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

Liferay especialist and java programmer, Liferay Especialist and Java Progr...

Liferay Especialist and Java Programmer Project Description: We require to make a full functional Portal with online tools. JSF, Java, Portlets, Skills required: CSS

Explain term literals in java, Explain term Literals in java? Literals ...

Explain term Literals in java? Literals are pieces of Java source code which mean exactly what they say. For example "Hello World!" is a String literal and its meaning is the w

Design a program for robot, Assume all the obstacles are of height 4 units ...

Assume all the obstacles are of height 4 units and the blocks are of heights 1 (bottom), 2 (top), 1 and 2 (top) units respectively.  Complete the control() method of the RobotContr

Distributed ticket reservation system, In this programming assignment, you ...

In this programming assignment, you are going to implement the simple distributed ticket reservation system (DTRS) from Assignment 1 in CORBA using Java IDL. In addition to the thr

Starting in new app, iam trying to build an application that store informat...

iam trying to build an application that store information like name mobile age in a file its like a registration form everytime i enter a new person data i want the applicaion mak

Pebble merchant, There is a pebble merchant. He sells the pebbles, that are...

There is a pebble merchant. He sells the pebbles, that are used for shining the floor. His main duty is to take the length of the room’s sides. But he sometimes mistakes doing tha

What is dispatchaction, The DispatchAction class is used to group related a...

The DispatchAction class is used to group related actions into single class. Using this class, you can have a method for every logical action compared than a one executes method. T

Moving Blobs, Don''t know how to write this, can anyone help me? http://wi...

Don''t know how to write this, can anyone help me? http://wikisend.com/download/660980/Moving Blobs.zip

Type of messaging is given by jms, Point-to-Point : gives a traditional qu...

Point-to-Point : gives a traditional queue based mechanism where the client application forwards a message through a queue to typically one receiving client that accepts messages

Java web programming, Write a JSP to display a table that contains factoria...

Write a JSP to display a table that contains factorials for the numbers from 0 to 10,

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