For example, the tap might activate a notepad on the screen A different tap at a different location, such as on a window, could potentially cause an interaction with the application program being displayed within that window. A tap on a template could be part of a gesture formed on that template or it could be of part of a "drag" action to move the template to a different position on the screen.
- The Sacred Darkness: A Story of Love, Life and Secrecy.
- The Great Nations of Europe.
- AO-Month V (10+3 MDGC Book Book 111).
- Weve Got to Clean Out the Freezer.
- Enterprise connectivity to handheld devices - Wright Strategies, Inc.?
Object oriented programming and view system software are well suited for GUI inputs and outputs. NewtonScript interface 88 is a program used to execute the intermediate NewtonScript code included in frame system A user enters a program, for example, in the NewtonScript language, which uses particular syntax to manipulate frame objects as well as objects within the frame objects in the frame system. The interface 88 provides the means by which NewtonScript programs are run.
Storage utility 90 is a utility program that can be used with frame system 84 to store data. Such data includes the NewtonScript code executed by NewtonScript interface Other utility 90 encompasses a range of utilities that can be used with frame system Such utilities include application programs, such as a note pad, address book, calendar program, and other programs. Additional utility programs that might be implemented in operating system 76 include modem and other peripheral controller programs, compression utilities for storing data more efficiently, system diagnostic programs, etc.
A system function 94 can be used to access the operating system code through the C wall 82 without accessing frame system The function is called with input or output arguments ARG. The function can be specified in a programming language that has been implemented on the computer system 10, such as NewtonScript.
Using a function 94, aspects of the operating system code can be accessed. For example, each object in NewtonScript has a class associated with it. The classes of various objects, which are not normally available in the NewtonScript interface 88, can be accessed by calling a function called ClassOf ARG , where the argument is the object for which the class information is desired. The function thus can be used to gain information about the operation of operating system code 78 as it is used behind the C wall Frames are types of objects used with the NewtonScript interface.
A frame system may take the form of a semantic network. As is well known to those skilled in the art, a semantic network is a knowledge representation system where unary predicates are treated like types and binary predicates are treated like attributes. Further, the types are arranged in a taxonomy where subassumption holds. See, Brachman and Leveseque, supra. Frame systems elaborate on the structure of types themselves and their attributes. Objects used in the described embodiment are each assigned a "class", such as integer, string, Frame, CodeBlock, Picture, etc.
The class may be used by the operating system code to identify the object and determine the types of data manipulated by the object. The class of a frame can be stored in a class slot which is examined by the operating system when determining the location of a particular frame. A compiled NewtonScript function is stored as a standard frame object with a class of "CodeBlock". Frame level 98 includes four individual frames in the described example which are direct subframes of root frame Frame level includes four individual frames in the described example which are direct subframes of frame level Frame level includes two individual frames in the described embodiment which are direct subframes of frame level In the example of FIG.
Smalltalk - Gpedia, Your Encyclopedia
Frame is therefore the frame in which the operating system is currently executing instructions. For example, the Newton operating system interprets NewtonScript code and executes the code contained within a specific frame, such as current frame If the executed code calls a separate NewtonScript function 94, that function is located so that arguments may be passed to and from the function.
The operating system traverses the frame structure of the frame system in a "vertical" direction, i. The frame system is thus traversed from frame in frame level to frame level Assume that, in frame , the called NewtonScript function is found. The operating system thus traverses back through parent frames until a desired function or frame is found.
This form of frame traversal is typical in a frame system described herein. Compiled NewtonScript functions are stored as frame objects having a class and a primitive class The "primitive class" is a more basic class of an object which is behind the C Wall 82 and can include classes such as Binary, String, Number, and Frame. The class and primitive class are stored in slots available by calling the routines ClassOf and PrimClassOf.
Frame includes a number of frame slots Any type of object can be stored in the frame slots , including numbers, strings, arrays, frames, or any datatype used in NewtonScript. A CodeBlock frame has a typical frame structure of four slots The first of these slots is literals slot , which stores an array of objects of class "literal" which contains the literal values used in the compiled function, such as constant values and identifiers. The second slot is instructions slot , which stores a binary array of bytes of class "instructions.
Similar authors to follow
The third slot is argFrame slot , which stores a frame object argFrame. The argFrame stores the individual arguments and variables used by the compiled function in slots of its own see FIG. The fourth slot is numArgs slot , which includes the number of arguments passed as input and output parameters to and from the compiled function. The example of FIG. The argFrame stores the arguments which are passed to and from the NewtonScript function and the variables which are used by the function.
Frame includes a number of slots in the described embodiment. The first three slots are used internally by the runtime NewtonScript interpreter to provide proper closure and scoping for the routine, as is well known to those skilled in the art, and are not generally used by the current process. For example, "Parent" in the second slot refers to the parent frame of the ArgFrame.
The slots in argFrame after the first three slots hold the arguments passed to and from the compiled function. The number of slots holding arguments is equal to the numArgs number stored in slot of the CodeBlock frame; these arguments are passed into this function. The remaining slots of ArgFrame are used to hold variables that are used locally within the compiled NewtonScript function.
The variables "arg1" through "value" are arguments and variables used in the source code for the NewtonScript function. The variables "slotvalueliter" through "xlincr" are generated by the compiler for use by the interpreter at runtime. NewtonScript source code is a function or program in a high-level language that has been entered into the computer system by a user. Of course, source code from other similar programming languages can be used for compilers of those languages. Appendix A shows an example of source code in the NewtonScript format.
This source code example, and data generated from this source code, will be used throughout the text to explain the present invention. The variables "arg1" and "arg2" are arguments passed into and out of the function. Variables "x" and "slots" are local variables to the function. The NewtonScript compiler examines the entered source code function and compiles the function into interpretive byte codes using the rules of syntax and constructs of the NewtonScript programming language.
This compiler does not produce machine-readable object code, but instead produces intermediate byte codes which are interpreted by the operating system. The final product of NewtonScript compiler is thus NewtonScript frame , which includes the byte codes and information from the NewtonScript function. The byte codes stored in frame are interpreted and executed by the operating system at run time. Each line of the byte code array includes the byte offset followed by a colon, then the opcode byte, then any data values for that opcode.
Appendix B also lists, for each byte code, the assembly instruction equivalent to that byte code. A NewtonScript frame which includes byte codes and information from a compiled function, such as the example shown in FIGS. A NewtonScript decompiler of the present invention is implemented by the CPU and operating system of the computer system.
The decompiler transforms the NewtonScript frame into NewtonScript source code ', which is a description of high-level functioning of the code bytes. The NewtonScript decompiled source code ' that results from decompiler is substantially the same as the original source code of FIG. If desired, the NewtonScript code resulting from decompiler may be compiled to a frame once again by the process of FIG. The process of accomplishing the decompilation by decompiler is described below.
Appendix G shows a decompiled result of the present invention. The decompiled source code listing is substantially equivalent to the example source code shown in Appendix A. The source code of Appendix G can be re-compiled and executed if desired. The process begins at step , and, in a step , the instructions slot of the NewtonScript frame is read.
The instructions slot includes the byte codes of the compiled function, including binary operation instructions opcodes which are the instructions for the microprocessor to operate on the arguments and variable values; an example of the byte codes generated from the example of Appendix A are shown in Appendix B. From these byte code instructions in slot , the decompiler builds a code fragment array, which is an array of text and parameters which the compiler creates to reconstruct the original source code.
Programming for the Newton®
A portion of the decompiler known as a "code fragment array generator" implements the steps necessary to create a code fragment array. Step is described in more detail with reference to FIG. An example of a code fragment array is shown in Appendix D. Once the code fragment array has been built in step , step is implemented, in which a "pattern matcher" portion of the decompiler performs pattern matching on the code fragment array. The text and parameters in the code fragment array are matched to patterns, or conditions, which indicate the presence of specific constructs used in NewtonScript.
The text of the constructs is created, and the literals, variables, and arguments are included to produce NewtonScript source code. The method used in step is described in greater detail with respect to FIG. Once the NewtonScript source code has been produced, the method is complete as indicated in step The process begins at In step , the Argframe is processed to create an array of names. The names are strings of the system variables, arguments, and local variables stored in the slot for the Argframe.
This array is:. These string names in the array of names are part of the textual representation of the code fragment array and are used to generate the resulting source code listing " -- nextArgframe", " -- Parent" and "implementor" are generated and ignored. After step , step is implemented, in which the literals stored in slot of frame see FIG. This array of literals is similar to the array of names created in step Literals such as numeric constants, operators, and types are stored as strings in this step.
- Enclosure: A Spiritual Autobiography.
- Of Wolves and Lesser Creatures.
- Newt's Cape: Other Tools?
- Navigation menu?
Using the example of Appendix A, the array of literals created from the literals slot is:. In the next step , the decompiler examines each opcode stored in the instructions slot and generates a code fragment that is appropriate for the opcode.
Related Programming for the Newton®: Software Development with Newtonscript™
Copyright 2019 - All Right Reserved