andersch.dev

<2022-05-19 Thu>

Abstract Syntax Tree (AST)

In programming languages, an abstract syntax tree (AST) describes a structural, hierarchical representation of a computer program.

Abstract Syntax Trees vs. Concrete Syntax Trees (CST)

The difference is pretty simple, there's nothing too hard about it. In a CST, a = ((b + c) * d will have parenthesis and operator tokens encoded in it. AST will omit it. Standalone compilers usually parse straight to AST. CST only matters if you're building an IDE

Resources