Re: [lisp-snmp] [patch] CL-YACC support in ASN.1
Brought to you by:
binghe
From: John F. <jf...@ms...> - 2009-02-09 05:28:06
|
Dear Chun Tian, "Chun Tian (binghe)" <bin...@gm...> writes: > I've merged your patch in a quite different way: > > 1) Define a variable *asn.1-syntax* to hold all LALR syntax rules. > 2) Convert your CL-YACC changes into loadable patch and put them in > #p"ASN1:vendor;" > 3) On LispWorks, still use PARSERGEN > 4) On non-LispWorks, use your DEFPARSER-TO-YACC to convert *asn.1- > syntax* into CL-YACC format. > > 5) The "eval-compile-asn.1" funtion haven't merged. > > I think it's beautiful way to made this big changes and only generate > minimum diff to original code, but ... it seems that something goes > wrong, either in CL-YACC patch side, or in DEFPARSER-TO-YACC. Can you > find it? I don't like this way. Please don't do it like this. The defparser-to-yacc function was a quick hack for one time use. It was not designed to be used like this. It is only luck that this particular grammar can be transformed by this function. It is quite likely that more complex grammars cannot be transformed. The function would have to be extended to support more advanced grammars. The reason I kept both grammars active, was so that you could test that the transform was correct. That is the only reason. It is difficult to make a general grammar translator. The function I made is not a general grammar translator. It only works on simple grammars. Having two different parser generators does not bring any benefits, as far as I can see, and means that there is quite likely to be different behaviour on different Lisps. Why do you want to keep using the Lispworks generator? I recommend having a transition period until Juliusz releases a new version of cl-yacc, and then moving over to cl-yacc entirely. PS. I have a working portable version of cdr-assoc in my personal development tree of cl-irregsexp (the one in the released version is borked). When I get the Internet at home I will push it to the cl.net repo. [...] |