0

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

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by gusano79
0

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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.