Parser Hacking [09]: Parsing Method Calls vs Local Variables | Unique Ruby Parser Feature
Tim Morgan
Ruby's parser has a unique feature: it keeps track of local variables defined in the current scope so it can determine if an identifier is a method call vs a local variable lookup. Let's teach our parser to store local variable assignment in a vector so we can mimic this behavior!
About the Project: Natalie is a very early-stage work-in-progress Ruby implementation that compiles Ruby to an executable. It does so by transpiling Ruby to C++ and feeding it to gcc or clang to produce a binary.
GitHub: https://github.com/seven1m/natalie Twitter: https://twitter.com/timmrgn
#programming #ruby #cpp #parsers #compilers #recursivedescentparser #prattparser ... https://www.youtube.com/watch?v=3ZZihogQSek
2020-12-11
0.0 LBC
Copyrighted (contact publisher)
200756970 Bytes