Does anyone know what is the general method for turning a stream (or a list) of tokens into a parse tree?
I am dying to know this. I haven’t programmed stuff like this and would love to learn it!
Thanks, Boda Cydo.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The process you’re talking about is known as parsing. There is several options to do this. You can either use a tool such as YACC to do the parsing for you or you could implement your own parser. A popular parser that is well used is the Recursive Descent Parser. You will find lots of reading about it on the web and wikipedia has a good code example too.