I'm currently trying to develop a JavaScript compiler with the help of an Antlr4 Visitor. I've got this already implemented with Java but cannot figure out how to do this in JavaScript. Probably somebody can answer me a few questions? 1: In Java there is a Visitor.visit function. If im right this isn't possible with JavaScript. Is there a work around for this? 2: My JavaScript Visitor got all the generated visiting functions but when I use console.log(ctx) the context is undefined. Any idea why? Extract from the SimpleVisitor.js:
Main js file:
This is probably enough to start with ... Bruno Edit: If I call my visitor with tree as parameter how to I call the next visitor? |