Writing complex macros in Rust: Reverse Polish Notation
So, here is my take on describing the principles behind writing such macros. It assumes you have read the Macros section from The Book and are familiar with basic macros definitions and token types. I’ll take a Reverse Polish Notation as an example for this tutorial. It’s interesting because it’s simple enough, you might be already familiar with it from school, and yet to implement it statically at compile time, you already need to use a recursive macros approach.