Alle boeken

Professioneel

Apps Over Coach Inloggen Begin met lezen

Computer Science · Begrippenlijst

Wat is Abstract syntax tree?

Definition 2.1 University Computer Science — Year 3 · Hoofdstuk 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.
Lees in het hoofdstuk →