The Aho-Corasick algorithm is a finite automaton based string match algorithm which is an adaptaion of another well known Finite State Machine based algorithm: The Knuth-Morris-Pratt(KMP) algorithm. While the KMP algorithm uses a DFA & failure func

Nine out of ten times when we  reach for regular expressions its because we want to simply know "does this text contain this pattern?". A simple boolean expression: yes or no. Sometimes we want to know the position of the entire match, as in lexic

One of the major selling points of LR parsing is the ability to write expression grammars with a higher degree of ambiguity than would otherwise be allowed. When designing an expression grammar there are ways to encode the operators precedence and asso

It's no secret that the price we pay for using a DFA in the process of lexical analysis is the (potentially) enourmous transition tables which must be managed. There are many ways of representing transition tables. Anyone who has peaked a

Abstract Syntax Trees are the data structure which bridges the cap between the front and back ends of many (most?) compilers. Because of this, its design influcences the implementation of many other areas of the compiler. Of the many design decisions w