How to build an interpreter in Java, Part 1: The BASICs

For complex applications requiring a scripting language, Java can be used to implement the interpreter, adding scripting abilities to any Java app

1 2 Page 2
Page 2 of 2

The execution environment group consists of objects that are used to provide the execution environment for the parsed programs. These include containers for the statements to be executed and for the variables that those statements manipulate. Further, the environment provides an ideal place to "hook" into some customized capabilities.

In Part 2 of this series, we'll take an in-depth look at the parsing and framework groups. These two groups of classes provide the foundation upon which we'll build our interactive interpreter.


As Java applications become more complex, the need to supply a scripting language for those applications arises. Java is well-suited as a language for implementing interpreters that fulfill this requirement. Furthermore, the portability and reusability of Java classes leverage the time invested in the development of scripting language interpreters by allowing the same interpreter to be reused in many applications.

Chuck McManis currently is the director of system software at FreeGate Corp., a venture-funded start-up that is exploring opportunities in the Internet marketplace. Before joining FreeGate, Chuck was a member of the Java Group. He joined the Java Group just after the formation of FirstPerson Inc. and was a member of the portable OS group (the group responsible for the OS portion of Java). Later, when FirstPerson was dissolved, he stayed with the group through the development of the alpha and beta versions of the Java platform. He created the first "all Java" home page on the Internet when he did the programming for the Java version of the Sun home page in May 1995. He also developed a cryptographic library for Java and versions of the Java class loader that could screen classes based on digital signatures. Before joining FirstPerson, Chuck worked in the operating systems area of SunSoft, developing networking applications, where he did the initial design of NIS+.

Learn more about this topic

This story, "How to build an interpreter in Java, Part 1: The BASICs" was originally published by JavaWorld.


Copyright © 1997 IDG Communications, Inc.

1 2 Page 2
Page 2 of 2