Parsing, where can I learn about it

前端 未结 12 711
鱼传尺愫
鱼传尺愫 2020-12-13 14:56

I\'ve been given a job of \'translating\' one language into another. The source is too flexible (complex) for a simple line by line approach with regex. Where can I go to le

12条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-13 15:54

    Yet another textbook to consider is Programming Language Pragmatics. I prefer it over the Dragon book, but YMMV.

    If you're using Perl, yet another tool to consider is Parse::RecDescent.

    If you just need to do this translation once and don't know anything about compiler technology, I would suggest that you get as far as you can with some fairly simplistic translations and then fix it up by hand. Yes, it is a lot of work. But it is less work than learning a complex subject and coding up the right solution for one job. That said, you should still learn the subject, but don't let not knowing it be a roadblock to finishing your current project.

提交回复
热议问题