top | item 25543233

(no title)

jooz | 5 years ago

When I studied compilers back in the university, the subject consist in reading understanding and putting in practice the 'dragon book' (not the full book but a big part of it). We all used flex+yacc and a simplified ASM that was interpreted by some educational software which name I cant remember. The project for the year was to implement a basic compiler language: included if/for loops, function calls, recursivity ... basic stuff but enough as starting point to build something.

Trying to get into LLVM, Id love to find an example done in flex+yacc vs the same done in LLVM.

discuss

order

ufo|5 years ago

Flex+yacc and llvm are for separate steps in the process. The former are for parsing the source code into an AST and the latter for generating executable code from the AST.

That said, somewhere else on this comment thread user "finiteloop" posted the scaffolding for a toy compiler using yacc+llvm. You could check that out.