In theory, all browsers supporting ECMAScript 5.1.
In practice, this target has been extensively tested against:
* Firefox 34.0.5
* Safari 8.0.2
* Chrome 39.0.2171
* Explorer 11.0.3
The tests were conducted using Selenium. No issue was found, so you should find that the runtime works pretty much against any recent JavaScript engine.
The JavaScript runtime is [available from npm](https://www.npmjs.com/package/antlr4).
If you can't use npm, the JavaScript runtime is also available from the ANTLR web site [download section](http://www.antlr.org/download/index.html). The runtime is provided in the form of source code, so no additional installation is required.
We will not document here how to refer to the runtime from your project, since this would differ a lot depending on your project type and IDE.
## How do I get the runtime in my browser?
The runtime is quite big and is currently maintained in the form of around 50 scripts, which follow the same structure as the runtimes for other targets (Java, C#, Python...).
This structure is key in keeping code maintainable and consistent across targets.
However, it would be a bit of a problem when it comes to get it into a browser. Nobody wants to write 50 times:
Assuming you have, at the root of your web site, both the 'antlr4' directory and a 'lib' directory with 'require.js' inside it, all you need to put in your HTML header is the following:
## How do I run the generated lexer and/or parser?
Let's suppose that your grammar is named, as above, "MyGrammar". Let's suppose this parser comprises a rule named "StartRule". The tool will have generated for you the following files:
* MyGrammarLexer.js
* MyGrammarParser.js
* MyGrammarListener.js (if you have not activated the -no-listener option)
* MyGrammarVisitor.js (if you have activated the -visitor option)
(Developers used to Java/C# ANTLR will notice that there is no base listener or visitor generated, this is because JavaScript having no support for interfaces, the generated listener and visitor are fully fledged classes)
Now a fully functioning script might look like the following:
This specific task is described in this [dedicated page](ace-javascript-target.md).
## How can I learn more about ANTLR?
Further information can be found from "The definitive ANTLR 4 reference" book.
The JavaScript implementation of ANTLR is as close as possible to the Java one, so you shouldn't find it difficult to adapt the book's examples to JavaScript.