The MicroJava compiler described in this book uses recursive descent parsing, which is a top-down technique. However, parsing can also be done bottom-up, where the syntax tree is built from the bottom to the top. Bottom-up parsing is more powerful than top-down parsing, but also more complicated, and it is harder to integrate semantic processing. Therefore, its use is usually limited to languages that are more complex than MicroJava. This chapter describes bottom-up parsing using a table-driven approach. It explains how to create the parser tables, how to integrate semantic actions, and how to recover after syntax errors.

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

Bottom-up Syntax Analysis

  • Hanspeter Mössenböck

摘要

The MicroJava compiler described in this book uses recursive descent parsing, which is a top-down technique. However, parsing can also be done bottom-up, where the syntax tree is built from the bottom to the top. Bottom-up parsing is more powerful than top-down parsing, but also more complicated, and it is harder to integrate semantic processing. Therefore, its use is usually limited to languages that are more complex than MicroJava. This chapter describes bottom-up parsing using a table-driven approach. It explains how to create the parser tables, how to integrate semantic actions, and how to recover after syntax errors.