CPython’s Internals# Exploring the Internals CPython Source Code Layout Additional References Guide to the Parser Abstract How PEG Parsers Work Key ideas Consequences or the ordered choice operator Syntax Grammar Expressions # comment e1 e2 e1 | e2 ( e ) [ e ] or e? e* e+ s.e+ &e !e ~ Left recursion Variables in the Grammar Grammar actions Pegen How to regenerate the parser How to regenerate the meta-parser Grammatical elements and rules Tokenization Memoization Automatic variables Hard and Soft keywords Error handling How Syntax errors are reported Generating AST objects Testing Debugging generated parsers Making experiments Verbose mode References Compiler Design Abstract Parsing Abstract Syntax Trees (AST) Memory Management Source Code to AST Control Flow Graphs AST to CFG to Bytecode Introducing New Bytecode Code Objects Important Files Known Compiler-related Experiments References Garbage Collector Design Abstract Memory layout and object structure Identifying reference cycles Why moving unreachable objects is better Destroying unreachable objects Optimization: generations Collecting the oldest generation Optimization: reusing fields to save memory Optimization: delay tracking containers