3 ms·
Building a complier is one of those things that rolls up a number of other parts of computer science. You need to have familiarity with both a high level and a
by shagie 2y ago
Building a complier is one of those things that rolls up a number of other parts of computer science.
You need to have familiarity with both a high level and a low level language.
Creating a lexer to match tokens uses finite state automata / regular languages.
Creating a parser to match a syntax uses push down automata.
There are some complex topics built on top of simple data structures. For example, symbol table lookups with scope.
Each one of those is a semester long class by itself (well, the DFA and PDA were both in the theory of computation class for me).
My complier class tied together many of the previous classes that I had and gave me a practical understanding of it. With that, I was then able to properly understand the tools of lex and yacc, the effort they saved me and the type of errors that I would encounter.