Ternary Search Tries are one of my favorite data structures. They're also somewhat of a black-sheep data structure in that while they are quite useful, theyre often shoved to the side in favor of more main stream data structures like hash tables. They
When Donald Knuth published "On the translation of language from left to right" in 1965 he introduced the concept of LR parsers to the world. LR(k) parsers are a family of bottom-up parsers that perform a rightmost derivation in reverse. At th
When I transitioned owlscript from being a tree walking interpreter to compiling to bytecode, one of the features that took much longer than others was the re-implementation of set/list comprehensions. Some of the challenges posed by their imp
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
-
Improving Balance of Ternary Search Tries
-
Making Sense of LALR Parser Construction
-
Compiling Set Comprehensions to Bytecode: an exercise in managing abstractions
-
Fast Multi-Pattern String Searching with the Aho-Corasick Algorithm
-
Capture Groups: Tracking Regular Expression Sub Matches
-
Resolving Shift/Reduce Conflicts With Operator Precedence
-
Squeezing DFAs with Pair Compression
-
Designing Abstract Syntax Trees: Homogenous vs. Heterogenous Node Structures
-
LR(0) Closure: From LR Items to LR States
-
Calculating Follow Sets of a Context Free Grammar