The Definitive ANTLR 4 Reference

原文:https://github.com/joaoBordalo/feup-COMP/blob/master/The Definitive ANTLR 4 Reference.pdf

ANTLR V4介绍

  • 新的解析技术:Adaptive LL() or ALL()
  • 简化对expression的语法表达
  • 自动将左递归规则重写为等价的非左递归规则
  • parse-tree walker: listener and visitor pattern
  • 相比v3的一些重要改进:
    • embedding actions作为高级应用,更推荐Listern和Visitor
    • 不需要设计tree grammer,使用自动生成的parse tree and tree walker
    • ALL() better than LL()

ANTLR v4 is the result of a minor detour (twenty-five years) I took in graduate
school. I guess I’m going to have to change my motto slightly.
Why program by hand in five days what you can spend twenty-five years of your
life automating?
ANTLR v4 is exactly what I want in a parser generator, so I can finally get
back to the problem I was originally trying to solve in the 1980s. Now, if I
could just remember what that was.

Chapter 1. Meet ANTLR

Chapter 2. The Big Picture

  • Language的定义:a language is a set of valid sentences, a sentence is made up of phrases, and a phrase is made up of subphrases and vocabulary symbols
  • Interpreter的定义:计算或者执行sentences的程序
  • Translator的定义:
上一篇:备份代码,ignore 一些不要的文件夹,比如build


下一篇:Cipher Block chaining