Data processing: software development – installation – and managem – Software program development tool – Translation of code
Reexamination Certificate
2000-11-15
2004-11-23
Zhen, Wei Y. (Department: 2122)
Data processing: software development, installation, and managem
Software program development tool
Translation of code
C717S146000
Reexamination Certificate
active
06823504
ABSTRACT:
BACKGROUND OF THE INVENTION
1. Field of the Invention
This invention relates to a method and apparatus for interpreting and executing JavaScript programs, such as JavaScript programs embedded in hypertext markup language (“HTML”) documents. More particularly, embodiments of the present invention relate to a method and apparatus for a JavaScript interpreter written in Java. Specifically, a JavaScript interpreter may intercept JavaScript source code within HTML documents, parse and convert the JavaScript source code to a proprietary intermediate form represented by objects written in Java. The JavaScript interpreter may interface with JavaScript library objects to execute the intermediate representation equivalent of the original JavaScript source code.
2. Description of the Related Art
JavaScript is a Web scripting language developed by Netscape Communications Corporation. JavaScript was one of the first Web scripting languages and it remains one of the most popular today. (Please note that JAVA and JAVASCRIPT used herein are registered trademarks of Sun Microsystems, Inc.) JavaScript may be directly included in HTML documents. HTML is a language used to create Web documents. Referring now to
FIG. 1
, the JavaScript source code is typically embedded in HTML documents
110
, by using a script tag, such as “<SCRIPT LANGUAGE=JavaScript>”. A Web browser
120
, such as Netscape Navigator, executes HTML documents containing JavaScript source code. Unlike compiled languages, JavaScript is an interpreted language. This means the Web browser executes each line of JavaScript as it comes to it. The ability to interpret and execute JavaScript source code has been provided in popular Web browsers, such as Netscape Navigator and Microsoft Internet Explorer. JavaScript programs run within a Web browser or other JavaScript-enabled applications to produce the desired results
130
. The JavaScript language is regularly updated by Netscape. The most recent version of JavaScript is version 1.3.
Typical prior art Web browsers that support JavaScript are programmed in native code complied for a particular computer platform. However, it may be desirable to support JavaScript in a Web browser programmed in a platform-independent language such as Java. A Java-based Web browser may run on any computing platform under a Java Virtual Machine for the particular platform. However, Java-based programs typically execute more and may have a larger memory footprint that natively coded programs. Thus, adding JavaScript support to a Java-based browser may exacerbate speed and memory drawbacks. It may be desirable to overcome these drawbacks for a Java-based browser with JavaScript support, especially for use in embedded devices such as personal digital assistants (PDAs), wireless communication devices, such as cellular telephones, and other small consumer devices where computer processing speed and memory resources are at a premium. The present invention may provide a method and apparatus for interpreting and executing JavaScript source code embedded in HTML documents. The interpreter of the present invention may be written using the Java programming language. The present invention uses a smaller memory footprint than the prior art in interpreting and executing JavaScript programs. Furthermore, the architecture of the present invention may enable faster execution of JavaScript programs and enable the use of independent implementations of the interpreter, the Web browser and the JavaScript object library.
SUMMARY OF THE INVENTION
A method and apparatus is disclosed for interfacing a JavaScript interpreter with a JavaScript library of host objects implemented using the Java programming language. Specifically, a method and apparatus is disclosed for accessing a JavaScript program, parsing the program, generating an intermediate representation of the JavaScript program, and executing the intermediate representation by interfacing with the JavaScript library of host objects.
In the preferred embodiment of the present invention, the JavaScript program is embedded in HTML documents in an Internet Web browser. The Web browser is programmed to intercept the JavaScript code and pass execution control over the program to an interpreter engine developed using the Java programming language. The parsing component of the engine validates the JavaScript instructions. The validated instructions are converted by the code generator component of the engine into an intermediate representation equivalent in Java code. The interpreter engine accesses the program's library of host objects through an interface to the library and executes the intermediate representation to produce the desired results as programmed in the original JavaScript source program. The implementation of the interface enables the implementation of the interpreter engine to be independent from the implementation of the library of host objects and independent from the implementation of the Web browser. The library of host objects is also implemented using the Java programming language, where the host objects are derived from abstract Java classes. The host objects of the library contain fields and methods identified in the JavaScript source program. The interface dynamically updates the host objects of the library. The dynamic update capability of the interface is implemented using hash tables. Methods previously unknown to the library are stored in the hash tables in their original source code syntax. The present invention further contemplates information media that conveys software for implementing the method disclosed herein.
REFERENCES:
patent: 5920720 (1999-07-01), Toutonghi et al.
patent: 6065024 (2000-05-01), Renshaw
patent: 6292936 (2001-09-01), Wang
“The IR to VM×86 Translation Module Specification” by Chris Lattner, Dec. 1999.*
“JDK 1.1.8 Documentation: Java Reflection”, Sun Microsystems, 1998.*
“Take an in-depth look at the Java Reflection API”, By Chuck McManis, JavaWorld (www.javaworld.com), Issue Sep. 1997.*
“The Principles of Computer Hardware, Third Edition” by Alan Clements, 2000.*
“Load-Time Structural Reflection in Java” by Shigeru Chiba, Jun. 2000.*
Eobert W. Husted, “All About Javascript,” Netscape Communications Corp., 1999, 6 pages.
“ECMAScript Language Specification,” ECMA, Standard ECMA-262, Jun. 1997, pp. 1-95.
Kowert Robert C.
Meyertons Hood Kivlin Kowert & Goetzel P.C.
Sun Microsystems Inc.
Zhen Wei Y.
LandOfFree
Method and apparatus for interfacing a javascript... does not yet have a rating. At this time, there are no reviews or comments for this patent.
If you have personal experience with Method and apparatus for interfacing a javascript..., we encourage you to share that experience with our LandOfFree.com community. Your opinion is very important and Method and apparatus for interfacing a javascript... will most certainly appreciate the feedback.
Profile ID: LFUS-PAI-O-3363217