A recent change to the Java platform was the creation of an API for Nashorn's ECMAScript AST. In this section, we will individually look at Nashorn, ECMAScript, and then at the Parser API.
JavaScript Parser
Nashorn
Oracle Nashorn is a JavaScript engine for the JVM that was developed in Java by Oracle. It was released with Java 8 and was created to provide developers with a highly efficient and lightweight JavaScript runtime engine. Using this engine, developers were able to embed JavaScript code in their Java applications. Prior to Java 8, developers had access to the JavaScript engine that was created by Netscape. That engine, introduced in 1997, was maintained by Mozilla.
Nashorn can be used both as a command-line tool...