As of https://reviews.llvm.org/D41885, every parse_* function now either returns a single Node* or fails. I'm using this new rule to clean up the parsing for the demangler, and also update it to use LLVM coding conventions. This patch updates the expression parser. The expression grammer is pretty simple, so this patch is a pretty mechanical transformation.
In the new parser:
- The position in the mangled name is held in Db, and is accessed by Db::look() and Db::consume() functions
- Parse functions now return a Node* directly instead of pushing a node onto the Name stack and having their caller immediately pop it off.
- Failed to parse mean the parse functions returns nullptr.
- LLVM style.
Thanks for taking a look!
Erik