3 ms·
Is there any common spec where you can mechanically go from spec to parser? HTTP, SMTP, DNS, HTML, CSS, Javascript, Ruby, Python, C, ... I basically know of not
by oblio 10y ago
Is there any common spec where you can mechanically go from spec to parser? HTTP, SMTP, DNS, HTML, CSS, Javascript, Ruby, Python, C, ... I basically know of nothing in widespread use with a spec that can actually be converted directly into working code.
- hawski 10y agoDoes implementing TCP/IP stack using the RFC (as in parsing diagrams straight from RFC) counts? Then it was done in OMeta [1]. Previous discussion: A full TCP/IP stack in under 200 LoC (and the power of DSLs) [2]. There's also a PNG parser (but it is not parsing any documentation) in 20 lines of OMeta [3]. [1] http://www.moserware.com/2008/04/towards-moores-law-software-part-3-of-3.html http://www.moserware.com/2008/04/towards-moores-law-software... [2] https://news.ycombinator.com/item?id=846028 https://news.ycombinator.com/item?id=846028 [3] http://joshondesign.com/2013/03/18/ConciseComputing http://joshondesign.com/2013/03/18/ConciseComputing
- UK-AL 10y agoFor the parser itself, yes. There are parser generators that take a spec(BNF, PEG) and output a parser that can parse the language. What you do with the parsed tree is up you though.