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

Note:

Please do not use package and namespace in your code. For object oriented languages your code should be written in one class.
Note:

Participants submitting solutions in C language should not use functions from / as these files do not exist in gcc



Related Discussions:- Compiler Design - Limit the loops

Networking, which concept is used to connect the networking in java

which concept is used to connect the networking in java

Area under curves, Write a program to find the area under the curve y = f(x...

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

Program to built canvas printing calculator, Printing Calculator Canv...

Printing Calculator Canvas Printing Calculator In this assignment we will continue to work on our canvas printing web service. Specifically we will make use of Javascrip

Create a usercontrol called loginpasswordusercontrol, (Login User Control) ...

(Login User Control) Create a UserControl called LoginPasswordUserControl that contains a Label (loginLabel) that displays string "Login:", a TextBox (loginTextBox), where the user

Java applet programming examples, Question: (a) The following is a simp...

Question: (a) The following is a simple example of a Java Class: // File: Welcome.java public class Welcome { public static void main(String args[]) { System.out.printl

What restrictions are placed on method overriding, What restrictions are pl...

What restrictions are placed on method overriding? Overridden methods must have the similar name, argument list, and return type. The overriding method may not limit the access

Use of weblogic platform in project, Use of WebLogic Platform in Project: ...

Use of WebLogic Platform in Project: Technologies Tools: Weblogic 8.1, Solaris 9, MQ Series 6.0, iplanet 6.1, Mercury Test Director. Project Overview: Wellington Manag

Conversation to html, Conversation to HTML Project Description: We ha...

Conversation to HTML Project Description: We have inner pages to be transformed into html for travel domain. 1. Flight search page for one way and round trip 2. Bus res

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