Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
SableVM
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Java Intermediate Language== Some versions of the SableVM use Java Intermediate Language, an intermediate language (which is a subset of [[XML]]) representing the type structure of a [[Java (programming language)|Java]] program. The language was proposed by the team of SableVM in [[McGill University]] in January 2002 to aid the analysis of a Java program with the goals of scalability and good performance.<ref>Eng, David. "JIL: an extensible intermediate language." Sable Research Group, McGill University (2002).</ref><ref>Eng, David. Combining static and dynamic data in code visualization. Vol. 28. No. 1. ACM, 2002.</ref> The language has not been widely adopted. Consider the following piece of Java code. <syntaxhighlight lang="Java"> public MyClass implements MyInterface extends MySupperClass { int MyField; void MyMethod (double x, double y) { double z; z = x + y; this.MyField = z } } </syntaxhighlight> This piece can be expressed in the language, as follows: <syntaxhighlight lang="xml"> <jil> <class name="MyClass" extends="MySupperClass"> <modifiers><modifier name="public" /></modifiers> <interfaces><interface name="myinterface" /></interfaces> <fields> <field name="MyField" type="int" /> </fields> <methods> <method name="MyMethod" returntype="void"> <parameters> <parameter name="x" type="double" /> <parameter name="y" type="double" /> </parameters> <locals> <local name="z" type="double" /> </locals> <statements> <!-- Each statement is expressed by some intermediate format for code generator like three address code. In the below a language called baf is used. --> <baf> <![CDATA[ $r2 = $r0 + $r1; this.MyField = (double) $r2; ]]> <!-- Here, we are assuming x is expressed as $r0, y $r1 and z $r2. --> </baf> </statements> </method> </methods> </class> </jil> </syntaxhighlight>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)