compiler design-limit the methods, C/C++ Programming

Ask question #Minimum 100Problem : Compiler Design - Limit the methods
Rahul 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 any where inside the program.

· Number of user defined functions inside a program must not be more than 100.

If any of the above conditions does not met, then the program will generate compilation errors. Today Rahul has written his first program "Hello World", but he is not sure about the correctness of the program now 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 Rahul.



Output Format:

Print "No Compilation Errors" if there won''t exist any 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 represent the instruction.


L will contain single spaced characters where each character will represent the each line of the program.


Number of characters in the text < = 10000



Sample Input and Output

SNo. Input Output
1
3
{ < > ( P ) }
{ < { } > ( { } ) )
{ ( { } ) }


No Compilation Error
Compilation Errors
Compilation Errors


words accepted#
Posted Date: 8/14/2014 1:09:39 AM | Location : USA







Related Discussions:- compiler design-limit the methods, Assignment Help, Ask Question on compiler design-limit the methods, Get Answer, Expert's Help, compiler design-limit the methods Discussions

Write discussion on compiler design-limit the methods
Your posts are moderated
Related Questions
Introduction to I/O interfacing, discuss microcontrollers applications in industry. Detailed product design specifications that have sections on both hardware and software inclu

Question 1 Describe the following with respect to pointers in C language- Pointers and Arrays Usage of Pointers in functions Write programs in C to demonstrate the

how can i print any english work using star .?

padovan string for a natural number is defined

write a program to solve e^x

Write a function that has two int parameters num and n, and returns TRUE when the nth bit in num is 1, otherwise FALSE. This function should use the function in the above problem.

brief note on multiple stack

How to use HTTP Headers inside PHP? Write the statement through which it can be added? HTTP headers can be used in PHP by redirection that is written as: Headers can be

Define Character Input and Output with Files? This is done by using equivalents of putchar and getchar which are called putc and getc. Each one takes an extra argument which id

Write a C program to compute the value of a sine wave from 0 to 2P with an increment of 0.1 radians.   #include stdio.h #include math.h #define pi 3.1415927 void main() {   c