Recursive Descent Parser [need help]

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
codefreak
Forum Newbie
Posts: 7
Joined: Sun Mar 04, 2012 8:07 pm

Recursive Descent Parser [need help]

Post by codefreak »

Dear all,

Hello, i'm a newbie programmer. I want to implement the concept about recursive descent parser for natural language (english). The concept was found in http://nltk.sourceforge.net/doc/en/ch07.html#rdparser. But my problem is, how to implementation the concept/theory to PHP code ? Anyone would to help me to give the advice or tutorial or maybe anyone has to make script before?
Thank you very much in advance.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Recursive Descent Parser [need help]

Post by requinix »

I prefer predictive myself, but meh.

Are you a newbie to PHP or to programming as a whole?
codefreak
Forum Newbie
Posts: 7
Joined: Sun Mar 04, 2012 8:07 pm

Re: Recursive Descent Parser [need help]

Post by codefreak »

tasairis wrote:I prefer predictive myself, but meh.

Are you a newbie to PHP or to programming as a whole?
Yes. I'm newbie. I have search before for example for the Recursive Descent Parser (natural language) for php script but nothing result. I don't know what I must do to implement the algorithm to PHP script.
Would you help me to solve my problem?
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Recursive Descent Parser [need help]

Post by requinix »

No offense but you need to learn programming first before you tackle things in the realm of compiler design. Parsers aren't a Comp Sci 101 subject. You learn them along with things like state machines and regular languages.

But if you want to plow ahead then fine. Can you explain to me how a recursive-descent parser works? How would you use it to deal with a mathematical expression like

Code: Select all

2 + 6 * 6 + 4
Once you understand the subject, then we can try writing code for it.
Post Reply