Writing a formal language parser with Lisp

后端 未结 3 1763
灰色年华
灰色年华 2020-12-30 10:44

My company is designing a new domain specific scripting language; I have to implement a parser that translates our brand new programming language into a common scripting lan

3条回答
  •  孤独总比滥情好
    2020-12-30 11:01

    There are two ways to parse non-lispy languages in common-lisp.

    1) Use readtables. this is the classic way: the lisp reader algorithm is a simple recursive-decent parser already, which supports character-based dispatch. Vacietis does this here

    2) Use a parsing library. I can recommend esrap as a good utility for doing packrat parsing, and smug as a decent one for doing monadic parsing. Both are available in quicklisp

提交回复
热议问题