From gtalk000 at gmail.com Mon Jan 4 13:40:35 2010 From: gtalk000 at gmail.com (Plato Wu) Date: Mon, 04 Jan 2010 21:40:35 +0800 Subject: [Cl-yacc-ebnf-devel] Parser for parsers In-Reply-To: <4B372D68.8020404@gmail.com> (Mikhail Novikov's message of "Sun, 27 Dec 2009 11:48:24 +0200") References: <4B372D68.8020404@gmail.com> Message-ID: <87iqbioung.fsf@gmail.com> Mikhail Novikov writes: > Hello! > > I hope you had nice and happy holidays :) > > As you all know, the ebnf part of the cl-yacc is fully implemented and working > and now there is a need to make parser for normal style ebnf grammar. As there > are many modifications of ebnf grammar (standard, CLHS, extended) I though that > it would be nice to have an abstraction layer on top of cl-yacc that allows to > define grammar types in easy way. Basically, user provides cl-yacc grammar for > the grammar type (like ebnf) and then it gets a closure which outputs a parser > each time it receives actual grammar in previously given style. I have done > this part, but now the problem is that it is very hard to generalize grammar > styles, so definition of new grammar types is as tedious as normal parser > grammar definition. > > I wonder if anyone have good ideas on how to abstract this kind of thing > efficiently. > > Cheers, Mikhail > > _______________________________________________ > Cl-yacc-ebnf-devel mailing list > Cl-yacc-ebnf-devel at common-lisp.net > http://common-lisp.net/cgi-bin/mailman/listinfo/cl-yacc-ebnf-devel Could you push the part which you have finished first? Thank you! From freiksenet at gmail.com Tue Jan 5 17:34:47 2010 From: freiksenet at gmail.com (Mikhail Novikov) Date: Tue, 05 Jan 2010 19:34:47 +0200 Subject: [Cl-yacc-ebnf-devel] Parser for parsers In-Reply-To: <87iqbioung.fsf@gmail.com> References: <4B372D68.8020404@gmail.com> <87iqbioung.fsf@gmail.com> Message-ID: <4B437837.9090709@gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello! Pushed my changes. I think this is a nice base for how this parser-parser should work, but some usability changes would be really nice and I am a bit stuck at that. Thanks for your help, Mikhail On 01/04/2010 03:40 PM, Plato Wu wrote: > Mikhail Novikov writes: > >> Hello! >> >> I hope you had nice and happy holidays :) >> >> As you all know, the ebnf part of the cl-yacc is fully implemented and working >> and now there is a need to make parser for normal style ebnf grammar. As there >> are many modifications of ebnf grammar (standard, CLHS, extended) I though that >> it would be nice to have an abstraction layer on top of cl-yacc that allows to >> define grammar types in easy way. Basically, user provides cl-yacc grammar for >> the grammar type (like ebnf) and then it gets a closure which outputs a parser >> each time it receives actual grammar in previously given style. I have done >> this part, but now the problem is that it is very hard to generalize grammar >> styles, so definition of new grammar types is as tedious as normal parser >> grammar definition. >> >> I wonder if anyone have good ideas on how to abstract this kind of thing >> efficiently. >> >> Cheers, Mikhail >> >> _______________________________________________ >> Cl-yacc-ebnf-devel mailing list >> Cl-yacc-ebnf-devel at common-lisp.net >> http://common-lisp.net/cgi-bin/mailman/listinfo/cl-yacc-ebnf-devel > > Could you push the part which you have finished first? Thank you! -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAktDeDcACgkQPHyh4sfuKrkcSQCdG8qn3mjuHAHbT+DKmQNBYk1p HLkAnidW2T1ZuFrU+B6NCfxo2+UFxqG5 =5Teh -----END PGP SIGNATURE----- From freiksenet at gmail.com Thu Jan 21 13:26:37 2010 From: freiksenet at gmail.com (Mikhail Novikov) Date: Thu, 21 Jan 2010 15:26:37 +0200 Subject: [Cl-yacc-ebnf-devel] Parser for parsers In-Reply-To: <87wrzb8upw.fsf@gmail.com> References: <4B372D68.8020404@gmail.com> <87iqbioung.fsf@gmail.com> <4B437837.9090709@gmail.com> <87wrzb8upw.fsf@gmail.com> Message-ID: <4B58560D.3080702@gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello! My idea was to complement version number 2 with possibility to input alternate grammar types and get closure to which text in version number 1 can go to get parsed. So user uses make-grammar-grammar with something like: (grammar (expression (:repeat expression)) (expression (rule-name (production)) .... and defines grammatical structure of, for example, ebnf. The he can pass grammar rules in normal ebnf to make-grammar-maker and grammar maker returns a parser that he can use to parse stuff. I guess I overcomplicated terminology, lol :) The current thing seems to work, but it is pain in the arse to define grammar-grammar with tools that we provide, but I can't think of generalization that is good enough for defining grammar structures of grammars. :/ Thanks, Mikhail > Sorry, I don't full understand what is the meaning of grammar-grammar > and parser-parser. > > 1. User input text like: > "S := '-'? D+ ('.' D+)? > D := '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'" > > and get *expression-ebnf-parser* by our parser-parser. > > 2. User input production like: > (:or ...) (:repeat (:or ...)) ... > and get define-ebnf-parser closure. > > Which way is correct ? -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAktYVg0ACgkQPHyh4sfuKrmf1gCfXtqJZjKRusWFKPLtTa7E1BNm 4i0AoISTtHPltQeKrJ2GyszPxIBAjgjP =797g -----END PGP SIGNATURE----- From gtalk000 at gmail.com Thu Jan 21 13:15:39 2010 From: gtalk000 at gmail.com (Plato Wu) Date: Thu, 21 Jan 2010 21:15:39 +0800 Subject: [Cl-yacc-ebnf-devel] Parser for parsers In-Reply-To: <4B437837.9090709@gmail.com> (Mikhail Novikov's message of "Tue, 05 Jan 2010 19:34:47 +0200") References: <4B372D68.8020404@gmail.com> <87iqbioung.fsf@gmail.com> <4B437837.9090709@gmail.com> Message-ID: <87wrzb8upw.fsf@gmail.com> Mikhail Novikov writes: > Hello! > > Pushed my changes. I think this is a nice base for how this parser-parser > should work, but some usability changes would be really nice and I am a bit > stuck at that. > > Thanks for your help, Mikhail > > On 01/04/2010 03:40 PM, Plato Wu wrote: >> Mikhail Novikov writes: >> >>> Hello! >>> >>> I hope you had nice and happy holidays :) >>> >>> As you all know, the ebnf part of the cl-yacc is fully implemented and > working >>> and now there is a need to make parser for normal style ebnf grammar. As > there >>> are many modifications of ebnf grammar (standard, CLHS, extended) I though > that >>> it would be nice to have an abstraction layer on top of cl-yacc that allows > to >>> define grammar types in easy way. Basically, user provides cl-yacc grammar > for >>> the grammar type (like ebnf) and then it gets a closure which outputs a > parser >>> each time it receives actual grammar in previously given style. I have done >>> this part, but now the problem is that it is very hard to generalize grammar >>> styles, so definition of new grammar types is as tedious as normal parser >>> grammar definition. >>> >>> I wonder if anyone have good ideas on how to abstract this kind of thing >>> efficiently. >>> >>> Cheers, Mikhail >>> >>> _______________________________________________ >>> Cl-yacc-ebnf-devel mailing list >>> Cl-yacc-ebnf-devel at common-lisp.net >>> http://common-lisp.net/cgi-bin/mailman/listinfo/cl-yacc-ebnf-devel >> >> Could you push the part which you have finished first? Thank you! > > > _______________________________________________ > Cl-yacc-ebnf-devel mailing list > Cl-yacc-ebnf-devel at common-lisp.net > http://common-lisp.net/cgi-bin/mailman/listinfo/cl-yacc-ebnf-devel Sorry, I don't full understand what is the meaning of grammar-grammar and parser-parser. 1. User input text like: "S := '-'? D+ ('.' D+)? D := '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'" and get *expression-ebnf-parser* by our parser-parser. 2. User input production like: (:or ...) (:repeat (:or ...)) ... and get define-ebnf-parser closure. Which way is correct ? From gtalk000 at gmail.com Fri Jan 22 11:54:55 2010 From: gtalk000 at gmail.com (Plato Wu) Date: Fri, 22 Jan 2010 19:54:55 +0800 Subject: [Cl-yacc-ebnf-devel] Parser for parsers In-Reply-To: <4B58560D.3080702@gmail.com> (Mikhail Novikov's message of "Thu, 21 Jan 2010 15:26:37 +0200") References: <4B372D68.8020404@gmail.com> <87iqbioung.fsf@gmail.com> <4B437837.9090709@gmail.com> <87wrzb8upw.fsf@gmail.com> <4B58560D.3080702@gmail.com> Message-ID: <877hra73sg.fsf@gmail.com> Mikhail Novikov writes: > Hello! > > My idea was to complement version number 2 with possibility to input alternate > grammar types and get closure to which text in version number 1 can go to get > parsed. > > So user uses make-grammar-grammar with something like: > > (grammar (expression (:repeat expression)) > (expression (rule-name (production)) > .... > > and defines grammatical structure of, for example, ebnf. The he can pass > grammar rules in normal ebnf to make-grammar-maker and grammar maker returns a > parser that he can use to parse stuff. > > I guess I overcomplicated terminology, lol :) > > The current thing seems to work, but it is pain in the arse to define > grammar-grammar with tools that we provide, but I can't think of generalization > that is good enough for defining grammar structures of grammars. :/ > > Thanks, Mikhail > >> Sorry, I don't full understand what is the meaning of grammar-grammar >> and parser-parser. >> >> 1. User input text like: >> "S := '-'? D+ ('.' D+)? >> D := '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'" >> >> and get *expression-ebnf-parser* by our parser-parser. >> >> 2. User input production like: >> (:or ...) (:repeat (:or ...)) ... >> and get define-ebnf-parser closure. >> >> Which way is correct ? I'm not familiar with other modifications of ebnf grammar, but I observe that EBNF's foundation is opreation or, so maybe other variants can also build on it. PS: Do you use Gtalk? Maybe we can discuss it in IM.