Todos os livros

Profissional

Apps Sobre Coach Entrar Começar a ler

Computer Science · Glossário

O que é Abstract syntax tree?

Definition 2.1 University Computer Science — Year 3 · Capítulo 2 — Top-Down Parsing

The abstract syntax tree (AST) of a program is a tree whose nodes are the constructs of the language (an addition, a call, an if statement), each with its operands as children and its span. It omits what the grammar needed only to be unambiguous or easy to parse: parentheses, separators, the chains of nonterminals that encode precedence.

The parse tree and the abstract syntax tree of a + b * c. The AST keeps the operators and their operands and drops the nonterminals that only encoded precedence.
The parse tree and the abstract syntax tree of a + b * c. The AST keeps the operators and their operands and drops the nonterminals that only encoded precedence.
Ler no capítulo →