Finally got grammar working and compiling. Still has problems at runtime.