Groups | Search | Server Info | Login | Register


Groups > comp.compilers > #101

YACCaty YACC - Parsing YACC with YACC

From ben senior <okobloko@googlemail.com>
Newsgroups comp.compilers
Subject YACCaty YACC - Parsing YACC with YACC
Date Mon, 18 Apr 2011 08:21:40 +0200
Organization Compilers Central
Lines 44
Sender news@iecc.com
Approved comp.compilers@iecc.com
Message-ID <11-04-034@comp.compilers> (permalink)
NNTP-Posting-Host news.iecc.com
X-Trace gal.iecc.com 1303341445 62068 64.57.183.58 (20 Apr 2011 23:17:25 GMT)
X-Complaints-To abuse@iecc.com
NNTP-Posting-Date Wed, 20 Apr 2011 23:17:25 +0000 (UTC)
Keywords yacc, question
Posted-Date 20 Apr 2011 19:17:25 EDT
X-submission-address compilers@iecc.com
X-moderator-address compilers-request@iecc.com
X-FAQ-and-archives http://compilers.iecc.com
Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.dougwise.org!feed.ac-versailles.fr!proxad.net!feeder1-2.proxad.net!news.glorb.com!usenet.stanford.edu!news.iecc.com!nerds-end
Xref x330-a1.tempe.blueboxinc.net comp.compilers:101

Show key headers only | View raw


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 | NextNext in thread | Find similar


Thread

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