Skip to content

Instantly share code, notes, and snippets.

@ashleydev
ashleydev / gist:453195
Created June 25, 2010 17:55 — forked from anonymous/gist:452999
how to write a compiler in 20 lines of code
pmichaud@plum:~/rakudo$ cat x
grammar Expr {
rule TOP { <expr> }
rule expr { <integer> <addop> <integer> };
token addop { '+' | '-' }
token integer { \d+ }
}
class ExprActions {