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

Implement and test a program using java features, This assignment requires ...

This assignment requires you to design, implement and test a program using Java features from the first half of the subject content. You are required to implement in Java all the c

What are the difference between throw and throws, What are the difference b...

What are the difference between throw and throws? Differences are between throws and throw are: Throw is employed to trigger an exception while throws is used in declara

Minimum Passing Credential, Alia is appearing for the board exams. In order...

Alia is appearing for the board exams. In order to qualify for the next class Alia need to get exactly X credits. In current semester Alia has to study N number of subjects, and ev

A service locator, J2EE prepares use of the JNDI interface to access differ...

J2EE prepares use of the JNDI interface to access different resources like JMS, JDBC, EJB etc. The client finds up for these resources through the JNDI look-up. The JNDI look like

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

Relational mapping integration module, What are object/relational mapping i...

What are object/relational mapping integration module? Ans) Spring also supports for using of an object/relational mapping (ORM) tool over straight JDBC by giving the ORM module

Create an interface with a method concatenation, a)  Using Java, create an ...

a)  Using Java, create an interface with a method called concatenation which will be implemented in the class patient in part b. b)  Using Java, write the class patient with the

What is spring, Spring is an open source framework created to address the d...

Spring is an open source framework created to address the difficulty of enterprise application development. One of the chief benefits of the Spring framework is its layered archite

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