[comp.unix.questions] yacc grammar question

mike@ai.etl.army.mil (Mike McDonnell) (03/19/90)

I am having trouble finding a yacc grammar for parsing a format string
of the form:
(A(3),5(I(2),3(A(4),6R(12))))
Where A is an ascii string, I is an integer, and R is a real number.

The problem is that I want to linearize this expression recursively by
expanding all the count fields so that, for example, 5I(3) becomes
I(3),I(3),I(3),I(3),I(3).

This is pretty easy to do at the innermost level.  My problem comes when
I have to consider nested counts like 6(A(4),7(I(5),6A(3))).  I hope this
is amenable to a recursive solution.  I'm looking forward to seeing some
elegant grammars since I know that some of you are wizards of this
stuff.
-- 
Mike McDonnell at the U.S. Army Engineer Topographic Laboratories, Bldg. 2592
Fort Belvoir, VA 22060-5546   TEL:(202)355-2716   NET: mike@etl.army.mil