LLVM #4 — User Defined Operators
Kaleidoscope's grammar can now be extended by the user. They can define their own binary and unary operators with custom symbols and precedence, without rewriting the parser or adding new cases to the codegen. What I built: Commit 89fa3f8 What I understood The idea is simple. We should allow for users to write something like: and Through which we can do: 1) Lexer: We add two new tokens: tok_binary and tok_unary, along with their checks in gettok(). 2) AST: We create a Unary...
Original Source
Read the full article at Dev →KhanList aggregates and links to publicly available news content. We do not host full articles from third-party sources. Always verify important information with original sources.