If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Re: Please Provide an Algorithm and Source Code

Originally Posted by krprashant1

I need to generate a Grammar and then a parse tree and then finally evaluate that parse tree...but i dont know where to start and how to code.

If this is done as part of some course you should know what to do but if not you could try a Recursive Descent Parser. It's simple and straightfoward so there are plenty of resources on the net you can look for. Here's one,

You start by developing the grammar making sure it's LL(1). Then the actual parser follows almost automatically from the grammar.

For the evaluation you have two options. Either evaluate immediately during parsing or generate a parse tree which is evaluated afterwards. It's virtually the same because the recursive parsing process will walk through an implicit parse tree. It's your choise whether you evaluate by making it explicit or not.

* The Perfect Platform for Game Developers: Android
Developing rich, high performance Android games from the ground up is a daunting task. Intel has provided Android developers with a number of tools that can be leveraged by Android game developers.

* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.