hi..

All though this type of thread is already available, I'm re-posting, just because I wanna have some more details.

I wanna create a new Prog language .

I give input as a abstract sentence.

Eg Input : Let A be 10 , B be 10 . C be Sum of A & B.

SO the output to the compiler must be

int a=10, b=20 , c;
c = a+b;

Even though this is possible by simple character search, I wanna a well defined algorithm for this type of language.

Can you please help me how to go ahead with my proposal?????

Please help me guys...... I'm completely dependent upon this forum only...

--

rigidboss

I wanna create a new Prog language .

I give input as a abstract sentence.

Eg Input : Let A be 10 , B be 10 . C be Sum of A & B.

SO the output to the compiler must be

int a=10, b=20 , c;
c = a+b;

Even though this is possible by simple character search, I wanna a well defined algorithm for this type of language.

The standard well-defined approach is to create a parser for your input language and use it as part of a compiler that generates equivalent code in the output language.

Writing your own is certainly educational, but there are also parser generator applications out there that can take a grammar that describes your input language and generate code or other output for you--ANTLR is a good one.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.