buffalo is an LALR(1) parser generator in pure Lisp that performs roughly on par with its large cousin on the "torture" tests from the GNU Bison test suite (https://github.com/fhuttner/buffalo-testsuite). What I find really missing is an equivalent, open-sourced lexer; is there such a project?
Esrap is a PEG parser. PEG is Lex and Yacc combined. I'm sure that you could use esrap as a lexer-only, if you wish to. http://nikodemus.github.io/esrap/ On my github there's an experimental PEG syntax overlaid over esrap syntax, if you care. https://github.com/guitarvydas Ping me if you need ref's to papers about PEG. pt
I agree with Paul: Esrap is nice and Paul's PEG syntax parser is great if you want to use a PEG like syntax. I use them both and this works well. Otherwise there is cl-yacc which I was using before. BTW Paul, this reminds me I have to send you a few fixes/additions I've done to your PEG parser. Marc On 2/13/15 10:04, Paul Tarvydas wrote:
Esrap is a PEG parser. PEG is Lex and Yacc combined. I'm sure that you could use esrap as a lexer-only, if you wish to.
http://nikodemus.github.io/esrap/
On my github there's an experimental PEG syntax overlaid over esrap syntax, if you care. https://github.com/guitarvydas
Ping me if you need ref's to papers about PEG.
pt
_______________________________________________ pro mailing list pro@common-lisp.net https://mailman.common-lisp.net/cgi-bin/mailman/listinfo/pro
Hi Paul, What is the performance of Esrap vis-a-vis something like cl-yac? Given a BN grammar, how hard is it to build up a PEG parser? thanks,
On Feb 13, 2015, at 10:04 AM, Paul Tarvydas <paultarvydas@gmail.com> wrote:
Esrap is a PEG parser. PEG is Lex and Yacc combined. I'm sure that you could use esrap as a lexer-only, if you wish to.
http://nikodemus.github.io/esrap/
On my github there's an experimental PEG syntax overlaid over esrap syntax, if you care. https://github.com/guitarvydas
Ping me if you need ref's to papers about PEG.
pt
_______________________________________________ pro mailing list pro@common-lisp.net https://mailman.common-lisp.net/cgi-bin/mailman/listinfo/pro
-- Gary Warren King, metabang.com Cell: (413) 559 8738 Fax: (206) 338-4052 gwkkwg on Skype * garethsan on AIM * gwking on twitter
I wish that I’d had PEG 20 years ago, PEG parses a wider set of grammars than YACC can. PEG is backtracking, but, it uses a trick, memoizing, that minimizes the cost of backtracking. Given the hardware we have these days, I don’t see why anyone would use anything but PEG and packrat parsing. Google phrase “bryan ford peg” Building a PEG parser is way, way easier than dealing with Lex and YACC. I’m not sure if I’ve answered all of your questions … please feel free to ask again.... pt
On Feb 14, 2015, at 4:47 PM, Gary King <garywarrenking@gmail.com> wrote:
Hi Paul,
What is the performance of Esrap vis-a-vis something like cl-yac? Given a BN grammar, how hard is it to build up a PEG parser?
thanks,
On Feb 13, 2015, at 10:04 AM, Paul Tarvydas <paultarvydas@gmail.com> wrote:
Esrap is a PEG parser. PEG is Lex and Yacc combined. I'm sure that you could use esrap as a lexer-only, if you wish to.
http://nikodemus.github.io/esrap/
On my github there's an experimental PEG syntax overlaid over esrap syntax, if you care. https://github.com/guitarvydas
Ping me if you need ref's to papers about PEG.
pt
_______________________________________________ pro mailing list pro@common-lisp.net https://mailman.common-lisp.net/cgi-bin/mailman/listinfo/pro
-- Gary Warren King, metabang.com Cell: (413) 559 8738 Fax: (206) 338-4052 gwkkwg on Skype * garethsan on AIM * gwking on twitter
_______________________________________________ pro mailing list pro@common-lisp.net https://mailman.common-lisp.net/cgi-bin/mailman/listinfo/pro
The original question was about a lexer do use with buffalo. PEG parsers do the equivalent of yacc + lex but it should be possible to use a PEG parser to do only the lexer part to use with buffalo. Optima (and optima.ppcre) is another library that can be used for lexers. Marc On 2/14/15 17:31, Paul Tarvydas wrote:
I wish that I’d had PEG 20 years ago,
PEG parses a wider set of grammars than YACC can.
PEG is backtracking, but, it uses a trick, memoizing, that minimizes the cost of backtracking.
Given the hardware we have these days, I don’t see why anyone would use anything but PEG and packrat parsing.
Google phrase “bryan ford peg”
Building a PEG parser is way, way easier than dealing with Lex and YACC.
I’m not sure if I’ve answered all of your questions … please feel free to ask again....
pt
On Feb 14, 2015, at 4:47 PM, Gary King <garywarrenking@gmail.com> wrote:
Hi Paul,
What is the performance of Esrap vis-a-vis something like cl-yac? Given a BN grammar, how hard is it to build up a PEG parser?
thanks,
On Feb 13, 2015, at 10:04 AM, Paul Tarvydas <paultarvydas@gmail.com> wrote:
Esrap is a PEG parser. PEG is Lex and Yacc combined. I'm sure that you could use esrap as a lexer-only, if you wish to.
http://nikodemus.github.io/esrap/
On my github there's an experimental PEG syntax overlaid over esrap syntax, if you care. https://github.com/guitarvydas
Ping me if you need ref's to papers about PEG.
pt
_______________________________________________ pro mailing list pro@common-lisp.net https://mailman.common-lisp.net/cgi-bin/mailman/listinfo/pro -- Gary Warren King, metabang.com Cell: (413) 559 8738 Fax: (206) 338-4052 gwkkwg on Skype * garethsan on AIM * gwking on twitter
_______________________________________________ pro mailing list pro@common-lisp.net https://mailman.common-lisp.net/cgi-bin/mailman/listinfo/pro
_______________________________________________ pro mailing list pro@common-lisp.net https://mailman.common-lisp.net/cgi-bin/mailman/listinfo/pro
participants (4)
-
Frank Huttner
-
Gary King
-
Marc Battyani
-
Paul Tarvydas