On 1/30/2012 7:54 AM, Kenneth Lerman wrote: > On 01/30/2012 12:28 AM, Erik Christiansen wrote: >> On 29.01.12 23:05, Kenneth Lerman wrote: >>> <...> >> <...> >> It is worth understanding that the current parser _does_ have a fixed >> grammar, just like the proposed alternative. The significant difference >> is that in the current parser, it is not revealed in a concise >> human-readable form. >> >> As far as grammars go, the only structural change is transition from an >> amorphous hand-coded parser to a structured auto-generated parser, using >> a formal BNF grammar specification, instead of an undocumented one. >> >> <..> >> As with the rest of the grammar, the code to implement our wishes is >> auto-generated. We just have to get the grammar right. ;-) >> >> <...> >> >> >> What is being missed here is that the present parser does all that you >> fear above, just without the maintainability and documentation benefits >> conferred by a higher level implementation, using powerful tools. >> >> Erik >> > No. I don't think so. > > <...> > Don't get me wrong. I agree that we need a better definition of the > grammar and a more structured implementation. In general, though, I > prefer recursive descent parsers such as the present parser that is used > for each line. I consider the ability to generate excellent diagnostic > and error messages to be worth the effort of hand coding. > > <...> > I haven't looked closely at modern automated tools for doing this in a > few decades. If they let us generate effective diagnostic information in > a straightforward way, we should be using them. On the other hand, the > grammar should be simple enough that a hand generated recursive descent > parser should do fine. > > Regards, > > Ken > > Like Ken, I haven't looked closely either. I would hope for an integrated approach but my google-sense tells me the current situation is still one of disconnected islands of automation (not counting various student exercises; the work described in some recent theses looks quite enticing.)
I would hope for 1) a formal description of the grammar we already have. As Erik points out, the LinuxCNC interpreter implicitly defines a grammar. It's just hard to tell what the grammar is. It's hard to talk about the language without a description of it, and as some of Erik's requests have illustrated, the current description is cryptic. If the only outcome of the current activity is to come to agreement on this description, I will consider it a step forward. 2) a means to express and maintain the grammar in machine-processable form. Looking at and maintaining text is a bore. 3) tools that allow one to treat the grammar as an engineering object, e.g., view it, analyze it, manipulate it (refactor, group, etc), and extend it. This area was an arid desert the last time I did any related technical work. 4) tools like lex/yacc (flex/bison), antlr, etc., that can take this same machine-processable form and generate all the software goodness we've talked about. My personal interest lies in the first three. I don't know if there is a commonly accepted phrase---I saw "model-driven engineering" in one student's thesis---but I became a believer when it came time for us to develop a next-generation IGES and discovered that despite the hundreds of pages of documentation we didn't have a formal model we could work from when it came time to talk about what we wanted. (In the end, we simply dumped IGES and created PDES which became STEP. Opinions differ on the appropriateness of that decision.) Note that all of this is just ground work that I would hope gets done in advance of all the other topics that have been mixed into this thread such as simplified syntax, conversational coding, etc. Note also that it can became an endless academic exercise if not kept in leash (I came across a 2011 presentation entitled "Why program by hand in five days what you could spend five years of your life automating?") And, finally, much of this has already been said by you and others. Let's just say we're in violent agreement. Regards, Kent ------------------------------------------------------------------------------ Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users