Skip to content

Instantly share code, notes, and snippets.

@lin
lin / parsers.md
Last active June 23, 2025 23:30
Simple examples to distinguish LR(0), SLR(1), LR(1), LALR(1), LR(k)
@MartinThoma
MartinThoma / btree.py
Created July 22, 2012 13:30 — forked from teepark/btree.py
a pure-python B tree implementation
import bisect
import itertools
import operator
class _BNode(object):
__slots__ = ["tree", "contents", "children"]
def __init__(self, tree, contents=None, children=None):
self.tree = tree
self.contents = contents or []
@teepark
teepark / btree.py
Created September 9, 2010 22:45
a pure-python B tree and B+ tree implementation
import bisect
import itertools
import operator
class _BNode(object):
__slots__ = ["tree", "contents", "children"]
def __init__(self, tree, contents=None, children=None):
self.tree = tree