translate earley3.py -> earley.coffee