Many of the techniques described in this book can be automated, especially scanning and parsing. Therefore, this chapter presents a tool (a so-called compiler generator) that can be used to automatically generate a scanner and a parser from a compact specification that is based on attributed grammars. Coco/R can not only be used in compiler construction but also for any task that has to process and translate a syntactically structured input. Such tasks are common in practice, so Coco/R can also be employed in areas other than compilers. We show several examples of how to use Coco/R, e.g., for processing a domain-specific language to create questionnaires in a web browser or for creating abstract syntax trees from a program. Coco/R is available as a public domain tool.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

The Compiler Generator Coco/R

  • Hanspeter Mössenböck

摘要

Many of the techniques described in this book can be automated, especially scanning and parsing. Therefore, this chapter presents a tool (a so-called compiler generator) that can be used to automatically generate a scanner and a parser from a compact specification that is based on attributed grammars. Coco/R can not only be used in compiler construction but also for any task that has to process and translate a syntactically structured input. Such tasks are common in practice, so Coco/R can also be employed in areas other than compilers. We show several examples of how to use Coco/R, e.g., for processing a domain-specific language to create questionnaires in a web browser or for creating abstract syntax trees from a program. Coco/R is available as a public domain tool.