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

Assignment Help:
Problem : 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



Related Discussions:- compiler design-limit the methods

C program to add two complex numbers , Aim: To implement a program to add ...

Aim: To implement a program to add two complex numbers using constructors. Code:                       class complex {             int real;             int img;

We want network-social app, We are seeking a talented developer/team with g...

We are seeking a talented developer/team with great experience in programming apps for both Android and iOS. Our project needs great skills and experience in making good functional

Loop, A company needs 200 pencils per year . you cannot simply use this pr...

A company needs 200 pencils per year . you cannot simply use this price as the cost of pencils two years from now. Because of inflation the cost is likely to be higher than it is

3n+1, Consider the following algorithm to generate a sequence of numbers. S...

Consider the following algorithm to generate a sequence of numbers. Start with an integer n. If n is even, divide by 2. If n is odd, multiply by 3 and add 1. Repeat this process wi

Need android app development, Project Description: I am seeking a develo...

Project Description: I am seeking a developer who can start an app from scratch and get it delivered to me as soon as possible. It is a little android based app. A background on

Friend function in c++, Friend function in c++: class miles; class ...

Friend function in c++: class miles; class km  {    float value;    public :   // void input();     km convert(km  ,int a ) ;    void output()    {

Pebble merchant, 3 kilograms of peebles are needed for converting an area o...

3 kilograms of peebles are needed for converting an area of 1 square meter.the rate of the peeble is 5 per kilogram

Example for register storage class - computer programming, Example for Regi...

Example for Register Storage Class - computer programming? main() { register int i; for (i=0; i { ............... ............... } } /* block exit will free the register

VS Project, Hi, I want to get rtsp source for windows

Hi, I want to get rtsp source for windows

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