Attempting a port of antlr4cs to javascript