Over the past few post's I've introduced data structures for representing Context Free Grammars from BNF, algorithms for computing First sets of those CFGs, and algorithms for computing the follow sets to accompany them. With that, we have everything n
Having previously discussed the data structures needed for representing a context free grammar as well as a method for computing the 'First' set, in todays post I will cover constructing the 'Follow' set. The follow set, as it's name would imply, is th
When constructing a recognizer or parser from a context free grammar there are some properties of the language which must be calculated from the grammar irregardless of the type of parser being developed. Two such properties which make the automatic ge
A context free grammar is defined as a 4-tuple made up of a start symbol, sets, mainly the set of Terminal symbols, the set of Non-Terminal symbols, and the set of productions for deriving the language specified by the grammar. From this 4-tuple additi
MGCLex is a "Lexer Generator" in the spirit of Flex or ScanGen. Input is in the form of a specification file containing a list of Token-rule pairs, 1 per line. Each pair consists of a regular expression pattern and an identifier for the pattern. MGCLex