Indexed Reverse Polish Notation, an Alternative to AST
burakemir.ch·20h·
Discuss: Hacker News
🛡️Error Handling
Preview
Report Post

Indexed Reverse Polish Notation, an Alternative to AST

2025-12-12

"Why study compiler construction? Because knowing how a programming language is specified and implemented makes you a better programmer." I still remember these words, pronounced as matter-of-fact introduction to an undergrad course of compilers.

Compiler engineers have come up with many useful programming techniques and representations.

Today, I want to write about one such technique, an alternative to Abstract Syntax Trees (ASTs). Inspired by the parse tree representation in the Carbon compiler, this post explains a way to represent parsed source code using a variation of Reverse Polish Notation (RPN), in a contiguous array.

We call this Indexed RPN. Orderin…

Similar Posts

Loading similar posts...