Re: Grammar - Class creation

2001-05-29 Thread Leon Brocard
Paul Makepeace sent the following bits through the ether: Are there modules/frameworks that exist to create classes from a grammar spec (e.g. EBNF)? Well, Parse::RecDescent[1] probably does what you want. Check out the autotree directive. Parsing is fun. Let's try and parse everything! [1]

Re: Grammar - Class creation

2001-05-29 Thread Simon Wistow
Paul Makepeace wrote: Are there modules/frameworks that exist to create classes from a grammar spec (e.g. EBNF)? Restating, I'm envisaging something where the input is a grammar and the output is a class or set of classes that provides parsing capabilities and validating accessor methods.

Re: Grammar - Class creation

2001-05-29 Thread Marcel Grunauer
On Tuesday, May 29, 2001, at 11:18 AM, Simon Wistow wrote: I started looking into this when I first started doing the SWF stuff ... a kind of YACC for file formats. Describe it in a BNF-a-like language and then run a program over it et voila - you have a library for reading and creating

Re: Grammar - Class creation

2001-05-29 Thread Leon Brocard
Marcel Grunauer sent the following bits through the ether: Is that a) a good idea, b) a bad idea, c) common practice anyway and I just haven't found it? japhy's apparently kinda doing this: http://search.cpan.org/doc/PINYAN/YAPE-Regex-3.01/extra/YAPE.pm The YAPE hierarchy of modules is an

Re: Grammar - Class creation

2001-05-29 Thread Matthew Byng-Maddick
On Tue, May 29, 2001 at 02:27:40AM -0700, Paul Makepeace wrote: Anyway, PDF is easier re: packing/endianness since it's a text format! The only time you get binary data is for unencoded streams (which they advise against, although it's permitted, for example PDFlib generates it) like a

Re: Grammar - Class creation

2001-05-29 Thread Paul Makepeace
On Tue, May 29, 2001 at 10:45:59AM +0100, Leon Brocard wrote: [Of course, the reason nobody's done this before is that everyone wants a slightly different interface...] Surely it should be possible to specify the underlying *functionality* of the system and then have a perl source filter (or

Re: Grammar - Class creation

2001-05-29 Thread Marcel Grunauer
On Tuesday, May 29, 2001, at 11:49 AM, Paul Makepeace wrote: Surely it should be possible to specify the underlying *functionality* of the system and then have a perl source filter (or other component of perl's mind-addling n-tier parsing architecture) that rewrites/re-presents the

Re: Grammar - Class creation

2001-05-29 Thread Paul Makepeace
On Tue, May 29, 2001 at 10:48:54AM +0100, Matthew Byng-Maddick wrote: Not quite, it's a human-readable binary format. All the indexes rely on offsets in the file, and the various fun with the newline conventions mean that in my book, it's a binary format, you can't just go along and edit it

Re: Grammar - Class creation

2001-05-29 Thread Robin Szemeti
On Tue, 29 May 2001, Leon Brocard wrote: Other programming languages need code generators to spit out libraries. Perl doesn't need to do this as it's dynamic, baby. This is why Parse::RecDescent / Template Toolkit are so groovy, yeah. I propose a new convention : we all shout 'CAMEL' if Leon

Re: Grammar - Class creation

2001-05-29 Thread Simon Wistow
Paul Makepeace wrote: Like I said, I looked into and didn't find anything and didn't have the time/experience/inclination to start doing something myself - too many gotchas :( Like what kind of gotchas, besides the padding/endianity stuff? Well, Parse::RecDescent didn't do binary (I

Re: Grammar - Class creation

2001-05-29 Thread Nicholas Clark
On Tue, May 29, 2001 at 11:59:48AM +0100, Robin Szemeti wrote: On Tue, 29 May 2001, Leon Brocard wrote: Other programming languages need code generators to spit out libraries. Perl doesn't need to do this as it's dynamic, baby. This is why Parse::RecDescent / Template Toolkit are so

Re: Grammar - Class creation

2001-05-29 Thread Robin Szemeti
On Tue, 29 May 2001, Nicholas Clark wrote: On Tue, May 29, 2001 at 11:59:48AM +0100, Robin Szemeti wrote: On Tue, 29 May 2001, Leon Brocard wrote: Other programming languages need code generators to spit out libraries. Perl doesn't need to do this as it's dynamic, baby. This is why