Coco/R is a language for generating compilers from attributed EBNF grammars. You find more information about this topic at Prof. Pat Terry's Coco/R page. The original port of Coco is from the Stewart Greenhill's website BlackBox Resources. I adapt Coco to the BlackBox subsystem and use BlackBox IO directly.
You find examples of using Coco here:
Bnf7 - (Bnf7)Ebnf.atg: Ebnf Pretty-Printer. A sample use of Coco.
Prettify - 3 Coco pretty-printer (PP) grammars for Component Pascal.
Webstat - Analysing Web Log Files.