Page 1 of 1

Writing a parser

Posted: Mon Mar 08, 2010 12:03 pm
by Xcalibor
Greetings all,

I have written a quick 'n' dirty Perl parser for the SGF (Smart Game Format) which is used, among others, to record Go (Igo, Baduk, Weiqi) matches.

Now I'd like to try doing something similar in NewLISP, but I don't want to directly translate the Perl one, but instead try to build something idiomatic...

Is there any examples on how to build a parser in NewLISP? some previous art, even if parsing different document formats?

Thanks and laters

Re: Writing a parser

Posted: Mon Mar 08, 2010 2:04 pm
by HPW

Re: Writing a parser

Posted: Mon Mar 08, 2010 2:09 pm
by Lutz
... and here is a second example: a JSON parser:

http://www.newlisp.org/syntax.cgi?code/json.lsp.txt

Re: Writing a parser

Posted: Mon Mar 08, 2010 5:17 pm
by cormullion
... and I suppose Nestor is a parser of sorts

http://unbalanced-parentheses.nfshost.c ... p.txt.html

since it parses newLISP source code. I use it to generate the coloured syntax listings you see. I wrote a bit about it:

http://unbalanced-parentheses.nfshost.c ... estorpart1