Groups | Search | Server Info | Login | Register
Groups > comp.compilers > #101
| From | ben senior <okobloko@googlemail.com> |
|---|---|
| Newsgroups | comp.compilers |
| Subject | YACCaty YACC - Parsing YACC with YACC |
| Date | 2011-04-18 08:21 +0200 |
| Organization | Compilers Central |
| Message-ID | <11-04-034@comp.compilers> (permalink) |
Hi, Has anybody already written a LEX/YACC combo for parsing YACC grammars? Would it be better to try to parse the state table output.y you get by running yacc in debug mode? I'd like to create a tree for arbitrary YACC grammars (well, 'arbitrary' within reason). I'm aiming towards automatically generating a GUI 'Sentence Builder' from a grammar which offers users the ability to begin at the root "Start" token and choose how to progress according to which tokens the grammar would allow next. My secondary goal is to visualise the resulting sentences as a tree where any node can be relocated or reordered to a point where it would be allowed to fit. My wider goal is to use the original Grammer to generate Inversion of Control configuration files (e.g. Spring) for wiring up objects such that systems using differing technologies and platforms can be derived from the same Grammar.... however, the Grammar isn't actually much use unless there is a user friendly way to use it to generate concrete Grammar instances (sentences) which can be fed into the system (LEX/YACC) to then produce the wiring configurations. Perhaps that sounds totally over the top and ridiculous - but this "more reflexive" DSL approach seems a really nice way to give users a lot of controlled flexibility, whilst providing a way to abstract from implementation technologies. I'm just starting out down this road of using compiler-compilers... is this an appropriate usage? Am I wasting my time? Any and all advice deeply appreciated! Kindest Regards, Ben [The source code for Berkeley yacc and bison are available at the click of a mouse. If you want to do this, I'd make a mutant version of yacc. People have done sentence generators, mostly to create test data for compilers, although I can't think of anyone who let you reorganize the tree. -John]
Back to comp.compilers | Previous | Next — Next in thread | Find similar
YACCaty YACC - Parsing YACC with YACC ben senior <okobloko@googlemail.com> - 2011-04-18 08:21 +0200 Re: YACCaty YACC - Parsing YACC with YACC Chris F Clark <cfc@shell01.TheWorld.com> - 2011-04-25 19:15 -0400
csiph-web