5 ms·
nice work. if you want more of a challenge try a compiler compiler that can compile itself... :) i got pretty far with this myself, although it doesn't work f
by jheriko 2y ago
nice work.
if you want more of a challenge try a compiler compiler that can compile itself... :)
i got pretty far with this myself, although it doesn't work for weirdo languages like Python that need an exceptional lexer. i keep meaning to revisit this problem, since the tools in this space are pretty much non-existent or trash quality.
https://github.com/semiessessi/cp2 https://github.com/semiessessi/cp2
- anyfoo 2y ago> if you want more of a challenge try a compiler compiler that can compile itself... :) Is that not what OP did?
- Koshkin 2y agoNo (if the parent really meant ‘compiler compiler’ which, I think, would be what yacc/bison is).
- anyfoo 2y agoAh, thanks. My brain actually did not see that second "compiler" when reading, now it makes sense.
- downboots 2y agoHow could you tell the difference between missing it and your brain filtering it out?
- anyfoo 2y agoIsn’t that the same now? By the way, I dislike the term “compiler compiler”, because that’s not really what it does. I like “parser generator” for tax/bison, and “lexer generator” for flex.
- ModernMech 2y agoyacc calls it's a compiler compiler, but it's a parser compiler.
- anyfoo 2y agoI'd go further and say "parser generator", the generated parser will be compiled by a C compiler after all.