Parsing in Turbo Pascal: TPLex and TPYacc

Hello everybody

I need to translate a family of text files from one format to another
- a bit like making a C to Pascal translator, but much easier. I have
come across the excellent TPLex and TPYacc by Albert Graef (look for
Tply30a1.zip (180Kbytes) and Tply30a2.zip(84Kbytes)). Herr Graef's
package contains useful example files, but does not include an example
which directly attacks my problem.

For example, can anyone describe the translation of this toy example
(A):-

BEGIN
  NAME = Object_1
 TYPE = Integer: length = 32
 TITLE = "Main segment"
  BEGIN
    NAME = Object_2
    TYPE = ShortInteger: length = 8
    TITLE = "<sometitle>"
  END
END

into a similar, but different form like this (B):-

Object heading "Main Segment"
 Name: Object_1
 length = 32
 Object heading "<sometitle>"
  length = 8
  end;
end;

I shall be grateful for any help. I can erect correct Lex and grammars
for "lexing" and parsing snippet A, but don't know how to emit the
text for B.

Michael Glover -  glo...@globalnet.co.usss
(Surrey, UK http://www.users.globalnet.co.usss/~glover/ )
(Change "usss" to "uk" to reply/access web site)