Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!samsung!rex!ames!haven!mimsy!nems!ark1!ai.etl.army.mil!mike From: mike@ai.etl.army.mil (Mike McDonnell) Newsgroups: comp.unix.questions Subject: yacc grammar question Keywords: yacc Message-ID: <421@ai.etl.army.mil> Date: 19 Mar 90 11:33:49 GMT Organization: USAETL, Fort Belvoir, Virginia Lines: 18 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