5 ms·
A Parser Combinator library for C
- 0xCMP 11y agoThis is being used from another thing posted here about making your own lisp: http://www.buildyourownlisp.com/ http://www.buildyourownlisp.com/ Pretty nice and simple. I'm on Chapter 8 of 16.
- gshrikant 11y agoI think both the library and the book are written by the same author [1]. [1] http://theorangeduck.com/page/you-could-have-invented-parser-combinators http://theorangeduck.com/page/you-could-have-invented-parser...
- enqk 11y agoAnother is Hammer, https://github.com/UpstandingHackers/hammer https://github.com/UpstandingHackers/hammer
- poseid 11y agonice!
- anon5_ 11y agoWhat's the difference between this and flex/yacc?
- revelation 11y agoFrom the readme, a workflow that doesn't make you want to kill yourself. Also no generated code that requires extra build steps and instantly breaks platform compatibility. That said, inline grammar definition might not be for everyone.
- gopowerranger 11y agoHmm. So for people who don't know how to use Unix/flex/yacc? This is just reinventing an existing wheel.
- gh02t 11y agoI dunno that that's a fair criticism... by that same argument you could say yacc/bison is for people who don't know how to use C to write a parser. This looks like an attempt to do something along the lines of Parsec from Haskell, but in C. Edit, because it looks like we hit the max reply depth: It's not like this is ever going to seriously replace Bison, I think it's just someone trying a different approach. It's not like flex/yacc/bison are the absolutely most perfect lexer/parser that can possibly exist. If people didn't try and reinvent the wheel every now and then, we'd still have stone wheels.
- gopowerranger 11y agoBut doing this in C already exists and works well. I don't understand the point of it. Although, in this day and age, rather than use the standard Unix toolset, people invent their own tools as if they are new. "Make" versus "npm" for example.
- slimsag 11y agoDo you really think Make could replace npm?
- gopowerranger 11y agoMake existed long before npm and make is the basis of all our package management in our company and our operating systems.
- sklogic 11y agoRecursive descent parsing can handle different class of languages from what yacc or bison can do. It is possible to build lexerless parsers this way (so scrap your old useless flex).