Related articles |
---|
YACCaty YACC - Parsing YACC with YACC okobloko@googlemail.com (ben senior) (2011-04-18) |
Re: YACCaty YACC - Parsing YACC with YACC cfc@shell01.TheWorld.com (Chris F Clark) (2011-04-25) |
From: | ben senior <okobloko@googlemail.com> |
Newsgroups: | comp.compilers |
Date: | Mon, 18 Apr 2011 08:21:40 +0200 |
Organization: | Compilers Central |
Keywords: | yacc, question |
Posted-Date: | 20 Apr 2011 19:17:25 EDT |
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]
Return to the
comp.compilers page.
Search the
comp.compilers archives again.