问题
A grammar as well.
If one were to approach a generic parser from the ground up how would one go about it? I've looked at ANTLR and Irony, but they are more tools than methodologies. What are the steps one should tackle and the milestones for accomplishment?
回答1:
Large topic my friend. If you want to learn about the theory the best place to go is 'the Dragon Book': http://www.amazon.com/Compilers-Principles-Techniques-Tools-Gradiance/dp/0321547985/ref=sr_1_2?s=books&ie=UTF8&qid=1297801900&sr=1-2
Another good place to look if you want to devlope for .Net is the F# power pack. THis contains fsLex and fsYacc.
Good luck!
GJ
回答2:
http://blogs.msdn.com/b/ericlippert/archive/2010/04/19/every-binary-tree-there-is.aspx
Start here, there is a good handfull of posts on the subject it's a very good read.
-edit- hm this isnt exactly the start of the series, and it changes to "Every program there is"
I wonder if the whole thing is tagged or listed somewhere already...
回答3:
Your post got my interest in this stuff started again, here's some more useful links. They're all in F# though. You mentioned .Net so it does fit the bill. Actually for this type of work F# is by far the best language to do it in.
http://www.quanttec.com/fparsec/
http://strangelights.com/blog/archive/2006/05/11/1302.aspx
来源:https://stackoverflow.com/questions/5009111/whats-the-goto-methodolgy-of-building-out-a-parser-in-net