Skip to content

Details

A brief introduction and discussion about lexical analysis, parsers, grammers and compiler generators.

A grammar is a 4-tuple defined as Non terminals, terminals, a start symbol, and a set of productions.
G(N, T, S, P)

LL (scan from the left and build a left tree), LR (scan from the left and build a right tree). Recursive descent (A possibly hand built LL parser).

Productions will be Chomsky type 3 for regular expressions for lexical analysis, and type 2 (context free) for computer languages, based on BNF.

Let’s build a very simple tokeniser and then use it to parse a small language using recursive descent.

My language of choice would be C# but we could use C or C++ if there is consensus on that.

Related topics

You may also like