[Git][java-team/jasmin-sable][upstream] New upstream version 3.0.1+dfsg
Andreas Tille (@tille)
gitlab at salsa.debian.org
Wed Jan 29 21:18:11 GMT 2025
Andreas Tille pushed to branch upstream at Debian Java Maintainers / jasmin-sable
Commits:
8b89371e by Andreas Tille at 2025-01-29T22:15:16+01:00
New upstream version 3.0.1+dfsg
- - - - -
28 changed files:
- .classpath
- + .gitignore
- .project
- README → README.md
- ant.settings.template
- build.xml
- generated/scm/AutoProcs.java
- generated/scm/AutoTypes.java
- + ivy.xml
- + ivysettings.xml
- lib/jas/src/jas/ClassEnv.java
- lib/jas/src/jas/EnclMethAttr.java
- lib/jas/src/jas/InsnOperand.java
- lib/jas/src/jas/InvokeDynamicCP.java
- lib/jas/src/jas/MethodHandleCP.java
- lib/jas/src/jas/RuntimeConstants.java
- lib/jas/src/scm/autogen/autogen.java
- + pom.xml
- src/jasmin/ClassFile.java
- + src/jasmin/ReservedInstructions.java
- src/jasmin/ReservedWords.java
- src/jasmin/Scanner.java
- src/jasmin/parser.cup
- src/jasmin/parser.java
- src/jasmin/sym.java
- + src/tables.out/shortarray_0.obj
- + src/tables.out/shortarray_1.obj
- + src/tables.out/shortarray_2.obj
Changes:
=====================================
.classpath
=====================================
@@ -2,12 +2,8 @@
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry excluding="scm/autogen/|scm/autogen/" kind="src" path="lib/jas/src"/>
- <classpathentry kind="src" path="lib/jas/src/scm/autogen"/>
+ <classpathentry kind="src" path="generated"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry combineaccessrules="false" kind="src" path="/libs">
- <accessrules>
- <accessrule kind="nonaccessible" pattern="soot/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
+ <classpathentry kind="lib" path="libs/java_cup.jar"/>
+ <classpathentry kind="output" path="classes"/>
</classpath>
=====================================
.gitignore
=====================================
@@ -0,0 +1,3 @@
+/classes
+ant.settings
+.settings
=====================================
.project
=====================================
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>Jasmin</name>
+ <name>jasmin</name>
<comment></comment>
<projects>
</projects>
=====================================
README → README.md
=====================================
@@ -1,6 +1,8 @@
+[](http://soot-build.cs.uni-paderborn.de/jenkins/job/soot/job/jasmin-build/)
+
Jasmin README file Jan 22nd, 2012, Eric Bodden
-Welcome to Jasmin version sable-2.5.0.
+Welcome to Jasmin version sable-3.0.1.
This is a specialized version of jasmin which is used as a back end for the
Soot framework.
=====================================
ant.settings.template
=====================================
@@ -1,9 +1,15 @@
## Location of Java Cup classes jar file to link Jasmin against
# either classes dir or jar - note polyglot comes with cup-classes
-java_cup.jar=${user.home}/cup-classes/
+java_cup.jar=libs/java_cup.jar
# Location in which to generate Jasmin release tarballs
release.loc=lib
# Version of Jasmin for tagging tarballs
jasmin.version=2.2.1
+
+# ANT javac source / target / encoding configuration
+ant.build.javac.source=1.5
+ant.build.javac.target=1.5
+ant.build.javac.encoding=iso-8859-1
+
=====================================
build.xml
=====================================
@@ -1,123 +1,190 @@
<?xml version="1.0"?>
+<project default="compile" name="jasmin" xmlns:ivy="antlib:org.apache.ivy.ant">
+ <property file="ant.settings" />
+
+ <property name="tables.dir" value="tables.out" />
+
+ <property name="ivy.install.version" value="2.1.0-rc2" />
+ <condition property="ivy.home" value="${env.IVY_HOME}">
+ <isset property="env.IVY_HOME" />
+ </condition>
+ <property name="ivy.home" value="${user.home}/.ivy2" />
+ <property name="ivy.jar.dir" value="${ivy.home}/lib" />
+ <property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar" />
+
+ <path id="jas.src">
+ <pathelement location="lib/jas/src/jas" />
+ </path>
+
+ <path id="autogen.src">
+ <pathelement location="lib/jas/src/scm" />
+ <pathelement location="generated" />
+ </path>
+
+ <path id="scm.src">
+ <pathelement location="lib/jas/src" />
+ <pathelement location="generated" />
+ </path>
+
+ <path id="compile.src">
+ <pathelement location="src" />
+ <pathelement location="generated" />
+ </path>
+
+ <macrodef name="java-compile">
+ <attribute name="classpath" default="classes" />
+ <attribute name="source" />
+ <sequential>
+ <javac destdir="classes"
+ classpath="@{classpath}"
+ encoding="${ant.build.javac.encoding}"
+ debug="true"
+ deprecation="true"
+ optimize="true"
+ source="${ant.build.javac.source}"
+ target="${ant.build.javac.target}"
+ includeantruntime="false">
+ <src refid="@{source}" />
+ </javac>
+ </sequential>
+ </macrodef>
+
+ <target name="settings">
+ <fail message="Please copy ant.settings.template to ant.settings, and set the variables in it." unless="java_cup.jar" />
+ </target>
+
+ <target name="compile" depends="settings, scm">
+ <java-compile source="compile.src" classpath="classes:${java_cup.jar}" />
+ <mkdir dir="classes/${tables.dir}/" />
+ <copy todir="classes/${tables.dir}/">
+ <fileset dir="src/${tables.dir}/" includes="**"/>
+ </copy>
+
+ </target>
+
+ <target name="build_parser">
+ <java classname="java_cup.Main" dir="src/jasmin" classpath="${java_cup.jar}">
+ <arg line="src/jasmin/parser.cup" />
+ </java>
+ <move file="parser.java" tofile="src/jasmin/parser.java" />
+ <move file="sym.java" tofile="src/jasmin/sym.java" />
+ <mkdir dir="src/${tables.dir}/" />
+ <move todir="src/${tables.dir}/">
+ <fileset dir="${tables.dir}/"/>
+ </move>
+ </target>
+
+ <target name="scm" depends="autogen_run">
+ <java-compile source="scm.src" />
+ </target>
+
+ <target name="autogen_compile" depends="jas">
+ <java-compile source="autogen.src" />
+ </target>
+
+ <target name="autogen_run" depends="autogen_compile, determine-autogen-uptodate" unless="autogen-uptodate">
+ <java classname="scm.autogen.autogen" dir="generated/scm" classpath="classes" fork="true" />
+ </target>
+
+ <target name="determine-autogen-uptodate">
+ <uptodate property="autogen-uptodate" srcfile="lib/jas/src/scm/autogen/autogen.java" targetfile="generated/scm/AutoInit.java" />
+ </target>
+
+ <target name="jas">
+ <mkdir dir="classes" />
+ <java-compile source="jas.src" />
+ </target>
+
+ <target name="clean">
+ <delete quiet="true">
+ <fileset dir="classes" includes="**/*.class" />
+ </delete>
+ </target>
+
+ <target name="veryclean" depends="clean">
+ <delete quiet="true">
+ <fileset dir="generated/scm" includes="**/*" />
+ </delete>
+ </target>
+
+ <target name="jasmin-jar" depends="compile">
+ <mkdir dir="META-INF" />
+
+ <manifest file="META-INF/MANIFEST.MF">
+ <attribute name="Main-Class" value="jasmin.Main" />
+ <attribute name="Implementation-Version" value="${jasmin.version}" />
+ </manifest>
+ <jar destfile="${release.loc}/jasminclasses-${jasmin.version}.jar" manifest="META-INF/MANIFEST.MF">
+ <fileset dir="classes" />
+ </jar>
+ <delete dir="META-INF" />
+ </target>
+
+ <target name="jasmin-fulljar" depends="jasmin-jar">
+ <mkdir dir="META-INF" />
+
+ <manifest file="META-INF/MANIFEST.MF">
+ <attribute name="Main-Class" value="jasmin.Main" />
+ <attribute name="Implementation-Version" value="${jasmin.version}" />
+ </manifest>
+
+ <jar destfile="${release.loc}/jasmin-${jasmin.version}.jar" manifest="META-INF/MANIFEST.MF">
+ <zipfileset src="${release.loc}/jasminclasses-${jasmin.version}.jar" />
+ <zipfileset src="${java_cup.jar}" />
+ </jar>
+ <delete dir="META-INF" />
+ </target>
+
+ <target name="barebones" depends="clean, settings">
+ <jar destfile="${release.loc}/jasminsrc-${jasmin.version}.jar">
+ <fileset dir="." excludes="${release.loc}/**" />
+ </jar>
+ <tar destfile="${release.loc}/jasminsrc-${jasmin.version}.tar.gz" compression="gzip" longfile="gnu">
+ <tarfileset dir="." excludes="${release.loc}/**" />
+ </tar>
+ </target>
+
+ <!-- IVY RELATED TARGETS -->
+
+ <target name="download-ivy" unless="offline">
+
+ <mkdir dir="${ivy.jar.dir}"/>
+ <!-- download Ivy from web site so that it can be used even without any special installation -->
+ <get src="https://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar"
+ dest="${ivy.jar.file}" usetimestamp="true"/>
+ </target>
+
+ <target name="init-ivy" depends="download-ivy">
+ <!-- try to load ivy here from ivy home, in case the user has not already dropped
+ it into ant's lib dir (note that the latter copy will always take precedence).
+ We will not fail as long as local lib dir exists (it may be empty) and
+ ivy is in at least one of ant's lib dir or the local lib dir. -->
+ <path id="ivy.lib.path">
+ <fileset dir="${ivy.jar.dir}" includes="*.jar"/>
+
+ </path>
+ <taskdef resource="org/apache/ivy/ant/antlib.xml"
+ uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
+ </target>
+
+ <target name="gen-pom" depends="init-ivy">
+ <ivy:makepom ivyfile="ivy.xml" pomfile="${release.loc}/${ant.project.name}-${jasmin.version}.pom">
+ <mapping conf="default" scope="compile" />
+ </ivy:makepom>
+ </target>
+
+ <target name="publish-local" depends="init-ivy, gen-pom, jasmin-fulljar, jasmin-jar, barebones">
+ <ivy:resolve/>
+ <ivy:publish pubrevision="${jasmin.version}" status="release" resolver="local" overwrite="true" >
+ <artifacts pattern="${release.loc}/[artifact]-[revision].[ext]"/>
+ </ivy:publish>
+ </target>
+
+ <target name="publish-local-maven" depends="init-ivy, gen-pom, jasmin-fulljar, jasmin-jar, barebones" description="publish jar/source to maven repo mounted at ~/.m2/repository">
+ <ivy:resolve/>
+ <ivy:publish pubrevision="${jasmin.version}" resolver="local-m2-publish" forcedeliver="true" overwrite="true" publishivy="false">
+ <artifacts pattern="${release.loc}/[artifact]-[revision].[ext]" />
+ </ivy:publish>
+ </target>
-<project default="compile">
- <property file="ant.settings"/>
- <target name="settings">
- <fail
- message="Please copy ant.settings.template to ant.settings, and set the variables in it."
- unless="java_cup.jar"
- />
- </target>
-
- <target name="compile" depends="settings,scm">
- <javac
- destdir="classes"
- classpath="classes:${java_cup.jar}"
- source="1.5"
- target="1.5"
- debug="true"
- >
- <src path="src"/>
- <src path="generated/"/>
- </javac>
- </target>
-
- <target name="build_parser">
- <java
- classname="java_cup.Main"
- dir="src/jasmin"
- classpath="${java_cup.jar}"
- >
- <arg line="src/jasmin/parser.cup"/>
- </java>
- <move file="parser.java" tofile="src/jasmin/parser.java"/>
- <move file="sym.java" tofile="src/jasmin/sym.java"/>
- </target>
-
- <target name="scm" depends="autogen_run">
- <javac
- destdir="classes"
- classpath="classes"
- debug="true"
- deprecation="true"
- source="1.5"
- target="1.5"
- >
- <src path="lib/jas/src/scm"/>
- <src path="generated/scm"/>
- </javac>
- </target>
-
- <target name="autogen_compile" depends="jas">
- <javac
- destdir="classes"
- classpath="classes"
- debug="true"
- source="1.5"
- target="1.5"
- >
- <src path="lib/jas/src/scm/autogen/"/>
- </javac>
- </target>
-
- <target name="autogen_run" depends="autogen_compile, determine-autogen-uptodate" unless="autogen-uptodate">
- <java
- classname="autogen"
- dir="generated/scm"
- classpath="classes"
- fork="true"
- >
- </java>
- </target>
-
- <target name="determine-autogen-uptodate">
- <uptodate property="autogen-uptodate" srcfile="lib/jas/src/scm/autogen/autogen.java" targetfile="generated/scm/AutoInit.java"/>
- </target>
-
- <target name="jas">
- <javac
- destdir="classes"
- optimize="true"
- debug="true"
- source="1.5"
- target="1.5"
- >
- <src path="lib/jas/src/jas"/>
- </javac>
- </target>
-
- <target name="clean">
- <delete quiet="true">
- <fileset dir="classes" includes="**/*.class"/>
- </delete>
- </target>
-
- <target name="veryclean" depends="clean">
- <delete quiet="true">
- <fileset dir="generated/scm" includes="**/*"/>
- </delete>
- </target>
-
- <target name="jasmin-jar" depends="compile">
- <mkdir dir="META-INF"/>
-
- <manifest file="META-INF/MANIFEST.MF">
- <attribute name="Main-Class" value="jasmin.Main"/>
- <attribute name="Implementation-Version" value="${jasmin.version}"/>
- </manifest>
-
- <jar destfile="${release.loc}/jasminclasses-${jasmin.version}.jar" manifest="META-INF/MANIFEST.MF">
- <fileset dir="classes"/>
- </jar>
- <delete dir="META-INF"/>
- </target>
-
- <target name="barebones" depends="clean,settings">
- <jar destfile="${release.loc}/jasminsrc-${jasmin.version}.jar">
- <fileset dir="."/>
- </jar>
- <tar destfile="${release.loc}/jasminsrc-${jasmin.version}.tar.gz" compression="gzip" longfile="gnu">
- <tarfileset dir="."/>
- </tar>
- </target>
</project>
=====================================
generated/scm/AutoProcs.java
=====================================
@@ -1,7 +1,7 @@
package scm;
import jas.*;
-//Autogenerated by procinfo on Thu May 19 14:07:20 EDT 2005
+//Autogenerated by procinfo on Tue Feb 02 13:50:39 CET 2016
class scmaddCPItem extends Procedure implements Obj
{
Obj apply(Cell args, Env f)
@@ -26,7 +26,7 @@ class scmaddCPItem extends Procedure implements Obj
public String toString()
{ return ("<#jas-class-addcpe#>"); }
}
-//Autogenerated by procinfo on Thu May 19 14:07:20 EDT 2005
+//Autogenerated by procinfo on Tue Feb 02 13:50:39 CET 2016
class scmaddField extends Procedure implements Obj
{
Obj apply(Cell args, Env f)
@@ -51,7 +51,7 @@ class scmaddField extends Procedure implements Obj
public String toString()
{ return ("<#jas-class-addfield#>"); }
}
-//Autogenerated by procinfo on Thu May 19 14:07:20 EDT 2005
+//Autogenerated by procinfo on Tue Feb 02 13:50:39 CET 2016
class scmaddInterface extends Procedure implements Obj
{
Obj apply(Cell args, Env f)
@@ -76,7 +76,7 @@ class scmaddInterface extends Procedure implements Obj
public String toString()
{ return ("<#jas-class-addinterface#>"); }
}
-//Autogenerated by procinfo on Thu May 19 14:07:20 EDT 2005
+//Autogenerated by procinfo on Tue Feb 02 13:50:39 CET 2016
class scmsetClass extends Procedure implements Obj
{
Obj apply(Cell args, Env f)
@@ -101,7 +101,7 @@ class scmsetClass extends Procedure implements Obj
public String toString()
{ return ("<#jas-class-setclass#>"); }
}
-//Autogenerated by procinfo on Thu May 19 14:07:20 EDT 2005
+//Autogenerated by procinfo on Tue Feb 02 13:50:39 CET 2016
class scmsetSuperClass extends Procedure implements Obj
{
Obj apply(Cell args, Env f)
@@ -126,7 +126,7 @@ class scmsetSuperClass extends Procedure implements Obj
public String toString()
{ return ("<#jas-class-setsuperclass#>"); }
}
-//Autogenerated by procinfo on Thu May 19 14:07:20 EDT 2005
+//Autogenerated by procinfo on Tue Feb 02 13:50:39 CET 2016
class scmaddMethod extends Procedure implements Obj
{
Obj apply(Cell args, Env f)
@@ -168,7 +168,7 @@ class scmaddMethod extends Procedure implements Obj
public String toString()
{ return ("<#jas-class-addmethod#>"); }
}
-//Autogenerated by procinfo on Thu May 19 14:07:20 EDT 2005
+//Autogenerated by procinfo on Tue Feb 02 13:50:39 CET 2016
class scmsetClassAccess extends Procedure implements Obj
{
Obj apply(Cell args, Env f)
@@ -192,7 +192,7 @@ class scmsetClassAccess extends Procedure implements Obj
public String toString()
{ return ("<#jas-class-setaccess#>"); }
}
-//Autogenerated by procinfo on Thu May 19 14:07:20 EDT 2005
+//Autogenerated by procinfo on Tue Feb 02 13:50:39 CET 2016
class scmsetSource extends Procedure implements Obj
{
Obj apply(Cell args, Env f)
@@ -216,7 +216,7 @@ class scmsetSource extends Procedure implements Obj
public String toString()
{ return ("<#jas-class-setsource#>"); }
}
-//Autogenerated by procinfo on Thu May 19 14:07:20 EDT 2005
+//Autogenerated by procinfo on Tue Feb 02 13:50:39 CET 2016
class scmwrite extends Procedure implements Obj
{
Obj apply(Cell args, Env f)
@@ -241,7 +241,7 @@ class scmwrite extends Procedure implements Obj
public String toString()
{ return ("<#jas-class-write#>"); }
}
-//Autogenerated by procinfo on Thu May 19 14:07:20 EDT 2005
+//Autogenerated by procinfo on Tue Feb 02 13:50:39 CET 2016
class scmaddException extends Procedure implements Obj
{
Obj apply(Cell args, Env f)
@@ -266,7 +266,7 @@ class scmaddException extends Procedure implements Obj
public String toString()
{ return ("<#jas-exception-add#>"); }
}
-//Autogenerated by procinfo on Thu May 19 14:07:20 EDT 2005
+//Autogenerated by procinfo on Tue Feb 02 13:50:39 CET 2016
class scmaddInsn extends Procedure implements Obj
{
Obj apply(Cell args, Env f)
@@ -291,7 +291,7 @@ class scmaddInsn extends Procedure implements Obj
public String toString()
{ return ("<#jas-code-addinsn#>"); }
}
-//Autogenerated by procinfo on Thu May 19 14:07:20 EDT 2005
+//Autogenerated by procinfo on Tue Feb 02 13:50:39 CET 2016
class scmsetStackSize extends Procedure implements Obj
{
Obj apply(Cell args, Env f)
@@ -315,7 +315,7 @@ class scmsetStackSize extends Procedure implements Obj
public String toString()
{ return ("<#jas-code-stack-size#>"); }
}
-//Autogenerated by procinfo on Thu May 19 14:07:20 EDT 2005
+//Autogenerated by procinfo on Tue Feb 02 13:50:39 CET 2016
class scmsetVarSize extends Procedure implements Obj
{
Obj apply(Cell args, Env f)
@@ -339,7 +339,7 @@ class scmsetVarSize extends Procedure implements Obj
public String toString()
{ return ("<#jas-code-var-size#>"); }
}
-//Autogenerated by procinfo on Thu May 19 14:07:20 EDT 2005
+//Autogenerated by procinfo on Tue Feb 02 13:50:39 CET 2016
class scmsetCatchtable extends Procedure implements Obj
{
Obj apply(Cell args, Env f)
@@ -364,7 +364,7 @@ class scmsetCatchtable extends Procedure implements Obj
public String toString()
{ return ("<#jas-set-catchtable#>"); }
}
-//Autogenerated by procinfo on Thu May 19 14:07:20 EDT 2005
+//Autogenerated by procinfo on Tue Feb 02 13:50:39 CET 2016
class scmaddEntry extends Procedure implements Obj
{
Obj apply(Cell args, Env f)
=====================================
generated/scm/AutoTypes.java
=====================================
@@ -1,7 +1,7 @@
package scm;
import jas.*;
-//Autogenerated by typeinfo on Thu May 19 14:07:20 EDT 2005
+//Autogenerated by typeinfo on Tue Feb 02 13:50:39 CET 2016
class scmAsciiCP extends Procedure implements Obj
{
Obj apply(Cell args, Env f)
@@ -18,7 +18,7 @@ class scmAsciiCP extends Procedure implements Obj
public String toString()
{ return ("<#make-ascii-cpe#>"); }
}
-//Autogenerated by typeinfo on Thu May 19 14:07:20 EDT 2005
+//Autogenerated by typeinfo on Tue Feb 02 13:50:39 CET 2016
class scmClassCP extends Procedure implements Obj
{
Obj apply(Cell args, Env f)
@@ -35,7 +35,7 @@ class scmClassCP extends Procedure implements Obj
public String toString()
{ return ("<#make-class-cpe#>"); }
}
-//Autogenerated by typeinfo on Thu May 19 14:07:20 EDT 2005
+//Autogenerated by typeinfo on Tue Feb 02 13:50:39 CET 2016
class scmNameTypeCP extends Procedure implements Obj
{
Obj apply(Cell args, Env f)
@@ -56,7 +56,7 @@ class scmNameTypeCP extends Procedure implements Obj
public String toString()
{ return ("<#make-name-type-cpe#>"); }
}
-//Autogenerated by typeinfo on Thu May 19 14:07:20 EDT 2005
+//Autogenerated by typeinfo on Tue Feb 02 13:50:39 CET 2016
class scmFieldCP extends Procedure implements Obj
{
Obj apply(Cell args, Env f)
@@ -81,7 +81,7 @@ class scmFieldCP extends Procedure implements Obj
public String toString()
{ return ("<#make-field-cpe#>"); }
}
-//Autogenerated by typeinfo on Thu May 19 14:07:20 EDT 2005
+//Autogenerated by typeinfo on Tue Feb 02 13:50:39 CET 2016
class scmInterfaceCP extends Procedure implements Obj
{
Obj apply(Cell args, Env f)
@@ -106,7 +106,7 @@ class scmInterfaceCP extends Procedure implements Obj
public String toString()
{ return ("<#make-interface-cpe#>"); }
}
-//Autogenerated by typeinfo on Thu May 19 14:07:20 EDT 2005
+//Autogenerated by typeinfo on Tue Feb 02 13:50:39 CET 2016
class scmMethodCP extends Procedure implements Obj
{
Obj apply(Cell args, Env f)
@@ -131,7 +131,7 @@ class scmMethodCP extends Procedure implements Obj
public String toString()
{ return ("<#make-method-cpe#>"); }
}
-//Autogenerated by typeinfo on Thu May 19 14:07:20 EDT 2005
+//Autogenerated by typeinfo on Tue Feb 02 13:50:39 CET 2016
class scmIntegerCP extends Procedure implements Obj
{
Obj apply(Cell args, Env f)
@@ -148,7 +148,7 @@ class scmIntegerCP extends Procedure implements Obj
public String toString()
{ return ("<#make-integer-cpe#>"); }
}
-//Autogenerated by typeinfo on Thu May 19 14:07:20 EDT 2005
+//Autogenerated by typeinfo on Tue Feb 02 13:50:39 CET 2016
class scmFloatCP extends Procedure implements Obj
{
Obj apply(Cell args, Env f)
@@ -165,7 +165,7 @@ class scmFloatCP extends Procedure implements Obj
public String toString()
{ return ("<#make-float-cpe#>"); }
}
-//Autogenerated by typeinfo on Thu May 19 14:07:20 EDT 2005
+//Autogenerated by typeinfo on Tue Feb 02 13:50:39 CET 2016
class scmLongCP extends Procedure implements Obj
{
Obj apply(Cell args, Env f)
@@ -182,7 +182,7 @@ class scmLongCP extends Procedure implements Obj
public String toString()
{ return ("<#make-long-cpe#>"); }
}
-//Autogenerated by typeinfo on Thu May 19 14:07:20 EDT 2005
+//Autogenerated by typeinfo on Tue Feb 02 13:50:39 CET 2016
class scmDoubleCP extends Procedure implements Obj
{
Obj apply(Cell args, Env f)
@@ -199,7 +199,7 @@ class scmDoubleCP extends Procedure implements Obj
public String toString()
{ return ("<#make-double-cpe#>"); }
}
-//Autogenerated by typeinfo on Thu May 19 14:07:20 EDT 2005
+//Autogenerated by typeinfo on Tue Feb 02 13:50:39 CET 2016
class scmStringCP extends Procedure implements Obj
{
Obj apply(Cell args, Env f)
@@ -216,7 +216,7 @@ class scmStringCP extends Procedure implements Obj
public String toString()
{ return ("<#make-string-cpe#>"); }
}
-//Autogenerated by typeinfo on Thu May 19 14:07:20 EDT 2005
+//Autogenerated by typeinfo on Tue Feb 02 13:50:39 CET 2016
class scmVar extends Procedure implements Obj
{
Obj apply(Cell args, Env f)
@@ -248,7 +248,7 @@ class scmVar extends Procedure implements Obj
public String toString()
{ return ("<#make-field#>"); }
}
-//Autogenerated by typeinfo on Thu May 19 14:07:20 EDT 2005
+//Autogenerated by typeinfo on Tue Feb 02 13:50:39 CET 2016
class scmConstAttr extends Procedure implements Obj
{
Obj apply(Cell args, Env f)
@@ -266,7 +266,7 @@ class scmConstAttr extends Procedure implements Obj
public String toString()
{ return ("<#make-const#>"); }
}
-//Autogenerated by typeinfo on Thu May 19 14:07:20 EDT 2005
+//Autogenerated by typeinfo on Tue Feb 02 13:50:39 CET 2016
class scmscmOutputStream extends Procedure implements Obj
{
Obj apply(Cell args, Env f)
@@ -283,7 +283,7 @@ class scmscmOutputStream extends Procedure implements Obj
public String toString()
{ return ("<#make-outputstream#>"); }
}
-//Autogenerated by typeinfo on Thu May 19 14:07:20 EDT 2005
+//Autogenerated by typeinfo on Tue Feb 02 13:50:39 CET 2016
class scmLabel extends Procedure implements Obj
{
Obj apply(Cell args, Env f)
@@ -300,7 +300,7 @@ class scmLabel extends Procedure implements Obj
public String toString()
{ return ("<#make-label#>"); }
}
-//Autogenerated by typeinfo on Thu May 19 14:07:20 EDT 2005
+//Autogenerated by typeinfo on Tue Feb 02 13:50:39 CET 2016
class scmClassEnv extends Procedure implements Obj
{
Obj apply(Cell args, Env f)
@@ -313,7 +313,7 @@ class scmClassEnv extends Procedure implements Obj
public String toString()
{ return ("<#make-class-env#>"); }
}
-//Autogenerated by typeinfo on Thu May 19 14:07:20 EDT 2005
+//Autogenerated by typeinfo on Tue Feb 02 13:50:39 CET 2016
class scmCodeAttr extends Procedure implements Obj
{
Obj apply(Cell args, Env f)
@@ -326,7 +326,7 @@ class scmCodeAttr extends Procedure implements Obj
public String toString()
{ return ("<#make-code#>"); }
}
-//Autogenerated by typeinfo on Thu May 19 14:07:20 EDT 2005
+//Autogenerated by typeinfo on Tue Feb 02 13:50:39 CET 2016
class scmExceptAttr extends Procedure implements Obj
{
Obj apply(Cell args, Env f)
@@ -339,7 +339,7 @@ class scmExceptAttr extends Procedure implements Obj
public String toString()
{ return ("<#make-exception#>"); }
}
-//Autogenerated by typeinfo on Thu May 19 14:07:20 EDT 2005
+//Autogenerated by typeinfo on Tue Feb 02 13:50:39 CET 2016
class scmCatchtable extends Procedure implements Obj
{
Obj apply(Cell args, Env f)
@@ -352,7 +352,7 @@ class scmCatchtable extends Procedure implements Obj
public String toString()
{ return ("<#make-catchtable#>"); }
}
-//Autogenerated by typeinfo on Thu May 19 14:07:20 EDT 2005
+//Autogenerated by typeinfo on Tue Feb 02 13:50:39 CET 2016
class scmCatchEntry extends Procedure implements Obj
{
Obj apply(Cell args, Env f)
@@ -385,7 +385,7 @@ class scmCatchEntry extends Procedure implements Obj
public String toString()
{ return ("<#make-catch-entry#>"); }
}
-//Autogenerated by typeinfo on Thu May 19 14:07:20 EDT 2005
+//Autogenerated by typeinfo on Tue Feb 02 13:50:39 CET 2016
class scmIincInsn extends Procedure implements Obj
{
Obj apply(Cell args, Env f)
@@ -406,7 +406,7 @@ class scmIincInsn extends Procedure implements Obj
public String toString()
{ return ("<#iinc#>"); }
}
-//Autogenerated by typeinfo on Thu May 19 14:07:20 EDT 2005
+//Autogenerated by typeinfo on Tue Feb 02 13:50:39 CET 2016
class scmMultiarrayInsn extends Procedure implements Obj
{
Obj apply(Cell args, Env f)
@@ -428,7 +428,7 @@ class scmMultiarrayInsn extends Procedure implements Obj
public String toString()
{ return ("<#multianewarray#>"); }
}
-//Autogenerated by typeinfo on Thu May 19 14:07:20 EDT 2005
+//Autogenerated by typeinfo on Tue Feb 02 13:50:39 CET 2016
class scmInvokeinterfaceInsn extends Procedure implements Obj
{
Obj apply(Cell args, Env f)
=====================================
ivy.xml
=====================================
@@ -0,0 +1,17 @@
+<ivy-module version="2.0">
+ <info organisation="ca.mcgill.sable" module="jasmin"/>
+
+ <configurations>
+ <conf name="default" />
+ <conf name="sources" />
+ </configurations>
+
+ <publications>
+ <artifact name="jasmin" type="jar" ext="jar" conf="default" />
+ <artifact name="jasmin" type="pom" ext="pom" conf="default" />
+ <artifact name="jasminsrc" type="source" ext="jar" conf="sources" />
+ <!--
+ <artifact name="jasmin" type="classes" ext="jar" />
+ -->
+ </publications>
+</ivy-module>
\ No newline at end of file
=====================================
ivysettings.xml
=====================================
@@ -0,0 +1,10 @@
+<ivysettings>
+ <settings defaultResolver="local"/>
+ <include url="${ivy.default.settings.dir}/ivysettings-local.xml"/>
+ <resolvers>
+ <ibiblio name="local-m2" m2compatible="true" root="file://${user.home}/.m2/repository" changingPattern=".*SNAPSHOT" />
+ <filesystem name="local-m2-publish" m2compatible="true">
+ <artifact pattern="${user.home}/.m2/repository/[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]"/>
+ </filesystem>
+ </resolvers>
+</ivysettings>
\ No newline at end of file
=====================================
lib/jas/src/jas/ClassEnv.java
=====================================
@@ -25,7 +25,7 @@ public class ClassEnv implements RuntimeConstants
Vector interfaces;
Vector vars;
Vector methods;
- SourceAttr source;
+ SourceAttr source = null;
Vector generic;
boolean hasSuperClass;
InnerClassAttr inner_class_attr;
@@ -42,8 +42,8 @@ public class ClassEnv implements RuntimeConstants
{
// Fill in reasonable defaults
magic = JAVA_MAGIC;
- version_lo = (short) JAVA_MINOR_VERSION;
- version_hi = (short) JAVA_VERSION;
+ version_lo = (short) JAVA1_2_MINOR_VERSION;
+ version_hi = (short) JAVA1_2_VERSION;
// Initialize bags
cpe = new Hashtable();
cpe_index = null;
@@ -54,14 +54,24 @@ public class ClassEnv implements RuntimeConstants
bsm_attr = null;
}
- public void requireJava1_4(){
- version_lo = (short) Math.max(version_lo,(short) JAVA_MINOR_HIGH_VERSION);
- version_hi = (short) Math.max(version_hi,(short) JAVA_HIGH_VERSION);
+ public void requireJava1_4() {
+ version_lo = (short) Math.max(version_lo,(short) JAVA1_4_MINOR_HIGH_VERSION);
+ version_hi = (short) Math.max(version_hi,(short) JAVA1_4_HIGH_VERSION);
}
-
- public void requireJava7(){
- version_lo = (short) JAVA7_MINOR_HIGH_VERSION;
- version_hi = (short) JAVA7_HIGH_VERSION;
+
+ public void requireJava5() {
+ version_lo = (short) Math.max(version_lo,(short) JAVA5_MINOR_HIGH_VERSION);
+ version_hi = (short) Math.max(version_hi,(short) JAVA5_HIGH_VERSION);
+ }
+
+ public void requireJava6() {
+ version_lo = (short) Math.max(version_lo, (short) JAVA6_MINOR_HIGH_VERSION);
+ version_hi = (short) Math.max(version_hi, (short) JAVA6_HIGH_VERSION);
+ }
+
+ public void requireJava7() {
+ version_lo = (short) Math.max(version_lo, (short) JAVA7_MINOR_HIGH_VERSION);
+ version_hi = (short) Math.max(version_hi, (short) JAVA7_HIGH_VERSION);
}
/**
@@ -394,8 +404,14 @@ public class ClassEnv implements RuntimeConstants
* for the clas.
* @param source String with the name of the class
*/
- public void setSource(String source)
- { this.source = new SourceAttr(source); this.source.resolve(this); }
+ public void setSource(String source) {
+ if (source == null)
+ this.source = null;
+ else {
+ this.source = new SourceAttr(source);
+ this.source.resolve(this);
+ }
+ }
/**
* Add a generic attribute to the class file. A generic attribute
=====================================
lib/jas/src/jas/EnclMethAttr.java
=====================================
@@ -19,7 +19,8 @@ public class EnclMethAttr {
void resolve(ClassEnv e){
e.addCPItem(attr);
e.addCPItem(cls);
- e.addCPItem(meth);
+ if (null != meth)
+ e.addCPItem(meth);
}
/**
@@ -29,7 +30,8 @@ public class EnclMethAttr {
*/
public EnclMethAttr(String a, String b, String c) { //
cls = new ClassCP(a);
- meth = new NameTypeCP(b, c);
+ if (!b.isEmpty() && !c.isEmpty())
+ meth = new NameTypeCP(b, c);
}
int size(){
@@ -44,6 +46,6 @@ public class EnclMethAttr {
out.writeShort(e.getCPIndex(attr));
out.writeInt(4); // fixed length
out.writeShort(e.getCPIndex(cls));
- out.writeShort(e.getCPIndex(meth));
+ out.writeShort(null == meth ? 0 : e.getCPIndex(meth));
}
}
=====================================
lib/jas/src/jas/InsnOperand.java
=====================================
@@ -198,7 +198,9 @@ class LdcOperand extends InsnOperand implements RuntimeConstants
void resolve(ClassEnv e)
{ e.addCPItem(cpe);
if (cpe instanceof ClassCP){
- e.requireJava1_4();
+ // If the constant is a Type (for .class constants),
+ // the class major version must be 49.0 (Java5) or more.
+ e.requireJava5();
}
}
=====================================
lib/jas/src/jas/InvokeDynamicCP.java
=====================================
@@ -5,8 +5,9 @@
*/
package jas;
-import java.io.*;
+import java.io.DataOutputStream;
+import java.io.IOException;
public class InvokeDynamicCP extends CP implements RuntimeConstants
{
@@ -19,18 +20,18 @@ public class InvokeDynamicCP extends CP implements RuntimeConstants
* @param bsmName name of bootstrap method
* @param bsmSig Signature of bootstrap method
* @param bsmName uninterpreted name of called method
- * @param bsmSig Signature of calledmethod
+ * @param bsmSig Signature of called method
* @param bsmTableIndex index to the entry for the related bootstrap method in the BootstrapMethods attribute table
*/
public InvokeDynamicCP(String bsmClassName, String bsmName, String bsmSig, String methodName, String methodSig, int bsmTableIndex)
{
this.bsmTableIndex = bsmTableIndex;
- uniq = (bsmClassName + "fv0" + bsmName + "&%$91&" + bsmSig+ "*(012$" + methodName + "dfg8932" + methodSig).intern();
+ uniq = (bsmClassName + "fv0\u00A4" + bsmName + "&%$91&" + bsmSig+ "*(012$" + methodName + "dfg8932" + methodSig).intern();
bsm = new MethodHandleCP(
- MethodHandleCP.STATIC_METHOD_KIND, //bootstrap methods are always static methods
- bsmClassName,
- bsmName,
- bsmSig);
+ MethodHandleCP.STATIC_METHOD_KIND, //bootstrap methods are always static methods
+ bsmClassName,
+ bsmName,
+ bsmSig);
method = new NameTypeCP(methodName, methodSig);
}
=====================================
lib/jas/src/jas/MethodHandleCP.java
=====================================
@@ -5,14 +5,14 @@
*/
package jas;
-import java.io.*;
+import java.io.DataOutputStream;
+import java.io.IOException;
public class MethodHandleCP extends CP implements RuntimeConstants
{
- public final static int STATIC_METHOD_KIND = 6;
+ public final static int STATIC_METHOD_KIND = 6;
-
int kind;
CP fieldOrMethod;
@@ -24,11 +24,11 @@ public class MethodHandleCP extends CP implements RuntimeConstants
*/
public MethodHandleCP(int kind, String ownerName, String fieldOrMethodName, String sig)
{
- uniq = kind + "$gfd" + ownerName + "&%$91&" + fieldOrMethodName + "*(012$" + sig;
+ uniq = kind + "$gfd\u00A4" + ownerName + "&%$91&" + fieldOrMethodName + "*(012$" + sig;
if(kind<5) { //first for kinds refer to fields
- fieldOrMethod = new FieldCP(ownerName, fieldOrMethodName, sig);
+ fieldOrMethod = new FieldCP(ownerName, fieldOrMethodName, sig);
} else {
- fieldOrMethod = new MethodCP(ownerName, fieldOrMethodName, sig);
+ fieldOrMethod = new MethodCP(ownerName, fieldOrMethodName, sig);
}
this.kind = kind;
}
=====================================
lib/jas/src/jas/RuntimeConstants.java
=====================================
@@ -7,10 +7,22 @@ public interface RuntimeConstants {
// top-level constants
public static final int JAVA_MAGIC = -889275714;
- public static final int JAVA_VERSION = 46;
- public static final int JAVA_MINOR_VERSION = 0;
- public static final int JAVA_HIGH_VERSION = 49;
- public static final int JAVA_MINOR_HIGH_VERSION = 0;
+ // J2SE 8 = 52 (0x34 hex),
+ // J2SE 7 = 51 (0x33 hex),
+ // J2SE 6.0 = 50 (0x32 hex),
+ // J2SE 5.0 = 49 (0x31 hex),
+ // JDK 1.4 = 48 (0x30 hex),
+ // JDK 1.3 = 47 (0x2F hex),
+ // JDK 1.2 = 46 (0x2E hex),
+ // JDK 1.1 = 45 (0x2D hex).
+ public static final int JAVA1_2_VERSION = 46;
+ public static final int JAVA1_2_MINOR_VERSION = 0;
+ public static final int JAVA1_4_HIGH_VERSION = 48;
+ public static final int JAVA1_4_MINOR_HIGH_VERSION = 0;
+ public static final int JAVA5_HIGH_VERSION = 49;
+ public static final int JAVA5_MINOR_HIGH_VERSION = 0;
+ public static final int JAVA6_HIGH_VERSION = 50;
+ public static final int JAVA6_MINOR_HIGH_VERSION = 0;
public static final int JAVA7_HIGH_VERSION = 51;
public static final int JAVA7_MINOR_HIGH_VERSION = 0;
=====================================
lib/jas/src/scm/autogen/autogen.java
=====================================
@@ -1,3 +1,4 @@
+package scm.autogen;
// Generate glue code
import java.io.*;
@@ -74,7 +75,7 @@ class typeinfo
(" "+java_inp_type[i]+" arg" + i +
" = (" + java_inp_type[i] + ")(((Selfrep)tmp).num);");
}
-
+
break;
default: // primnode
out.println
@@ -83,7 +84,7 @@ class typeinfo
scm_name + " expects a " + java_inp_type[i] +
" for arg #" + (i+1) + "\"); }");
out.println
- (" if ((tmp != null) && !((((primnode)tmp).val) instanceof " +
+ (" if ((tmp != null) && !((((primnode)tmp).val) instanceof " +
java_inp_type[i] + ")) { throw new SchemeError(\"" +
scm_name + " expects a " + java_inp_type[i] +
" for arg #" + (i+1) + "\"); }");
@@ -183,7 +184,7 @@ class procinfo
scm_name + " expects a " + java_inp_type[i] +
" for arg #" + (i+1) + "\"); }");
out.println
- (" if ((tmp != null) && !((((primnode)tmp).val) instanceof " +
+ (" if ((tmp != null) && !((((primnode)tmp).val) instanceof " +
java_inp_type[i] + ")) { throw new SchemeError(\"" +
scm_name + " expects a " + java_inp_type[i] +
" for arg #" + (i+1) + "\"); }");
@@ -206,7 +207,7 @@ class procinfo
class autogen implements jas.RuntimeConstants
{
-
+
static String procs[][] =
{
// Manipulate class env
=====================================
pom.xml
=====================================
@@ -0,0 +1,132 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>ca.mcgill.sable</groupId>
+ <artifactId>jasmin</artifactId>
+ <name>Jasmin</name>
+ <version>3.0.1-SNAPSHOT</version>
+ <description>Java Assembler Interface for the Soot framework</description>
+ <properties>
+ <maven.compiler.source>1.7</maven.compiler.source>
+ <maven.compiler.target>1.7</maven.compiler.target>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+ <build>
+ <finalName>jasminclasses-trunk</finalName>
+ <sourceDirectory>src</sourceDirectory>
+ <testSourceDirectory>tests</testSourceDirectory>
+ <resources>
+ <resource>
+ <directory>src</directory>
+ <includes>
+ <include>tables.out/*.obj</include>
+ </includes>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.12</version>
+ <executions>
+ <execution>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>${basedir}/generated/scm</source>
+ <source>${basedir}/lib/jas/src</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.2</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>3.0.2</version>
+ <configuration>
+ <archive>
+ <manifest>
+ <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+ <mainClass>jasmin.Main</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.17</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <descriptorRefs>
+ <descriptorRef>jar-with-dependencies</descriptorRef>
+ </descriptorRefs>
+ <finalName>jamsin-trunk</finalName>
+ <appendAssemblyId>false</appendAssemblyId>
+ <archive>
+ <manifest>
+ <addClasspath>true</addClasspath>
+ <mainClass>jasmin.Main</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <!-- Testing dependencies -->
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.11</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest-all</artifactId>
+ <version>1.3</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>ca.mcgill.sable</groupId>
+ <artifactId>java_cup</artifactId>
+ <version>0.9.2</version>
+ </dependency>
+ </dependencies>
+
+ <repositories>
+ <repository>
+ <id>soot-snapshot</id>
+ <name>soot snapshots</name>
+ <url>http://soot-build.cs.uni-paderborn.de/nexus/repository/soot-snapshot/</url>
+ </repository>
+ <repository>
+ <id>soot-release</id>
+ <name>sot release</name>
+ <url>http://soot-build.cs.uni-paderborn.de/nexus/repository/soot-release/</url>
+ </repository>
+ </repositories>
+</project>
=====================================
src/jasmin/ClassFile.java
=====================================
@@ -17,13 +17,67 @@ package jasmin;
import static jas.MethodHandleCP.STATIC_METHOD_KIND;
-import jas.*;
+import jas.AnnotElemValPair;
+import jas.AnnotationAttr;
+import jas.AnnotationDefaultAttr;
+import jas.ArrayElemValPair;
+import jas.AsciiCP;
+import jas.CP;
+import jas.Catchtable;
+import jas.ClassCP;
+import jas.ClassElemValPair;
+import jas.ClassEnv;
+import jas.CodeAttr;
+import jas.ConstAttr;
+import jas.DeprecatedAttr;
+import jas.DoubleCP;
+import jas.DoubleElemValPair;
+import jas.ElemValPair;
+import jas.EnclMethAttr;
+import jas.EnumElemValPair;
+import jas.ExceptAttr;
+import jas.FieldCP;
+import jas.FloatCP;
+import jas.FloatElemValPair;
+import jas.GenericAttr;
+import jas.IincInsn;
+import jas.InnerClassAttr;
+import jas.InnerClassSpecAttr;
+import jas.Insn;
+import jas.IntElemValPair;
+import jas.IntegerCP;
+import jas.InterfaceCP;
+import jas.InvokeDynamicCP;
+import jas.InvokeinterfaceInsn;
+import jas.Label;
+import jas.LineTableAttr;
+import jas.LocalVarEntry;
+import jas.LocalVarTableAttr;
+import jas.LongCP;
+import jas.LongElemValPair;
+import jas.LookupswitchInsn;
+import jas.Method;
+import jas.MethodCP;
+import jas.MethodHandleCP;
+import jas.MultiarrayInsn;
+import jas.ParameterVisibilityAnnotationAttr;
+import jas.SignatureAttr;
+import jas.StringCP;
+import jas.StringElemValPair;
+import jas.SyntheticAttr;
+import jas.TableswitchInsn;
+import jas.Var;
+import jas.VisibilityAnnotationAttr;
+import jas.jasError;
-import java.io.InputStream;
-import java.io.OutputStream;
import java.io.DataOutputStream;
import java.io.IOException;
-import java.util.*;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.Vector;
/**
* A ClassFile object is used to represent the binary data that makes up a
@@ -96,6 +150,7 @@ public class ClassFile {
if(currentMethod == null)
System.err.println("Error: no field in scope to add attribute onto.");
else {
+ class_env.requireJava6();
class_env.addCPItem(new AsciiCP(name));
currentMethod.addGenericAttr(new GenericAttr(name, value));
}
@@ -106,6 +161,7 @@ public class ClassFile {
if(currentField == null)
System.err.println("Error: no field in scope to add attribute onto.");
else {
+ class_env.requireJava6();
class_env.addCPItem(new AsciiCP(name));
currentField.addGenericAttr(new GenericAttr(name, value));
}
@@ -117,13 +173,14 @@ public class ClassFile {
}
else {
//System.out.println("adding deprec to field" );
+ class_env.requireJava6();
currentField.addDeprecatedAttr(new DeprecatedAttr());
}
}
- public void addGenericAttrToClass(GenericAttr g)
- {
- class_env.addGenericAttr(g);
+ public void addGenericAttrToClass(GenericAttr g) {
+ class_env.requireJava6();
+ class_env.addGenericAttr(g);
}
static final String BGN_METHOD = "bgnmethod:";
@@ -196,24 +253,37 @@ public class ClassFile {
void addClassDeprAttr(Object res){
if (res != null){
+ class_env.requireJava5();
class_env.setClassDepr(new DeprecatedAttr());
}
}
void addClassSigAttr(Object res){
if (res != null){
- class_env.setClassSigAttr(new SignatureAttr((String)res));
+ String sig = (String)res;
+ class_env.setClassSigAttr(new SignatureAttr(sig));
+
+ // Templates were introduced in Java 5.
+ // http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.3.4
+ // tells that "Signatures are used to encode Java programming language type
+ // information that is not part of the Java Virtual Machine type system, such
+ // as generic type"
+ if (sig.contains("<")) {
+ class_env.requireJava5();
+ }
}
}
void addClassAnnotAttrVisible(Object res){
if (res != null){
+ class_env.requireJava5();
class_env.setClassAnnotAttrVis((VisibilityAnnotationAttr)res);
}
}
void addClassAnnotAttrInvisible(Object res){
if (res != null){
+ class_env.requireJava5();
class_env.setClassAnnotAttrInvis((VisibilityAnnotationAttr)res);
}
}
@@ -228,6 +298,9 @@ public class ClassFile {
void addField(short access, String name,
String sig, Object value, String synth, Object dep_attr, Object sig_attr, Object vis_annot_attr, Object vis_annot_attr2) {
+ if (sig.contains("<") || (sig_attr != null && ((String)sig_attr).contains("<"))) {
+ class_env.requireJava5();
+ }
if (value == null) {
// defining a field which doesn't have an initial value
@@ -236,14 +309,17 @@ public class ClassFile {
}
else {
currentField = new Var(access, new AsciiCP(name), new AsciiCP(sig), null, new SyntheticAttr());
+ class_env.requireJava6();
}
if(dep_attr != null){
+ class_env.requireJava5();
currentField.addDeprecatedAttr(new DeprecatedAttr());
}
if(sig_attr != null){
currentField.addSignatureAttr(new SignatureAttr((String)sig_attr));
}
if (vis_annot_attr != null){
+ class_env.requireJava5();
VisibilityAnnotationAttr attribute = (VisibilityAnnotationAttr)vis_annot_attr;
if(attribute.getKind().equals("RuntimeVisible"))
currentField.addVisibilityAnnotationAttrVis(attribute);
@@ -251,6 +327,7 @@ public class ClassFile {
currentField.addVisibilityAnnotationAttrInvis(attribute);
}
if (vis_annot_attr2 != null){
+ class_env.requireJava5();
VisibilityAnnotationAttr attribute = (VisibilityAnnotationAttr)vis_annot_attr2;
if(attribute.getKind().equals("RuntimeVisible"))
currentField.addVisibilityAnnotationAttrVis(attribute);
@@ -282,19 +359,38 @@ public class ClassFile {
} else if (sig.equals("Ljava/lang/String;")) {
cp = new StringCP((String)value);
}
+ // ******************************************
+ // *** README: Do not add the following code:
+ // ******************************************
+ //
+ // else if ((sig.equals("Ljava/lang/Object;") && value instanceof String)) {
+ // cp = new StringCP((String)value);
+ // }
+ //
+ // See commit 1def25a42bf162766f7fe2ff8824643f79e43289
+ // "No initial value for fields with type other than a primitive type or java.lang.String"
+ //
+
// add the field
- if (synth == null){
- currentField =
- new Var(access, new AsciiCP(name),
- new AsciiCP(sig), new ConstAttr(cp));
- }
+ if (synth == null) {
+ currentField = new Var(
+ access,
+ new AsciiCP(name),
+ new AsciiCP(sig),
+ cp == null ? null : new ConstAttr(cp));
+ }
else {
- currentField =
- new Var(access, new AsciiCP(name),
- new AsciiCP(sig), new ConstAttr(cp), new SyntheticAttr());
+ currentField = new Var(
+ access,
+ new AsciiCP(name),
+ new AsciiCP(sig),
+ cp == null ? null : new ConstAttr(cp),
+ new SyntheticAttr());
+ class_env.requireJava6();
}
if(dep_attr != null){
+ class_env.requireJava5();
currentField.addDeprecatedAttr(new DeprecatedAttr());
}
if(sig_attr != null){
@@ -359,27 +455,34 @@ public class ClassFile {
else {
currentMethod = new Method(method_access, new AsciiCP(method_name),
new AsciiCP(method_signature), code, except_attr, new SyntheticAttr());
+ class_env.requireJava6();
}
if (methDepr){
+ class_env.requireJava5();
currentMethod.addDeprecatedAttr(new DeprecatedAttr());
}
if (methSigAttr != null){
currentMethod.addSignatureAttr(new SignatureAttr(methSigAttr));
}
if (methAnnotAttrVis != null){
+ class_env.requireJava5();
currentMethod.addVisAnnotationAttr(methAnnotAttrVis);
}
if (methAnnotAttrInvis != null){
+ class_env.requireJava5();
currentMethod.addInvisAnnotationAttr(methAnnotAttrInvis);
}
if (methParamAnnotAttrVis != null){
+ class_env.requireJava5();
currentMethod.addVisParamAnnotationAttr(methParamAnnotAttrVis);
}
if (methParamAnnotAttrInvis != null){
+ class_env.requireJava5();
currentMethod.addInvisParamAnnotationAttr(methParamAnnotAttrInvis);
}
if (methAnnotDef != null){
+ class_env.requireJava5();
methAnnotDef.setNoName();
currentMethod.addAnnotationDef(new AnnotationDefaultAttr(methAnnotDef));
}
@@ -653,6 +756,7 @@ public class ClassFile {
for (int i = 0; i < bsmArgsList.length; i++) {
String sig = bsmArgsList[i].substring(1,bsmArgsList[i].indexOf(")"));
String val = bsmArgsList[i].substring(bsmArgsList[i].indexOf(")")+1);
+ val = unescape(val);
CP cp = null;
if (sig.equals("I")||sig.equals("Z")||sig.equals("C")||sig.equals("B")||sig.equals("S")) {
cp = new IntegerCP(Integer.parseInt(val));
@@ -689,7 +793,12 @@ public class ClassFile {
}
- //
+ //see soot.baf.JasminClass.emitInst(...).new InstSwitch() {...}.escape(String)
+ private String unescape(String val) {
+ return val.replace("\\comma",",").replace("\\blank"," ").replace("\\tab","\t").replace("\\newline","\n");
+ }
+
+ //
// Lookupswitch instruction
//
void newLookupswitch() throws jasError {
@@ -951,6 +1060,9 @@ public class ClassFile {
void addMethSigAttr(String s){
methSigAttr = s;
+ if (s.contains("<")) {
+ class_env.requireJava5();
+ }
}
void addEnclMethAttr(String cls, String meth, String sig){
@@ -1138,8 +1250,7 @@ public class ClassFile {
// initialize variables for error reporting
errors = 0;
filename = name;
- source_name = name;
-
+
// if numberLines is true, we output LineTableAttr's that indicate what line
// numbers the Jasmin code falls on.
auto_number = numberLines;
=====================================
src/jasmin/ReservedInstructions.java
=====================================
@@ -0,0 +1,243 @@
+/* --- Copyright Alexandre Bartel 2015. All rights reserved. -----------------
+ */
+
+package jasmin;
+
+import java.util.Hashtable;
+
+import java_cup.runtime.Symbol;
+
+abstract class ReservedInstructions {
+ static Hashtable reserved_instructions;
+
+ // we can't pull this hashtable trick anymore, no more recycling allowed!
+ public static Symbol get(String name) {
+ Symbol template = (Symbol) reserved_instructions.get(name);
+ if (template != null)
+ return new Symbol(template.sym);
+ else
+ return null;
+ }
+
+ public static boolean contains(String name) {
+ return reserved_instructions.get(name) != null;
+ }
+
+ //
+ // scanner initializer - sets up reserved_instructions table
+ //
+ static {
+ reserved_instructions = new Hashtable();
+
+ // Jasmin directives
+ reserved_instructions.put("aaload", new Symbol(sym.i_aaload));
+ reserved_instructions.put("aastore", new Symbol(sym.i_aastore));
+ reserved_instructions.put("aconst_null", new Symbol(sym.i_aconst_null));
+ reserved_instructions.put("aload", new Symbol(sym.i_aload));
+ reserved_instructions.put("aload_0", new Symbol(sym.i_aload_0));
+ reserved_instructions.put("aload_1", new Symbol(sym.i_aload_1));
+ reserved_instructions.put("aload_2", new Symbol(sym.i_aload_2));
+ reserved_instructions.put("aload_3", new Symbol(sym.i_aload_3));
+ reserved_instructions.put("anewarray", new Symbol(sym.i_anewarray));
+ reserved_instructions.put("areturn", new Symbol(sym.i_areturn));
+ reserved_instructions.put("arraylength", new Symbol(sym.i_arraylength));
+ reserved_instructions.put("astore", new Symbol(sym.i_astore));
+ reserved_instructions.put("astore_0", new Symbol(sym.i_astore_0));
+ reserved_instructions.put("astore_1", new Symbol(sym.i_astore_1));
+ reserved_instructions.put("astore_2", new Symbol(sym.i_astore_2));
+ reserved_instructions.put("astore_3", new Symbol(sym.i_astore_3));
+ reserved_instructions.put("athrow", new Symbol(sym.i_athrow));
+ reserved_instructions.put("baload", new Symbol(sym.i_baload));
+ reserved_instructions.put("bastore", new Symbol(sym.i_bastore));
+ reserved_instructions.put("bipush", new Symbol(sym.i_bipush));
+ reserved_instructions.put("breakpoint", new Symbol(sym.i_breakpoint));
+ reserved_instructions.put("caload", new Symbol(sym.i_caload));
+ reserved_instructions.put("castore", new Symbol(sym.i_castore));
+ reserved_instructions.put("checkcast", new Symbol(sym.i_checkcast));
+ reserved_instructions.put("d2f", new Symbol(sym.i_d2f));
+ reserved_instructions.put("d2i", new Symbol(sym.i_d2i));
+ reserved_instructions.put("d2l", new Symbol(sym.i_d2l));
+ reserved_instructions.put("dadd", new Symbol(sym.i_dadd));
+ reserved_instructions.put("daload", new Symbol(sym.i_daload));
+ reserved_instructions.put("dastore", new Symbol(sym.i_dastore));
+ reserved_instructions.put("dcmpg", new Symbol(sym.i_dcmpg));
+ reserved_instructions.put("dcmpl", new Symbol(sym.i_dcmpl));
+ reserved_instructions.put("dconst_0", new Symbol(sym.i_dconst_0));
+ reserved_instructions.put("dconst_1", new Symbol(sym.i_dconst_1));
+ reserved_instructions.put("ddiv", new Symbol(sym.i_ddiv));
+ reserved_instructions.put("dload", new Symbol(sym.i_dload));
+ reserved_instructions.put("dload_0", new Symbol(sym.i_dload_0));
+ reserved_instructions.put("dload_1", new Symbol(sym.i_dload_1));
+ reserved_instructions.put("dload_2", new Symbol(sym.i_dload_2));
+ reserved_instructions.put("dload_3", new Symbol(sym.i_dload_3));
+ reserved_instructions.put("dmul", new Symbol(sym.i_dmul));
+ reserved_instructions.put("dneg", new Symbol(sym.i_dneg));
+ reserved_instructions.put("drem", new Symbol(sym.i_drem));
+ reserved_instructions.put("dreturn", new Symbol(sym.i_dreturn));
+ reserved_instructions.put("dstore", new Symbol(sym.i_dstore));
+ reserved_instructions.put("dstore_0", new Symbol(sym.i_dstore_0));
+ reserved_instructions.put("dstore_1", new Symbol(sym.i_dstore_1));
+ reserved_instructions.put("dstore_2", new Symbol(sym.i_dstore_2));
+ reserved_instructions.put("dstore_3", new Symbol(sym.i_dstore_3));
+ reserved_instructions.put("dsub", new Symbol(sym.i_dsub));
+ reserved_instructions.put("dup", new Symbol(sym.i_dup));
+ reserved_instructions.put("dup2", new Symbol(sym.i_dup2));
+ reserved_instructions.put("dup2_x1", new Symbol(sym.i_dup2_x1));
+ reserved_instructions.put("dup2_x2", new Symbol(sym.i_dup2_x2));
+ reserved_instructions.put("dup_x1", new Symbol(sym.i_dup_x1));
+ reserved_instructions.put("dup_x2", new Symbol(sym.i_dup_x2));
+ reserved_instructions.put("f2d", new Symbol(sym.i_f2d));
+ reserved_instructions.put("f2i", new Symbol(sym.i_f2i));
+ reserved_instructions.put("f2l", new Symbol(sym.i_f2l));
+ reserved_instructions.put("fadd", new Symbol(sym.i_fadd));
+ reserved_instructions.put("faload", new Symbol(sym.i_faload));
+ reserved_instructions.put("fastore", new Symbol(sym.i_fastore));
+ reserved_instructions.put("fcmpg", new Symbol(sym.i_fcmpg));
+ reserved_instructions.put("fcmpl", new Symbol(sym.i_fcmpl));
+ reserved_instructions.put("fconst_0", new Symbol(sym.i_fconst_0));
+ reserved_instructions.put("fconst_1", new Symbol(sym.i_fconst_1));
+ reserved_instructions.put("fconst_2", new Symbol(sym.i_fconst_2));
+ reserved_instructions.put("fdiv", new Symbol(sym.i_fdiv));
+ reserved_instructions.put("fload", new Symbol(sym.i_fload));
+ reserved_instructions.put("fload_0", new Symbol(sym.i_fload_0));
+ reserved_instructions.put("fload_1", new Symbol(sym.i_fload_1));
+ reserved_instructions.put("fload_2", new Symbol(sym.i_fload_2));
+ reserved_instructions.put("fload_3", new Symbol(sym.i_fload_3));
+ reserved_instructions.put("fmul", new Symbol(sym.i_fmul));
+ reserved_instructions.put("fneg", new Symbol(sym.i_fneg));
+ reserved_instructions.put("frem", new Symbol(sym.i_frem));
+ reserved_instructions.put("freturn", new Symbol(sym.i_freturn));
+ reserved_instructions.put("fstore", new Symbol(sym.i_fstore));
+ reserved_instructions.put("fstore_0", new Symbol(sym.i_fstore_0));
+ reserved_instructions.put("fstore_1", new Symbol(sym.i_fstore_1));
+ reserved_instructions.put("fstore_2", new Symbol(sym.i_fstore_2));
+ reserved_instructions.put("fstore_3", new Symbol(sym.i_fstore_3));
+ reserved_instructions.put("fsub", new Symbol(sym.i_fsub));
+ reserved_instructions.put("getfield", new Symbol(sym.i_getfield));
+ reserved_instructions.put("getstatic", new Symbol(sym.i_getstatic));
+ reserved_instructions.put("goto", new Symbol(sym.i_goto));
+ reserved_instructions.put("goto_w", new Symbol(sym.i_goto_w));
+ reserved_instructions.put("i2d", new Symbol(sym.i_i2d));
+ reserved_instructions.put("i2f", new Symbol(sym.i_i2f));
+ reserved_instructions.put("i2l", new Symbol(sym.i_i2l));
+ reserved_instructions.put("iadd", new Symbol(sym.i_iadd));
+ reserved_instructions.put("iaload", new Symbol(sym.i_iaload));
+ reserved_instructions.put("iand", new Symbol(sym.i_iand));
+ reserved_instructions.put("iastore", new Symbol(sym.i_iastore));
+ reserved_instructions.put("iconst_0", new Symbol(sym.i_iconst_0));
+ reserved_instructions.put("iconst_1", new Symbol(sym.i_iconst_1));
+ reserved_instructions.put("iconst_2", new Symbol(sym.i_iconst_2));
+ reserved_instructions.put("iconst_3", new Symbol(sym.i_iconst_3));
+ reserved_instructions.put("iconst_4", new Symbol(sym.i_iconst_4));
+ reserved_instructions.put("iconst_5", new Symbol(sym.i_iconst_5));
+ reserved_instructions.put("iconst_m1", new Symbol(sym.i_iconst_m1));
+ reserved_instructions.put("idiv", new Symbol(sym.i_idiv));
+ reserved_instructions.put("if_acmpeq", new Symbol(sym.i_if_acmpeq));
+ reserved_instructions.put("if_acmpne", new Symbol(sym.i_if_acmpne));
+ reserved_instructions.put("if_icmpeq", new Symbol(sym.i_if_icmpeq));
+ reserved_instructions.put("if_icmpge", new Symbol(sym.i_if_icmpge));
+ reserved_instructions.put("if_icmpgt", new Symbol(sym.i_if_icmpgt));
+ reserved_instructions.put("if_icmple", new Symbol(sym.i_if_icmple));
+ reserved_instructions.put("if_icmplt", new Symbol(sym.i_if_icmplt));
+ reserved_instructions.put("if_icmpne", new Symbol(sym.i_if_icmpne));
+ reserved_instructions.put("ifeq", new Symbol(sym.i_ifeq));
+ reserved_instructions.put("ifge", new Symbol(sym.i_ifge));
+ reserved_instructions.put("ifgt", new Symbol(sym.i_ifgt));
+ reserved_instructions.put("ifle", new Symbol(sym.i_ifle));
+ reserved_instructions.put("iflt", new Symbol(sym.i_iflt));
+ reserved_instructions.put("ifne", new Symbol(sym.i_ifne));
+ reserved_instructions.put("ifnonnull", new Symbol(sym.i_ifnonnull));
+ reserved_instructions.put("ifnull", new Symbol(sym.i_ifnull));
+ reserved_instructions.put("iinc", new Symbol(sym.i_iinc));
+ reserved_instructions.put("iload", new Symbol(sym.i_iload));
+ reserved_instructions.put("iload_0", new Symbol(sym.i_iload_0));
+ reserved_instructions.put("iload_1", new Symbol(sym.i_iload_1));
+ reserved_instructions.put("iload_2", new Symbol(sym.i_iload_2));
+ reserved_instructions.put("iload_3", new Symbol(sym.i_iload_3));
+ reserved_instructions.put("imul", new Symbol(sym.i_imul));
+ reserved_instructions.put("ineg", new Symbol(sym.i_ineg));
+ reserved_instructions.put("instanceof", new Symbol(sym.i_instanceof));
+ reserved_instructions.put("int2byte", new Symbol(sym.i_int2byte));
+ reserved_instructions.put("int2char", new Symbol(sym.i_int2char));
+ reserved_instructions.put("int2short", new Symbol(sym.i_int2short));
+ reserved_instructions.put("i2b", new Symbol(sym.i_i2b));
+ reserved_instructions.put("i2c", new Symbol(sym.i_i2c));
+ reserved_instructions.put("i2s", new Symbol(sym.i_i2s));
+ reserved_instructions.put("invokeinterface", new Symbol(sym.i_invokeinterface));
+ reserved_instructions.put("invokenonvirtual", new Symbol(sym.i_invokenonvirtual));
+ reserved_instructions.put("invokespecial", new Symbol(sym.i_invokespecial));
+ reserved_instructions.put("invokestatic", new Symbol(sym.i_invokestatic));
+ reserved_instructions.put("invokevirtual", new Symbol(sym.i_invokevirtual));
+ reserved_instructions.put("invokedynamic", new Symbol(sym.i_invokedynamic));
+ reserved_instructions.put("ior", new Symbol(sym.i_ior));
+ reserved_instructions.put("irem", new Symbol(sym.i_irem));
+ reserved_instructions.put("ireturn", new Symbol(sym.i_ireturn));
+ reserved_instructions.put("ishl", new Symbol(sym.i_ishl));
+ reserved_instructions.put("ishr", new Symbol(sym.i_ishr));
+ reserved_instructions.put("istore", new Symbol(sym.i_istore));
+ reserved_instructions.put("istore_0", new Symbol(sym.i_istore_0));
+ reserved_instructions.put("istore_1", new Symbol(sym.i_istore_1));
+ reserved_instructions.put("istore_2", new Symbol(sym.i_istore_2));
+ reserved_instructions.put("istore_3", new Symbol(sym.i_istore_3));
+ reserved_instructions.put("isub", new Symbol(sym.i_isub));
+ reserved_instructions.put("iushr", new Symbol(sym.i_iushr));
+ reserved_instructions.put("ixor", new Symbol(sym.i_ixor));
+ reserved_instructions.put("jsr", new Symbol(sym.i_jsr));
+ reserved_instructions.put("jsr_w", new Symbol(sym.i_jsr_w));
+ reserved_instructions.put("l2d", new Symbol(sym.i_l2d));
+ reserved_instructions.put("l2f", new Symbol(sym.i_l2f));
+ reserved_instructions.put("l2i", new Symbol(sym.i_l2i));
+ reserved_instructions.put("ladd", new Symbol(sym.i_ladd));
+ reserved_instructions.put("laload", new Symbol(sym.i_laload));
+ reserved_instructions.put("land", new Symbol(sym.i_land));
+ reserved_instructions.put("lastore", new Symbol(sym.i_lastore));
+ reserved_instructions.put("lcmp", new Symbol(sym.i_lcmp));
+ reserved_instructions.put("lconst_0", new Symbol(sym.i_lconst_0));
+ reserved_instructions.put("lconst_1", new Symbol(sym.i_lconst_1));
+ reserved_instructions.put("ldc", new Symbol(sym.i_ldc));
+ reserved_instructions.put("ldc_w", new Symbol(sym.i_ldc_w));
+ reserved_instructions.put("ldc2_w", new Symbol(sym.i_ldc2_w));
+ reserved_instructions.put("ldiv", new Symbol(sym.i_ldiv));
+ reserved_instructions.put("lload", new Symbol(sym.i_lload));
+ reserved_instructions.put("lload_0", new Symbol(sym.i_lload_0));
+ reserved_instructions.put("lload_1", new Symbol(sym.i_lload_1));
+ reserved_instructions.put("lload_2", new Symbol(sym.i_lload_2));
+ reserved_instructions.put("lload_3", new Symbol(sym.i_lload_3));
+ reserved_instructions.put("lmul", new Symbol(sym.i_lmul));
+ reserved_instructions.put("lneg", new Symbol(sym.i_lneg));
+ reserved_instructions.put("lookupswitch", new Symbol(sym.i_lookupswitch));
+ reserved_instructions.put("lor", new Symbol(sym.i_lor));
+ reserved_instructions.put("lrem", new Symbol(sym.i_lrem));
+ reserved_instructions.put("lreturn", new Symbol(sym.i_lreturn));
+ reserved_instructions.put("lshl", new Symbol(sym.i_lshl));
+ reserved_instructions.put("lshr", new Symbol(sym.i_lshr));
+ reserved_instructions.put("lstore", new Symbol(sym.i_lstore));
+ reserved_instructions.put("lstore_0", new Symbol(sym.i_lstore_0));
+ reserved_instructions.put("lstore_1", new Symbol(sym.i_lstore_1));
+ reserved_instructions.put("lstore_2", new Symbol(sym.i_lstore_2));
+ reserved_instructions.put("lstore_3", new Symbol(sym.i_lstore_3));
+ reserved_instructions.put("lsub", new Symbol(sym.i_lsub));
+ reserved_instructions.put("lushr", new Symbol(sym.i_lushr));
+ reserved_instructions.put("lxor", new Symbol(sym.i_lxor));
+ reserved_instructions.put("monitorenter", new Symbol(sym.i_monitorenter));
+ reserved_instructions.put("monitorexit", new Symbol(sym.i_monitorexit));
+ reserved_instructions.put("multianewarray", new Symbol(sym.i_multianewarray));
+ reserved_instructions.put("new", new Symbol(sym.i_new));
+ reserved_instructions.put("newarray", new Symbol(sym.i_newarray));
+ reserved_instructions.put("nop", new Symbol(sym.i_nop));
+ reserved_instructions.put("pop", new Symbol(sym.i_pop));
+ reserved_instructions.put("pop2", new Symbol(sym.i_pop2));
+ reserved_instructions.put("putfield", new Symbol(sym.i_putfield));
+ reserved_instructions.put("putstatic", new Symbol(sym.i_putstatic));
+ reserved_instructions.put("ret", new Symbol(sym.i_ret));
+ reserved_instructions.put("ret_w", new Symbol(sym.i_ret_w));
+ reserved_instructions.put("return", new Symbol(sym.i_return));
+ reserved_instructions.put("saload", new Symbol(sym.i_saload));
+ reserved_instructions.put("sastore", new Symbol(sym.i_sastore));
+ reserved_instructions.put("sipush", new Symbol(sym.i_sipush));
+ reserved_instructions.put("swap", new Symbol(sym.i_swap));
+ reserved_instructions.put("tableswitch", new Symbol(sym.i_tableswitch));
+ reserved_instructions.put("wide", new Symbol(sym.i_wide));
+
+ }
+}
=====================================
src/jasmin/ReservedWords.java
=====================================
@@ -7,7 +7,8 @@
package jasmin;
import java.util.Hashtable;
-import java_cup.runtime.*;
+
+import java_cup.runtime.Symbol;
abstract class ReservedWords {
static Hashtable reserved_words;
@@ -87,10 +88,10 @@ abstract class ReservedWords {
// reserved_words used in Jasmin directives
+ reserved_words.put("is", new Symbol(sym.IS));
reserved_words.put("from", new Symbol(sym.FROM));
reserved_words.put("method", new Symbol(sym.METHOD));
reserved_words.put("to", new Symbol(sym.TO));
- reserved_words.put("is", new Symbol(sym.IS));
reserved_words.put("using", new Symbol(sym.USING));
// Special-case instructions
=====================================
src/jasmin/Scanner.java
=====================================
@@ -5,7 +5,7 @@
Changes:
- Added \\ to the list of possible escape characters for Strings.
- March 15, 1999: $ does no longer significant substitution
-*/
+ */
/* --- Copyright Jonathan Meyer 1996. All rights reserved. -----------------
> File: jasmin/src/jasmin/Scanner.java
@@ -15,406 +15,421 @@
/* Scanner.java - class for tokenizing Jasmin files. This is rather
* cheap and cheerful.
-*/
+ */
package jasmin;
-import jas.*;
-import java_cup.runtime.*;
-import java.util.*;
+import jas.jasError;
+
import java.io.InputStream;
import java.io.InputStreamReader;
+import java.util.Hashtable;
+
+import java_cup.runtime.Symbol;
class Scanner implements java_cup.runtime.Scanner {
- InputStreamReader inp;
-
- // single lookahead character
- int next_char;
-
- // temporary buffer
- char chars[];
- char secondChars[];
- char[] unicodeBuffer;
-
- // true if we have not yet emitted a SEP ('\n') token. This is a bit
- // of a hack so to strip out multiple newlines at the start of the file
- // and replace them with a single SEP token. (for some reason I can't
- // write the CUP grammar to accept multiple newlines at the start of the
- // file)
- boolean is_first_sep;
-
- // Whitespace characters
- static final String WHITESPACE = " \n\t\r";
-
- // Separator characters
- static final String SEPARATORS = WHITESPACE + ":=";
-
-
- // used for error reporting to print out where an error is on the line
- public int line_num, char_num, token_line_num;
- public StringBuffer line;
-
- // used by the .set directive to define new variables.
- public Hashtable dict = new Hashtable();
-
- //
- // returns true if a character code is a whitespace character
- //
- protected static boolean whitespace(int c) {
- return (WHITESPACE.indexOf(c) != -1);
- }
-
- //
- // returns true if a character code is a separator character
- //
- protected static boolean separator(int c) {
- return (SEPARATORS.indexOf(c) != -1);
- }
-
-
- //
- // Advanced the input by one character
- //
- protected void advance() throws java.io.IOException
- {
- next_char = inp.read();
- if (next_char == '\n') {
- // a new line
- line_num++;
- char_num = 0;
- line.setLength(0);
- } else {
- line.append((char)next_char);
- char_num++;
- }
- }
-
- //
- // initialize the scanner
- //
- final static int BIGNUM=65000;
- public Scanner(InputStream i) throws java.io.IOException
- {
- inp = new InputStreamReader(i);
- line_num = 1;
- char_num = 0;
- line = new StringBuffer();
- chars = new char[BIGNUM];
- secondChars = new char[BIGNUM];
- unicodeBuffer = new char[4];
- is_first_sep = true;
- advance();
- }
-
- int readOctal(int firstChar) throws java.io.IOException {
- int d1, d2, d3;
- d1 = firstChar;
- advance();
- d2 = next_char;
- advance();
- d3 = next_char;
- return ((d1-'0')&7) * 64 + ((d2-'0')&7) * 8 + ((d3-'0')&7);
- }
-
- //
- // recognize and return the next complete symbol
- //
- public Symbol next_token()
- throws java.io.IOException, jasError
- {
-
- token_line_num = line_num;
-
- for (;;) {
- switch (next_char) {
-
- case ';':
- // a comment
- do { advance(); } while (next_char != '\n');
-
- case '\n':
- // return single SEP token (skip multiple newlines
- // interspersed with whitespace or comments)
- for (;;) {
- do { advance(); } while (whitespace(next_char));
- if (next_char == ';') {
- do { advance(); } while (next_char != '\n');
- } else {
- break;
- }
- }
- if (is_first_sep) {
- return next_token();
- }
- token_line_num = line_num;
- return new Symbol(sym.SEP);
-
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- case '-': case '+':
- case '.': // a number
- {
- int pos = 0;
-
- // record that we have found first item
- is_first_sep = false;
-
- chars[0] = (char)next_char;
- pos++;
- for (;;) {
- advance();
- if (separator(next_char)) {
- break;
- }
- try {
- chars[pos] = (char)next_char;
- } catch (ArrayIndexOutOfBoundsException abe) {
- char[] tmparray = new char[chars.length*2];
- System.arraycopy(chars, 0,
- tmparray, 0,
- chars.length);
- chars = tmparray;
- chars[pos] = (char)next_char;
+ InputStreamReader inp;
+
+ // single lookahead character
+ int next_char;
+
+ // temporary buffer
+ char chars[];
+ char secondChars[];
+ char[] unicodeBuffer;
+
+ // true if we have not yet emitted a SEP ('\n') token. This is a bit
+ // of a hack so to strip out multiple newlines at the start of the file
+ // and replace them with a single SEP token. (for some reason I can't
+ // write the CUP grammar to accept multiple newlines at the start of the
+ // file)
+ boolean is_first_sep;
+
+ // Whitespace characters
+ static final String WHITESPACE = " \n\t\r";
+
+ // Separator characters
+ static final String SEPARATORS = WHITESPACE + ":=";
+
+ // used for error reporting to print out where an error is on the line
+ public int line_num, char_num, token_line_num;
+ public StringBuffer line;
+
+ // used by the .set directive to define new variables.
+ public Hashtable<String, Object> dict = new Hashtable<String, Object>();
+
+ //
+ // returns true if a character code is a whitespace character
+ //
+ protected static boolean whitespace(int c) {
+ return (WHITESPACE.indexOf(c) != -1);
+ }
+
+ //
+ // returns true if a character code is a separator character
+ //
+ protected static boolean separator(int c) {
+ return (SEPARATORS.indexOf(c) != -1);
+ }
+
+ //
+ // Advanced the input by one character
+ //
+ protected void advance() throws java.io.IOException {
+ next_char = inp.read();
+ if (next_char == '\n') {
+ // a new line
+ line_num++;
+ char_num = 0;
+ line.setLength(0);
+ } else {
+ line.append((char) next_char);
+ char_num++;
+ }
+ }
+
+ //
+ // initialize the scanner
+ //
+ final static int BIGNUM = 65000;
+
+ public Scanner(InputStream i) throws java.io.IOException {
+ inp = new InputStreamReader(i);
+ line_num = 1;
+ char_num = 0;
+ line = new StringBuffer();
+ chars = new char[BIGNUM];
+ secondChars = new char[BIGNUM];
+ unicodeBuffer = new char[4];
+ is_first_sep = true;
+ advance();
+ }
+
+ int readOctal(int firstChar) throws java.io.IOException {
+ int d1, d2, d3;
+ d1 = firstChar;
+ advance();
+ d2 = next_char;
+ advance();
+ d3 = next_char;
+ return ((d1 - '0') & 7) * 64 + ((d2 - '0') & 7) * 8 + ((d3 - '0') & 7);
+ }
+
+ //
+ // recognize and return the next complete symbol
+ //
+ public Symbol next_token() throws java.io.IOException, jasError {
+ token_line_num = line_num;
+
+ for (;;) {
+ switch (next_char) {
+
+ case ';':
+ // a comment
+ do {
+ advance();
+ } while (next_char != '\n');
+
+ case '\n':
+ // return single SEP token (skip multiple newlines
+ // interspersed with whitespace or comments)
+ for (;;) {
+ do {
+ advance();
+ } while (whitespace(next_char));
+ if (next_char == ';') {
+ do {
+ advance();
+ } while (next_char != '\n');
+ } else {
+ break;
+ }
+ }
+ if (is_first_sep) {
+ return next_token();
+ }
+ token_line_num = line_num;
+ return new Symbol(sym.SEP);
+
+ case '"': // quoted strings
+ {
+ int pos = 0;
+
+ is_first_sep = false;
+
+ for (;;) {
+ advance();
+ if (next_char == '\\') {
+ advance();
+ switch (next_char) {
+ case 'n':
+ next_char = '\n';
+ break;
+ case 'r':
+ next_char = '\r';
+ break;
+ case 't':
+ next_char = '\t';
+ break;
+ case 'f':
+ next_char = '\f';
+ break;
+ case 'b':
+ next_char = '\b';
+ break;
+ case 'u': {
+ advance();
+ unicodeBuffer[0] = (char) next_char;
+ advance();
+ unicodeBuffer[1] = (char) next_char;
+ advance();
+ unicodeBuffer[2] = (char) next_char;
+ advance();
+ unicodeBuffer[3] = (char) next_char;
+
+ // System.out.println(unicodeBuffer[0] + ":" +
+ // unicodeBuffer[1] + ":" + unicodeBuffer[2] + ":" +
+ // unicodeBuffer[3] + ":");
+
+ next_char = (char) Integer.parseInt(new String(unicodeBuffer, 0, 4), 16);
+ // System.out.println("value: " + next_char);
+ break;
+ }
+ case '"':
+ next_char = '"';
+ break;
+ case '\'':
+ next_char = '\'';
+ break;
+ case '\\':
+ next_char = '\\';
+ break;
+
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ next_char = readOctal(next_char);
+ break;
+ default:
+ throw new jasError("Bad backslash escape sequence");
+ }
+ } else if (next_char == '"' || next_char < 0) {
+ break;
+ }
+
+ try {
+ if (chars.length == pos) {
+ char[] newChars = new char[chars.length * 2];
+ System.arraycopy(chars, 0, newChars, 0, chars.length);
+ chars = newChars;
+ }
+ chars[pos] = (char) next_char;
+ } catch (ArrayIndexOutOfBoundsException abe) {
+ char[] tmparray = new char[chars.length * 2];
+ System.arraycopy(chars, 0, tmparray, 0, chars.length);
+ chars = tmparray;
+ chars[pos] = (char) next_char;
+ }
+ pos++;
+ }
+ advance(); // skip close quote
+ return new Symbol(sym.Str, new String(chars, 0, pos));
}
- pos++;
- }
- String str = new String(chars, 0, pos);
- Symbol tok;
-
- if(str.equals("+DoubleInfinity"))
- return new Symbol(sym.Num, new Double(1.0/0.0));
-
- if(str.equals("+DoubleNaN"))
- return new Symbol(sym.Num, new Double(0.0d/0.0));
-
- if(str.equals("+FloatNaN"))
- return new Symbol(sym.Num, new Float(0.0f/0.0));
-
- if(str.equals("-DoubleInfinity"))
- return new Symbol(sym.Num, new Double(-1.0/0.0));
-
- if(str.equals("+FloatInfinity"))
- return new Symbol(sym.Num, new Float(1.0f/0.0f));
-
- if(str.equals("-FloatInfinity"))
- return new Symbol(sym.Num, new Float(-1.0f/0.0f));
-
-
-
- // This catches directives like ".method"
- if ((tok = ReservedWords.get(str)) != null) {
- return tok;
- }
-
- Number num;
- try {
- num = ScannerUtils.convertNumber(str);
- } catch (NumberFormatException e) {
- if (chars[0] == '.') {
- throw new jasError("Unknown directive or badly formed number.");
- } else {
- throw new jasError("Badly formatted number");
- }
- }
-
- if (num instanceof Integer) {
- return new Symbol(sym.Int, new Integer(num.intValue()));
- } else {
- return new Symbol(sym.Num, num);
- }
- }
-
- case '"': // quoted strings
- {
- int pos = 0;
-
- is_first_sep = false;
-
- for (;;) {
- advance();
- if (next_char == '\\') {
- advance();
- switch (next_char) {
- case 'n': next_char = '\n'; break;
- case 'r': next_char = '\r'; break;
- case 't': next_char = '\t'; break;
- case 'f': next_char = '\f'; break;
- case 'b': next_char = '\b'; break;
- case 'u':
- {
- advance();
- unicodeBuffer[0] = (char) next_char;
- advance();
- unicodeBuffer[1] = (char) next_char;
- advance();
- unicodeBuffer[2] = (char) next_char;
- advance();
- unicodeBuffer[3] = (char) next_char;
-
- // System.out.println(unicodeBuffer[0] + ":" + unicodeBuffer[1] + ":" + unicodeBuffer[2] + ":" + unicodeBuffer[3] + ":");
-
- next_char = (char) Integer.parseInt(new String(unicodeBuffer, 0, 4), 16);
- // System.out.println("value: " + next_char);
- break;
- }
- case '"': next_char = '"'; break;
- case '\'': next_char = '\''; break;
- case '\\': next_char = '\\'; break;
-
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7':
- next_char = readOctal(next_char);
+
+ case ' ':
+ case '\t':
+ case '\r': // whitespace
+ advance();
break;
- default:
- throw new jasError("Bad backslash escape sequence");
- }
- } else if (next_char == '"') {
- break;
- }
-
+
+ case '=': // EQUALS token
+ advance();
+ is_first_sep = false;
+ return new Symbol(sym.EQ);
+
+ case ':': // COLON token
+ advance();
+ is_first_sep = false;
+ return new Symbol(sym.COLON);
+
+ case -1: // EOF token
+ is_first_sep = false;
+ char_num = -1;
+ line.setLength(0);
+ return new Symbol(sym.EOF);
+
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '-':
+ case '+':
+ case '.': // a number
+ default: {
+ // read up until a separatorcharacter
+ int pos = 0;
+ chars[0] = (char) next_char;
+ is_first_sep = false;
+
+ pos++;
+ for (;;) {
+ advance();
+ if (separator(next_char)) {
+ break;
+ }
+ try {
+ chars[pos] = (char) next_char;
+ } catch (ArrayIndexOutOfBoundsException abe) {
+ char[] tmparray = new char[chars.length * 2];
+ System.arraycopy(chars, 0, tmparray, 0, chars.length);
+ chars = tmparray;
+ chars[pos] = (char) next_char;
+ }
+ pos++;
+ }
+
+ // convert the byte array into a String
+ int secondPos = translateUnicodeCharacters(pos);
+ String str = new String(secondChars, 0, secondPos);
+
+ // Is this a number?
+ Symbol tok;
+ if ((tok = tryParseAsNumber(str)) != null) {
+ return tok;
+ }
+
+ if ((tok = ReservedWords.get(str)) != null || (tok = ReservedInstructions.get(str)) != null) {
+ // Jasmin keyword or directive
+ // or Jasmin instruction
+
+ return tok;
+ } else {
+ // Unrecognized string token (e.g. a classname)
+ return new Symbol(sym.Word, str);
+ }
+
+ } /* default */
+ } /* switch */
+ } /* for */
+ }
+
+ private Symbol tryParseAsNumber(String str) throws jasError {
+ if (str.isEmpty())
+ return null;
+
+ // Check for special numbers
+ if (str.equals("+DoubleInfinity"))
+ return new Symbol(sym.Num, new Double(1.0 / 0.0));
+ if (str.equals("+DoubleNaN"))
+ return new Symbol(sym.Num, new Double(0.0d / 0.0));
+ if (str.equals("+FloatNaN"))
+ return new Symbol(sym.Num, new Float(0.0f / 0.0));
+ if (str.equals("-DoubleInfinity"))
+ return new Symbol(sym.Num, new Double(-1.0 / 0.0));
+ if (str.equals("+FloatInfinity"))
+ return new Symbol(sym.Num, new Float(1.0f / 0.0f));
+ if (str.equals("-FloatInfinity"))
+ return new Symbol(sym.Num, new Float(-1.0f / 0.0f));
+
+ // This catches directives like ".method"
+ Symbol tok;
+ if ((tok = ReservedWords.get(str)) != null) {
+ return tok;
+ }
+
+ // Is this a method signature?
+ int idxOpen = str.indexOf("(");
+ int idxClose = str.indexOf(")");
+ if (idxOpen > 0 && idxClose > idxOpen)
+ return null;
+
+ // Parse regular numbers
+ char c = str.charAt(0);
+ if (c == '0'
+ || c == '1'
+ || c == '2'
+ || c == '3'
+ || c == '4'
+ || c == '5'
+ || c == '6'
+ || c == '7'
+ || c == '8'
+ || c == '9'
+ || c == '-'
+ || c == '+'
+ || c == '.') {
+ Number num;
try {
- chars[pos] = (char)next_char;
- } catch (ArrayIndexOutOfBoundsException abe) {
- char[] tmparray = new char[chars.length*2];
- System.arraycopy(chars, 0,
- tmparray, 0,
- chars.length);
- chars = tmparray;
- chars[pos] = (char)next_char;
+ num = ScannerUtils.convertNumber(str);
+ } catch (NumberFormatException e) {
+ if (chars[0] == '.') {
+ throw new jasError("Unknown directive or badly formed number.");
+ } else {
+ throw new jasError("Badly formatted number: " + str);
+ }
}
- pos++;
- }
- advance(); // skip close quote
- return new Symbol(sym.Str, new String(chars, 0, pos));
- }
-
- case ' ':
- case '\t':
- case '\r': // whitespace
- advance();
- break;
-
- case '=': // EQUALS token
- advance();
- is_first_sep = false;
- return new Symbol(sym.EQ);
-
- case ':': // COLON token
- advance();
- is_first_sep = false;
- return new Symbol(sym.COLON);
-
- case -1: // EOF token
- is_first_sep = false;
- char_num = -1;
- line.setLength(0);
- return new Symbol(sym.EOF);
-
- default:
- {
- // read up until a separatorcharacter
-
- int pos = 0;
- int secondPos = 0;
- chars[0] = (char)next_char;
- is_first_sep = false;
-
- pos++;
- for (;;) {
- advance();
- if (separator(next_char)) {
- break;
- }
- try {
- chars[pos] = (char)next_char;
- } catch (ArrayIndexOutOfBoundsException abe) {
- char[] tmparray = new char[chars.length*2];
- System.arraycopy(chars, 0,
- tmparray, 0,
- chars.length);
- chars = tmparray;
- chars[pos] = (char)next_char;
+
+ if (num instanceof Integer) {
+ return new Symbol(sym.Int, new Integer(num.intValue()));
+ } else {
+ return new Symbol(sym.Num, num);
+ }
+ }
+ return null;
+ }
+
+ private int translateUnicodeCharacters(int pos) {
+ // Parse all the unicode escape sequences
+ int secondPos = 0;
+ for (int i = 0; i < pos; i++) {
+ if (chars[i] == '\\' && (i + 5) < pos && chars[i + 1] == 'u') {
+ int intValue = Integer.parseInt(new String(chars, i + 2, 4), 16);
+
+ try {
+ secondChars[secondPos] = (char) intValue;
+ } catch (ArrayIndexOutOfBoundsException abe) {
+ char[] tmparray = new char[secondChars.length * 2];
+ System.arraycopy(secondChars, 0, tmparray, 0, secondChars.length);
+ secondChars = tmparray;
+ secondChars[secondPos] = (char) intValue;
+ }
+ secondPos++;
+
+ i += 5;
+ } else {
+ try {
+ secondChars[secondPos] = chars[i];
+ } catch (ArrayIndexOutOfBoundsException abe) {
+ char[] tmparray = new char[secondChars.length * 2];
+ System.arraycopy(secondChars, 0, tmparray, 0, secondChars.length);
+ secondChars = tmparray;
+ secondChars[secondPos] = chars[i];
+ }
+ secondPos++;
}
- pos++;
- }
-
- secondPos = 0;
-
- // Parse all the unicode escape sequences
- for(int i = 0; i < pos; i++)
- {
- if(chars[i] == '\\' && (i + 5) < pos &&
- chars[i+1] == 'u') {
- int intValue =
- Integer.parseInt(new String(chars, i+2, 4), 16);
-
- try {
- secondChars[secondPos] = (char) intValue;
- } catch (ArrayIndexOutOfBoundsException abe) {
- char[] tmparray =
- new char[secondChars.length*2];
- System.arraycopy(secondChars, 0,
- tmparray, 0,
- secondChars.length);
- secondChars = tmparray;
- secondChars[secondPos] = (char)intValue;
- }
- secondPos++;
-
- i += 5;
- } else {
- try {
- secondChars[secondPos] = chars[i];
- } catch (ArrayIndexOutOfBoundsException abe) {
- char[] tmparray =
- new char[secondChars.length*2];
- System.arraycopy(secondChars, 0,
- tmparray, 0,
- secondChars.length);
- secondChars = tmparray;
- secondChars[secondPos] = chars[i];
- }
- secondPos++;
- }
- }
-
- // convert the byte array into a String
- String str = new String(secondChars, 0, secondPos);
-
- Symbol tok;
- if ((tok = ReservedWords.get(str)) != null) {
- // Jasmin keyword or directive
- return tok;
- } else if (InsnInfo.contains(str)) {
- // its a JVM instruction
- return new Symbol(sym.Insn, str);
- } /*else if (str.charAt(0) == '$') {
- // Perform variable substitution
- Object v;
- if ((v = dict.get(str.substring(1))) != null) {
- return ((Symbol)v);
- }
- } */ else {
- // Unrecognized string token (e.g. a classname)
- return new Symbol(sym.Word, str);
- }
-
- } /* default */
- } /* switch */
- } /* for */
- }
+ }
+ return secondPos;
+ }
};
-/* --- Revision History ---------------------------------------------------
---- Jonathan Meyer, Feb 8 1997
- Converted to be non-static
---- Jonathan Meyer, Oct 30 1996
- Added support for more \ escapes in quoted strings (including octals).
---- Jonathan Meyer, Oct 1 1996
- Added .interface and .implements
---- Jonathan Meyer, July 25 1996
- changed IN to IS. Added token_line_num, which is the line number of the
- last token returned by next_token().
---- Jonathan Meyer, July 24 1996 added mods to recognize '\r' as whitespace.
-*/
+/*
+ * --- Revision History --------------------------------------------------- ---
+ * Jonathan Meyer, Feb 8 1997 Converted to be non-static --- Jonathan Meyer, Oct
+ * 30 1996 Added support for more \ escapes in quoted strings (including
+ * octals). --- Jonathan Meyer, Oct 1 1996 Added .interface and .implements ---
+ * Jonathan Meyer, July 25 1996 changed IN to IS. Added token_line_num, which is
+ * the line number of the last token returned by next_token(). --- Jonathan
+ * Meyer, July 24 1996 added mods to recognize '\r' as whitespace.
+ */
=====================================
src/jasmin/parser.cup
=====================================
@@ -96,15 +96,38 @@ terminal token
LOOKUPSWITCH, TABLESWITCH, DEFAULT,
// special symbols
- EQ, SEP, COLON
+ EQ, SEP, COLON,
+
+ // instructions
+ i_aaload, i_aastore, i_aconst_null, i_aload, i_aload_0, i_aload_1, i_aload_2, i_aload_3, i_anewarray, i_areturn,
+ i_arraylength, i_astore, i_astore_0, i_astore_1, i_astore_2, i_astore_3, i_athrow, i_baload, i_bastore, i_bipush,
+ i_breakpoint, i_caload, i_castore, i_checkcast, i_d2f, i_d2i, i_d2l, i_dadd, i_daload, i_dastore, i_dcmpg, i_dcmpl,
+ i_dconst_0, i_dconst_1, i_ddiv, i_dload, i_dload_0, i_dload_1, i_dload_2, i_dload_3, i_dmul, i_dneg, i_drem, i_dreturn,
+ i_dstore, i_dstore_0, i_dstore_1, i_dstore_2, i_dstore_3, i_dsub, i_dup, i_dup2, i_dup2_x1, i_dup2_x2, i_dup_x1,
+ i_dup_x2, i_f2d, i_f2i, i_f2l, i_fadd, i_faload, i_fastore, i_fcmpg, i_fcmpl, i_fconst_0, i_fconst_1, i_fconst_2,
+ i_fdiv, i_fload, i_fload_0, i_fload_1, i_fload_2, i_fload_3, i_fmul, i_fneg, i_frem, i_freturn, i_fstore, i_fstore_0,
+ i_fstore_1, i_fstore_2, i_fstore_3, i_fsub, i_getfield, i_getstatic, i_goto, i_goto_w, i_i2d, i_i2f, i_i2l, i_iadd,
+ i_iaload, i_iand, i_iastore, i_iconst_0, i_iconst_1, i_iconst_2, i_iconst_3, i_iconst_4, i_iconst_5, i_iconst_m1,
+ i_idiv, i_if_acmpeq, i_if_acmpne, i_if_icmpeq, i_if_icmpge, i_if_icmpgt, i_if_icmple, i_if_icmplt, i_if_icmpne,
+ i_ifeq, i_ifge, i_ifgt, i_ifle, i_iflt, i_ifne, i_ifnonnull, i_ifnull, i_iinc, i_iload, i_iload_0, i_iload_1,
+ i_iload_2, i_iload_3, i_imul, i_ineg, i_instanceof, i_int2byte, i_int2char, i_int2short, i_i2b, i_i2c, i_i2s,
+ i_invokeinterface, i_invokenonvirtual, i_invokespecial, i_invokestatic, i_invokevirtual, i_invokedynamic, i_ior,
+ i_irem, i_ireturn, i_ishl, i_ishr, i_istore, i_istore_0, i_istore_1, i_istore_2, i_istore_3, i_isub, i_iushr, i_ixor,
+ i_jsr, i_jsr_w, i_l2d, i_l2f, i_l2i, i_ladd, i_laload, i_land, i_lastore, i_lcmp, i_lconst_0, i_lconst_1, i_ldc,
+ i_ldc_w, i_ldc2_w, i_ldiv, i_lload, i_lload_0, i_lload_1, i_lload_2, i_lload_3, i_lmul, i_lneg, i_lookupswitch,
+ i_lor, i_lrem, i_lreturn, i_lshl, i_lshr, i_lstore, i_lstore_0, i_lstore_1, i_lstore_2, i_lstore_3, i_lsub, i_lushr,
+ i_lxor, i_monitorenter, i_monitorexit, i_multianewarray, i_new, i_newarray, i_nop, i_pop, i_pop2, i_putfield,
+ i_putstatic, i_ret, i_ret_w, i_return, i_saload, i_sastore, i_sipush, i_swap, i_tableswitch, i_wide
+
;
-terminal String Str, Word, Insn;
+terminal String Str, Word;
terminal Integer Int;
terminal Number Num;
-nonterminal String classname;
+nonterminal String Insn;
+nonterminal String Word_plus_keywords;
nonterminal Object optional_default, item;
nonterminal Object deprecated_attr, signature_attr;
@@ -168,13 +191,13 @@ source_spec ::=
// ---- Class specification
class_spec ::=
- DCLASS access:a classname:name SEP
+ DCLASS access:a Word_plus_keywords:name SEP
{:
classFile.setClass(name,
(short)(a.intValue() | RuntimeConstants.ACC_SUPER));
:}
|
- DINTERFACE access:a classname:name SEP
+ DINTERFACE access:a Word_plus_keywords:name SEP
{:
classFile.setClass(name,
(short)(a.intValue() |
@@ -182,12 +205,231 @@ class_spec ::=
:}
;
-classname ::=
- Word:w
- {: RESULT = ScannerUtils.convertDots(w); :}
-
+Word_plus_keywords ::=
+ Word:w {: RESULT = ScannerUtils.convertDots(w); :}
+ | FROM {: RESULT = "from"; :}
+ | TO {: RESULT = "to"; :}
+ | USING {: RESULT = "using"; :}
+ | IS {: RESULT = "is"; :}
+ | METHOD {: RESULT = "method"; :}
+ | LOOKUPSWITCH {: RESULT = "lookupswitch"; :}
+ | TABLESWITCH {: RESULT = "tableswitch"; :}
+ | DEFAULT {: RESULT = "default"; :}
+ | Insn:i {: RESULT = i; :}
;
+// Don't wanna live in another world. That's the way it was meant to be.
+Insn ::=
+ i_aaload {: RESULT = "aaload" :}
+| i_aastore {: RESULT = "aastore" :}
+| i_aconst_null {: RESULT = "aconst_null" :}
+| i_aload {: RESULT = "aload" :}
+| i_aload_0 {: RESULT = "aload_0" :}
+| i_aload_1 {: RESULT = "aload_1" :}
+| i_aload_2 {: RESULT = "aload_2" :}
+| i_aload_3 {: RESULT = "aload_3" :}
+| i_anewarray {: RESULT = "anewarray" :}
+| i_areturn {: RESULT = "areturn" :}
+| i_arraylength {: RESULT = "arraylength" :}
+| i_astore {: RESULT = "astore" :}
+| i_astore_0 {: RESULT = "astore_0" :}
+| i_astore_1 {: RESULT = "astore_1" :}
+| i_astore_2 {: RESULT = "astore_2" :}
+| i_astore_3 {: RESULT = "astore_3" :}
+| i_athrow {: RESULT = "athrow" :}
+| i_baload {: RESULT = "baload" :}
+| i_bastore {: RESULT = "bastore" :}
+| i_bipush {: RESULT = "bipush" :}
+| i_breakpoint {: RESULT = "breakpoint" :}
+| i_caload {: RESULT = "caload" :}
+| i_castore {: RESULT = "castore" :}
+| i_checkcast {: RESULT = "checkcast" :}
+| i_d2f {: RESULT = "d2f" :}
+| i_d2i {: RESULT = "d2i" :}
+| i_d2l {: RESULT = "d2l" :}
+| i_dadd {: RESULT = "dadd" :}
+| i_daload {: RESULT = "daload" :}
+| i_dastore {: RESULT = "dastore" :}
+| i_dcmpg {: RESULT = "dcmpg" :}
+| i_dcmpl {: RESULT = "dcmpl" :}
+| i_dconst_0 {: RESULT = "dconst_0" :}
+| i_dconst_1 {: RESULT = "dconst_1" :}
+| i_ddiv {: RESULT = "ddiv" :}
+| i_dload {: RESULT = "dload" :}
+| i_dload_0 {: RESULT = "dload_0" :}
+| i_dload_1 {: RESULT = "dload_1" :}
+| i_dload_2 {: RESULT = "dload_2" :}
+| i_dload_3 {: RESULT = "dload_3" :}
+| i_dmul {: RESULT = "dmul" :}
+| i_dneg {: RESULT = "dneg" :}
+| i_drem {: RESULT = "drem" :}
+| i_dreturn {: RESULT = "dreturn" :}
+| i_dstore {: RESULT = "dstore" :}
+| i_dstore_0 {: RESULT = "dstore_0" :}
+| i_dstore_1 {: RESULT = "dstore_1" :}
+| i_dstore_2 {: RESULT = "dstore_2" :}
+| i_dstore_3 {: RESULT = "dstore_3" :}
+| i_dsub {: RESULT = "dsub" :}
+| i_dup {: RESULT = "dup" :}
+| i_dup2 {: RESULT = "dup2" :}
+| i_dup2_x1 {: RESULT = "dup2_x1" :}
+| i_dup2_x2 {: RESULT = "dup2_x2" :}
+| i_dup_x1 {: RESULT = "dup_x1" :}
+| i_dup_x2 {: RESULT = "dup_x2" :}
+| i_f2d {: RESULT = "f2d" :}
+| i_f2i {: RESULT = "f2i" :}
+| i_f2l {: RESULT = "f2l" :}
+| i_fadd {: RESULT = "fadd" :}
+| i_faload {: RESULT = "faload" :}
+| i_fastore {: RESULT = "fastore" :}
+| i_fcmpg {: RESULT = "fcmpg" :}
+| i_fcmpl {: RESULT = "fcmpl" :}
+| i_fconst_0 {: RESULT = "fconst_0" :}
+| i_fconst_1 {: RESULT = "fconst_1" :}
+| i_fconst_2 {: RESULT = "fconst_2" :}
+| i_fdiv {: RESULT = "fdiv" :}
+| i_fload {: RESULT = "fload" :}
+| i_fload_0 {: RESULT = "fload_0" :}
+| i_fload_1 {: RESULT = "fload_1" :}
+| i_fload_2 {: RESULT = "fload_2" :}
+| i_fload_3 {: RESULT = "fload_3" :}
+| i_fmul {: RESULT = "fmul" :}
+| i_fneg {: RESULT = "fneg" :}
+| i_frem {: RESULT = "frem" :}
+| i_freturn {: RESULT = "freturn" :}
+| i_fstore {: RESULT = "fstore" :}
+| i_fstore_0 {: RESULT = "fstore_0" :}
+| i_fstore_1 {: RESULT = "fstore_1" :}
+| i_fstore_2 {: RESULT = "fstore_2" :}
+| i_fstore_3 {: RESULT = "fstore_3" :}
+| i_fsub {: RESULT = "fsub" :}
+| i_getfield {: RESULT = "getfield" :}
+| i_getstatic {: RESULT = "getstatic" :}
+| i_goto {: RESULT = "goto" :}
+| i_goto_w {: RESULT = "goto_w" :}
+| i_i2d {: RESULT = "i2d" :}
+| i_i2f {: RESULT = "i2f" :}
+| i_i2l {: RESULT = "i2l" :}
+| i_iadd {: RESULT = "iadd" :}
+| i_iaload {: RESULT = "iaload" :}
+| i_iand {: RESULT = "iand" :}
+| i_iastore {: RESULT = "iastore" :}
+| i_iconst_0 {: RESULT = "iconst_0" :}
+| i_iconst_1 {: RESULT = "iconst_1" :}
+| i_iconst_2 {: RESULT = "iconst_2" :}
+| i_iconst_3 {: RESULT = "iconst_3" :}
+| i_iconst_4 {: RESULT = "iconst_4" :}
+| i_iconst_5 {: RESULT = "iconst_5" :}
+| i_iconst_m1 {: RESULT = "iconst_m1" :}
+| i_idiv {: RESULT = "idiv" :}
+| i_if_acmpeq {: RESULT = "if_acmpeq" :}
+| i_if_acmpne {: RESULT = "if_acmpne" :}
+| i_if_icmpeq {: RESULT = "if_icmpeq" :}
+| i_if_icmpge {: RESULT = "if_icmpge" :}
+| i_if_icmpgt {: RESULT = "if_icmpgt" :}
+| i_if_icmple {: RESULT = "if_icmple" :}
+| i_if_icmplt {: RESULT = "if_icmplt" :}
+| i_if_icmpne {: RESULT = "if_icmpne" :}
+| i_ifeq {: RESULT = "ifeq" :}
+| i_ifge {: RESULT = "ifge" :}
+| i_ifgt {: RESULT = "ifgt" :}
+| i_ifle {: RESULT = "ifle" :}
+| i_iflt {: RESULT = "iflt" :}
+| i_ifne {: RESULT = "ifne" :}
+| i_ifnonnull {: RESULT = "ifnonnull" :}
+| i_ifnull {: RESULT = "ifnull" :}
+| i_iinc {: RESULT = "iinc" :}
+| i_iload {: RESULT = "iload" :}
+| i_iload_0 {: RESULT = "iload_0" :}
+| i_iload_1 {: RESULT = "iload_1" :}
+| i_iload_2 {: RESULT = "iload_2" :}
+| i_iload_3 {: RESULT = "iload_3" :}
+| i_imul {: RESULT = "imul" :}
+| i_ineg {: RESULT = "ineg" :}
+| i_instanceof {: RESULT = "instanceof" :}
+| i_int2byte {: RESULT = "int2byte" :}
+| i_int2char {: RESULT = "int2char" :}
+| i_int2short {: RESULT = "int2short" :}
+| i_i2b {: RESULT = "i2b" :}
+| i_i2c {: RESULT = "i2c" :}
+| i_i2s {: RESULT = "i2s" :}
+| i_invokeinterface {: RESULT = "invokeinterface" :}
+| i_invokenonvirtual {: RESULT = "invokenonvirtual" :}
+| i_invokespecial {: RESULT = "invokespecial" :}
+| i_invokestatic {: RESULT = "invokestatic" :}
+| i_invokevirtual {: RESULT = "invokevirtual" :}
+| i_invokedynamic {: RESULT = "invokedynamic" :}
+| i_ior {: RESULT = "ior" :}
+| i_irem {: RESULT = "irem" :}
+| i_ireturn {: RESULT = "ireturn" :}
+| i_ishl {: RESULT = "ishl" :}
+| i_ishr {: RESULT = "ishr" :}
+| i_istore {: RESULT = "istore" :}
+| i_istore_0 {: RESULT = "istore_0" :}
+| i_istore_1 {: RESULT = "istore_1" :}
+| i_istore_2 {: RESULT = "istore_2" :}
+| i_istore_3 {: RESULT = "istore_3" :}
+| i_isub {: RESULT = "isub" :}
+| i_iushr {: RESULT = "iushr" :}
+| i_ixor {: RESULT = "ixor" :}
+| i_jsr {: RESULT = "jsr" :}
+| i_jsr_w {: RESULT = "jsr_w" :}
+| i_l2d {: RESULT = "l2d" :}
+| i_l2f {: RESULT = "l2f" :}
+| i_l2i {: RESULT = "l2i" :}
+| i_ladd {: RESULT = "ladd" :}
+| i_laload {: RESULT = "laload" :}
+| i_land {: RESULT = "land" :}
+| i_lastore {: RESULT = "lastore" :}
+| i_lcmp {: RESULT = "lcmp" :}
+| i_lconst_0 {: RESULT = "lconst_0" :}
+| i_lconst_1 {: RESULT = "lconst_1" :}
+| i_ldc {: RESULT = "ldc" :}
+| i_ldc_w {: RESULT = "ldc_w" :}
+| i_ldc2_w {: RESULT = "ldc2_w" :}
+| i_ldiv {: RESULT = "ldiv" :}
+| i_lload {: RESULT = "lload" :}
+| i_lload_0 {: RESULT = "lload_0" :}
+| i_lload_1 {: RESULT = "lload_1" :}
+| i_lload_2 {: RESULT = "lload_2" :}
+| i_lload_3 {: RESULT = "lload_3" :}
+| i_lmul {: RESULT = "lmul" :}
+| i_lneg {: RESULT = "lneg" :}
+| i_lookupswitch {: RESULT = "lookupswitch" :}
+| i_lor {: RESULT = "lor" :}
+| i_lrem {: RESULT = "lrem" :}
+| i_lreturn {: RESULT = "lreturn" :}
+| i_lshl {: RESULT = "lshl" :}
+| i_lshr {: RESULT = "lshr" :}
+| i_lstore {: RESULT = "lstore" :}
+| i_lstore_0 {: RESULT = "lstore_0" :}
+| i_lstore_1 {: RESULT = "lstore_1" :}
+| i_lstore_2 {: RESULT = "lstore_2" :}
+| i_lstore_3 {: RESULT = "lstore_3" :}
+| i_lsub {: RESULT = "lsub" :}
+| i_lushr {: RESULT = "lushr" :}
+| i_lxor {: RESULT = "lxor" :}
+| i_monitorenter {: RESULT = "monitorenter" :}
+| i_monitorexit {: RESULT = "monitorexit" :}
+| i_multianewarray {: RESULT = "multianewarray" :}
+| i_new {: RESULT = "new" :}
+| i_newarray {: RESULT = "newarray" :}
+| i_nop {: RESULT = "nop" :}
+| i_pop {: RESULT = "pop" :}
+| i_pop2 {: RESULT = "pop2" :}
+| i_putfield {: RESULT = "putfield" :}
+| i_putstatic {: RESULT = "putstatic" :}
+| i_ret {: RESULT = "ret" :}
+| i_ret_w {: RESULT = "ret_w" :}
+| i_return {: RESULT = "return" :}
+| i_saload {: RESULT = "saload" :}
+| i_sastore {: RESULT = "sastore" :}
+| i_sipush {: RESULT = "sipush" :}
+| i_swap {: RESULT = "swap" :}
+| i_tableswitch {: RESULT = "tableswitch" :}
+| i_wide {: RESULT = "wide" :}
+;
+
access ::=
{: access_val = 0; :}
access_list
@@ -231,7 +473,7 @@ access_item ::=
// ---- Superclass specification
super_spec ::=
- DSUPER classname:name SEP
+ DSUPER Word_plus_keywords:name SEP
{:
classFile.setSuperClass(name);
:}
@@ -248,7 +490,7 @@ impls ::= implements_list | /* empty */ ;
implements_list ::= implements_list implements_spec | implements_spec ;
-implements_spec ::= DIMPLEMENTS classname:name SEP
+implements_spec ::= DIMPLEMENTS Word_plus_keywords:name SEP
{: classFile.addInterface(name); :}
;
@@ -532,7 +774,7 @@ line_expr ::=
// .throws <class>
throws_expr ::=
- classname:s
+ Word_plus_keywords:s
{:
classFile.addThrow(s);
:}
@@ -540,7 +782,7 @@ throws_expr ::=
// .catch <class> from <label1> to <label2> using <branchlab>
catch_expr ::=
- classname:aclass FROM Word:fromlab TO Word:tolab USING Word:branchlab
+ Word_plus_keywords:aclass FROM Word:fromlab TO Word:tolab USING Word:branchlab
{:
classFile.addCatch(aclass,
fromlab, tolab,
@@ -588,22 +830,22 @@ simple_instruction ::=
classFile.plant(i, n);
:}
|
- Insn:i Word:n
+ Insn:i Word_plus_keywords:n
{:
classFile.plant(i, n);
:}
|
- Insn:i Word:n Int:n2
+ Insn:i Word_plus_keywords:n Int:n2
{:
classFile.plant(i, n, n2.intValue());
:}
|
- Insn:i Word:n1 Word:n2
+ Insn:i Word_plus_keywords:n1 Word_plus_keywords:n2
{:
classFile.plant(i, n1, n2);
:}
|
- Insn:i Str:n1 Word:n2 Word:n3
+ Insn:i Str:n1 Word_plus_keywords:n2 Word_plus_keywords:n3
{:
classFile.plant(i, n1, n2, n3);
:}
=====================================
src/jasmin/parser.java
=====================================
The diff for this file was not included because it is too large.
=====================================
src/jasmin/sym.java
=====================================
@@ -1,7 +1,6 @@
//----------------------------------------------------
-// The following code was generated by CUP v0.10k
-// Thu Jan 05 19:36:41 CET 2012
+// The following code was generated by CUP v0.11b beta 20140226
//----------------------------------------------------
package jasmin;
@@ -9,86 +8,583 @@ package jasmin;
/** CUP generated class containing symbol constants. */
public class sym {
/* terminals */
+ public static final int i_fneg = 150;
+ public static final int i_lxor = 264;
+ public static final int i_fstore_3 = 157;
+ public static final int i_ireturn = 217;
+ public static final int i_baload = 93;
+ public static final int i_fstore_2 = 156;
+ public static final int i_fstore_1 = 155;
+ public static final int i_fstore_0 = 154;
+ public static final int i_wide = 283;
+ public static final int i_iaload = 167;
+ public static final int i_ifnull = 193;
+ public static final int i_dadd = 103;
+ public static final int Word = 285;
+ public static final int BOOL_KIND = 37;
+ public static final int i_iload = 195;
+ public static final int i_ddiv = 110;
+ public static final int DANNOT_ELEM = 47;
+ public static final int i_if_acmpne = 179;
+ public static final int i_lsub = 262;
+ public static final int INTERFACE = 58;
+ public static final int NATIVE = 59;
+ public static final int i_dstore = 120;
+ public static final int i_lastore = 236;
+ public static final int DCLASS_ATTR = 18;
+ public static final int i_imul = 200;
+ public static final int i_ishr = 219;
+ public static final int STR_KIND = 45;
+ public static final int CLS_KIND = 44;
+ public static final int i_ret_w = 276;
+ public static final int i_ishl = 218;
+ public static final int i_invokespecial = 211;
+ public static final int i_lreturn = 254;
+ public static final int i_fsub = 158;
public static final int FROM = 54;
- public static final int INT_KIND = 33;
+ public static final int i_dconst_1 = 109;
+ public static final int i_dconst_0 = 108;
+ public static final int EQ = 73;
+ public static final int SEP = 74;
+ public static final int i_putfield = 273;
+ public static final int DEND = 4;
+ public static final int i_int2char = 204;
+ public static final int i_i2s = 208;
+ public static final int i_i2l = 165;
+ public static final int i_ifne = 191;
+ public static final int i_sastore = 279;
+ public static final int i_i2f = 164;
+ public static final int i_i2d = 163;
+ public static final int i_dup2_x2 = 129;
+ public static final int i_i2c = 207;
+ public static final int i_dup2_x1 = 128;
+ public static final int i_iushr = 226;
+ public static final int i_i2b = 206;
+ public static final int FLOAT_KIND = 40;
+ public static final int i_aaload = 76;
+ public static final int i_iconst_m1 = 176;
+ public static final int i_multianewarray = 267;
+ public static final int DLIMIT = 6;
+ public static final int i_dup_x2 = 131;
+ public static final int i_dup_x1 = 130;
+ public static final int DELEM = 48;
+ public static final int i_if_icmpgt = 182;
+ public static final int Str = 284;
+ public static final int i_if_icmpge = 181;
+ public static final int DANNOT_DEFAULT = 49;
+ public static final int i_iflt = 190;
+ public static final int i_fload_3 = 148;
+ public static final int i_fload_2 = 147;
+ public static final int i_fload_1 = 146;
+ public static final int i_fload_0 = 145;
+ public static final int DEFAULT = 72;
+ public static final int i_ifle = 189;
+ public static final int DRUNTIME_PARAM_VISIBLE = 29;
public static final int DPARAM_ANNOT_ATTR = 50;
- public static final int DCLASS = 3;
- public static final int STRICTFP = 67;
+ public static final int i_fload = 144;
+ public static final int i_jsr = 228;
+ public static final int i_if_icmpeq = 180;
+ public static final int i_checkcast = 99;
+ public static final int ENUM_KIND = 43;
+ public static final int EOF = 0;
+ public static final int i_dmul = 116;
+ public static final int i_dstore_3 = 124;
+ public static final int i_dstore_2 = 123;
+ public static final int i_dstore_1 = 122;
+ public static final int i_dstore_0 = 121;
+ public static final int i_ladd = 233;
+ public static final int i_goto = 161;
+ public static final int i_iload_3 = 199;
+ public static final int i_iload_2 = 198;
+ public static final int i_iload_1 = 197;
+ public static final int i_iload_0 = 196;
+ public static final int PUBLIC = 62;
+ public static final int INT_KIND = 33;
+ public static final int i_ldiv = 243;
+ public static final int FINAL = 57;
+ public static final int i_aastore = 77;
+ public static final int i_lookupswitch = 251;
public static final int DVAR = 14;
- public static final int DSUPER = 10;
- public static final int DANNOT_ELEM = 47;
- public static final int ENUM = 69;
- public static final int Insn = 78;
- public static final int TABLESWITCH = 71;
- public static final int Int = 79;
- public static final int LOOKUPSWITCH = 70;
+ public static final int i_fadd = 135;
+ public static final int i_breakpoint = 96;
+ public static final int i_areturn = 85;
+ public static final int i_fdiv = 143;
+ public static final int i_istore = 220;
+ public static final int DMETHOD = 8;
+ public static final int i_ldc = 240;
+ public static final int i_jsr_w = 229;
+ public static final int i_dload = 111;
public static final int TRANSIENT = 65;
- public static final int STR_KIND = 45;
- public static final int PROTECTED = 61;
- public static final int ARR_KIND = 41;
- public static final int DARR_ELEM = 46;
- public static final int BOOL_KIND = 37;
- public static final int ANN_KIND = 42;
- public static final int FINAL = 57;
- public static final int DSOURCE = 12;
- public static final int ENUM_KIND = 43;
+ public static final int i_lload_3 = 248;
+ public static final int i_l2i = 232;
+ public static final int i_lload_2 = 247;
+ public static final int DINNER_CLASS_SPEC_ATTR = 22;
+ public static final int i_lload_1 = 246;
+ public static final int i_lload_0 = 245;
+ public static final int i_l2f = 231;
+ public static final int i_iinc = 194;
+ public static final int i_l2d = 230;
+ public static final int i_if_acmpeq = 178;
+ public static final int i_int2short = 205;
+ public static final int i_lconst_1 = 239;
+ public static final int Num = 287;
+ public static final int i_d2l = 102;
+ public static final int i_nop = 270;
+ public static final int i_lconst_0 = 238;
public static final int DANNOTATION_ATTR = 31;
- public static final int EQ = 73;
- public static final int LONG_KIND = 38;
- public static final int ABSTRACT = 56;
- public static final int DCLASS_ATTR = 18;
- public static final int DINTERFACE = 16;
+ public static final int i_lcmp = 237;
+ public static final int i_d2i = 101;
+ public static final int i_ifgt = 188;
+ public static final int i_iand = 168;
+ public static final int i_d2f = 100;
+ public static final int i_dastore = 105;
+ public static final int COLON = 75;
public static final int DFIELD_ATTR = 19;
- public static final int CLS_KIND = 44;
- public static final int NATIVE = 59;
- public static final int DINNER_CLASS_ATTR = 21;
- public static final int DRUNTIME_PARAM_VISIBLE = 29;
- public static final int DTHROWS = 13;
- public static final int INTERFACE = 58;
- public static final int DDEPRECATED = 25;
- public static final int DANNOT_DEFAULT = 49;
- public static final int DSET = 9;
- public static final int DFIELD = 5;
- public static final int DLIMIT = 6;
- public static final int PUBLIC = 62;
- public static final int DRUNTIME_PARAM_INVISIBLE = 30;
+ public static final int i_ifge = 187;
+ public static final int i_dreturn = 119;
+ public static final int i_ldc2_w = 242;
+ public static final int i_faload = 136;
+ public static final int DIMPLEMENTS = 15;
+ public static final int i_monitorenter = 265;
+ public static final int SHORT_KIND = 36;
+ public static final int i_irem = 216;
+ public static final int METHOD = 55;
+ public static final int DOUB_KIND = 39;
+ public static final int i_ineg = 201;
+ public static final int i_ifeq = 186;
+ public static final int i_astore = 87;
public static final int DNOSUPER = 11;
- public static final int DEND = 4;
- public static final int DMETHOD = 8;
+ public static final int DFIELD = 5;
+ public static final int i_astore_3 = 91;
+ public static final int i_astore_2 = 90;
+ public static final int i_astore_1 = 89;
+ public static final int TO = 51;
+ public static final int i_astore_0 = 88;
+ public static final int DCODE_ATTR = 17;
+ public static final int i_castore = 98;
+ public static final int CHAR_KIND = 35;
+ public static final int i_fconst_2 = 142;
+ public static final int i_fconst_1 = 141;
+ public static final int i_fconst_0 = 140;
+ public static final int i_ixor = 227;
+ public static final int i_invokeinterface = 209;
+ public static final int i_dup2 = 127;
+ public static final int i_newarray = 269;
+ public static final int i_arraylength = 86;
+ public static final int i_lmul = 249;
+ public static final int i_lshr = 256;
+ public static final int i_lshl = 255;
public static final int DRUNTIME_VISIBLE = 27;
- public static final int DANNOTATION = 32;
- public static final int EOF = 0;
- public static final int DEFAULT = 72;
public static final int DRUNTIME_INVISIBLE = 28;
- public static final int DENCLOSING_METH = 24;
- public static final int DOUB_KIND = 39;
- public static final int IS = 53;
- public static final int DINNER_CLASS_SPEC_ATTR = 22;
- public static final int METHOD = 55;
- public static final int DSIG_ATTR = 26;
- public static final int error = 1;
- public static final int Word = 77;
- public static final int SYNCHRONIZED = 64;
+ public static final int DDEPRECATED = 25;
+ public static final int i_isub = 225;
+ public static final int DARR_ELEM = 46;
+ public static final int i_putstatic = 274;
+ public static final int i_aload = 79;
+ public static final int PROTECTED = 61;
+ public static final int TABLESWITCH = 71;
+ public static final int i_laload = 234;
public static final int DMETHOD_ATTR = 20;
- public static final int SEP = 74;
- public static final int ANNOTATION = 68;
- public static final int SHORT_KIND = 36;
- public static final int FLOAT_KIND = 40;
- public static final int COLON = 75;
+ public static final int i_getstatic = 160;
+ public static final int i_fmul = 149;
+ public static final int DRUNTIME_PARAM_INVISIBLE = 30;
+ public static final int i_iconst_5 = 175;
+ public static final int i_iconst_4 = 174;
+ public static final int i_iconst_3 = 173;
+ public static final int i_iconst_2 = 172;
+ public static final int i_iconst_1 = 171;
+ public static final int i_iconst_0 = 170;
+ public static final int BYTE_KIND = 34;
public static final int USING = 52;
+ public static final int DINNER_CLASS_ATTR = 21;
+ public static final int i_aload_3 = 83;
+ public static final int i_aload_2 = 82;
+ public static final int i_aload_1 = 81;
+ public static final int i_aload_0 = 80;
+ public static final int i_ldc_w = 241;
+ public static final int LONG_KIND = 38;
+ public static final int i_goto_w = 162;
+ public static final int i_ior = 215;
+ public static final int i_drem = 118;
+ public static final int DENCLOSING_METH = 24;
public static final int DLINE = 7;
- public static final int DCATCH = 2;
+ public static final int i_dneg = 117;
+ public static final int error = 1;
+ public static final int ANNOTATION = 68;
+ public static final int i_dup = 126;
+ public static final int i_fcmpl = 139;
+ public static final int i_fcmpg = 138;
+ public static final int i_invokenonvirtual = 210;
+ public static final int i_invokestatic = 212;
+ public static final int ENUM = 69;
+ public static final int i_dload_3 = 115;
+ public static final int i_dload_2 = 114;
+ public static final int i_dload_1 = 113;
+ public static final int i_tableswitch = 282;
+ public static final int i_dload_0 = 112;
+ public static final int DTHROWS = 13;
public static final int VOLATILE = 66;
- public static final int CHAR_KIND = 35;
- public static final int DIMPLEMENTS = 15;
- public static final int PRIVATE = 60;
- public static final int TO = 51;
+ public static final int i_daload = 104;
+ public static final int i_sipush = 280;
public static final int STATIC = 63;
- public static final int Str = 76;
- public static final int DCODE_ATTR = 17;
- public static final int Num = 80;
- public static final int BYTE_KIND = 34;
- public static final int DELEM = 48;
+ public static final int i_aconst_null = 78;
+ public static final int i_dsub = 125;
+ public static final int i_fstore = 153;
+ public static final int i_ret = 275;
+ public static final int i_istore_3 = 224;
+ public static final int i_new = 268;
+ public static final int i_istore_2 = 223;
+ public static final int i_istore_1 = 222;
+ public static final int i_istore_0 = 221;
+ public static final int DINTERFACE = 16;
+ public static final int i_iadd = 166;
+ public static final int i_return = 277;
+ public static final int i_invokedynamic = 214;
+ public static final int ABSTRACT = 56;
+ public static final int i_lload = 244;
+ public static final int SYNCHRONIZED = 64;
+ public static final int i_idiv = 177;
+ public static final int i_dcmpl = 107;
+ public static final int i_getfield = 159;
+ public static final int i_dcmpg = 106;
+ public static final int i_instanceof = 202;
+ public static final int i_bipush = 95;
+ public static final int DANNOTATION = 32;
+ public static final int i_athrow = 92;
+ public static final int STRICTFP = 67;
+ public static final int ANN_KIND = 42;
+ public static final int i_caload = 97;
+ public static final int LOOKUPSWITCH = 70;
+ public static final int i_lstore_3 = 261;
+ public static final int i_lstore_2 = 260;
+ public static final int i_lstore_1 = 259;
+ public static final int i_land = 235;
+ public static final int i_lstore_0 = 258;
public static final int DSYNTHETIC = 23;
+ public static final int DCLASS = 3;
+ public static final int i_f2l = 134;
+ public static final int i_pop = 271;
+ public static final int i_saload = 278;
+ public static final int i_f2i = 133;
+ public static final int i_fastore = 137;
+ public static final int PRIVATE = 60;
+ public static final int i_lor = 252;
+ public static final int i_if_icmpne = 185;
+ public static final int i_f2d = 132;
+ public static final int i_int2byte = 203;
+ public static final int i_bastore = 94;
+ public static final int DSIG_ATTR = 26;
+ public static final int i_freturn = 152;
+ public static final int DSET = 9;
+ public static final int DSOURCE = 12;
+ public static final int i_lstore = 257;
+ public static final int i_lrem = 253;
+ public static final int Int = 286;
+ public static final int i_anewarray = 84;
+ public static final int IS = 53;
+ public static final int i_lushr = 263;
+ public static final int i_swap = 281;
+ public static final int i_invokevirtual = 213;
+ public static final int i_monitorexit = 266;
+ public static final int i_lneg = 250;
+ public static final int i_pop2 = 272;
+ public static final int i_if_icmplt = 184;
+ public static final int ARR_KIND = 41;
+ public static final int i_frem = 151;
+ public static final int i_if_icmple = 183;
+ public static final int i_iastore = 169;
+ public static final int i_ifnonnull = 192;
+ public static final int DSUPER = 10;
+ public static final int DCATCH = 2;
+ public static final String[] terminalNames = new String[] {
+ "EOF",
+ "error",
+ "DCATCH",
+ "DCLASS",
+ "DEND",
+ "DFIELD",
+ "DLIMIT",
+ "DLINE",
+ "DMETHOD",
+ "DSET",
+ "DSUPER",
+ "DNOSUPER",
+ "DSOURCE",
+ "DTHROWS",
+ "DVAR",
+ "DIMPLEMENTS",
+ "DINTERFACE",
+ "DCODE_ATTR",
+ "DCLASS_ATTR",
+ "DFIELD_ATTR",
+ "DMETHOD_ATTR",
+ "DINNER_CLASS_ATTR",
+ "DINNER_CLASS_SPEC_ATTR",
+ "DSYNTHETIC",
+ "DENCLOSING_METH",
+ "DDEPRECATED",
+ "DSIG_ATTR",
+ "DRUNTIME_VISIBLE",
+ "DRUNTIME_INVISIBLE",
+ "DRUNTIME_PARAM_VISIBLE",
+ "DRUNTIME_PARAM_INVISIBLE",
+ "DANNOTATION_ATTR",
+ "DANNOTATION",
+ "INT_KIND",
+ "BYTE_KIND",
+ "CHAR_KIND",
+ "SHORT_KIND",
+ "BOOL_KIND",
+ "LONG_KIND",
+ "DOUB_KIND",
+ "FLOAT_KIND",
+ "ARR_KIND",
+ "ANN_KIND",
+ "ENUM_KIND",
+ "CLS_KIND",
+ "STR_KIND",
+ "DARR_ELEM",
+ "DANNOT_ELEM",
+ "DELEM",
+ "DANNOT_DEFAULT",
+ "DPARAM_ANNOT_ATTR",
+ "TO",
+ "USING",
+ "IS",
+ "FROM",
+ "METHOD",
+ "ABSTRACT",
+ "FINAL",
+ "INTERFACE",
+ "NATIVE",
+ "PRIVATE",
+ "PROTECTED",
+ "PUBLIC",
+ "STATIC",
+ "SYNCHRONIZED",
+ "TRANSIENT",
+ "VOLATILE",
+ "STRICTFP",
+ "ANNOTATION",
+ "ENUM",
+ "LOOKUPSWITCH",
+ "TABLESWITCH",
+ "DEFAULT",
+ "EQ",
+ "SEP",
+ "COLON",
+ "i_aaload",
+ "i_aastore",
+ "i_aconst_null",
+ "i_aload",
+ "i_aload_0",
+ "i_aload_1",
+ "i_aload_2",
+ "i_aload_3",
+ "i_anewarray",
+ "i_areturn",
+ "i_arraylength",
+ "i_astore",
+ "i_astore_0",
+ "i_astore_1",
+ "i_astore_2",
+ "i_astore_3",
+ "i_athrow",
+ "i_baload",
+ "i_bastore",
+ "i_bipush",
+ "i_breakpoint",
+ "i_caload",
+ "i_castore",
+ "i_checkcast",
+ "i_d2f",
+ "i_d2i",
+ "i_d2l",
+ "i_dadd",
+ "i_daload",
+ "i_dastore",
+ "i_dcmpg",
+ "i_dcmpl",
+ "i_dconst_0",
+ "i_dconst_1",
+ "i_ddiv",
+ "i_dload",
+ "i_dload_0",
+ "i_dload_1",
+ "i_dload_2",
+ "i_dload_3",
+ "i_dmul",
+ "i_dneg",
+ "i_drem",
+ "i_dreturn",
+ "i_dstore",
+ "i_dstore_0",
+ "i_dstore_1",
+ "i_dstore_2",
+ "i_dstore_3",
+ "i_dsub",
+ "i_dup",
+ "i_dup2",
+ "i_dup2_x1",
+ "i_dup2_x2",
+ "i_dup_x1",
+ "i_dup_x2",
+ "i_f2d",
+ "i_f2i",
+ "i_f2l",
+ "i_fadd",
+ "i_faload",
+ "i_fastore",
+ "i_fcmpg",
+ "i_fcmpl",
+ "i_fconst_0",
+ "i_fconst_1",
+ "i_fconst_2",
+ "i_fdiv",
+ "i_fload",
+ "i_fload_0",
+ "i_fload_1",
+ "i_fload_2",
+ "i_fload_3",
+ "i_fmul",
+ "i_fneg",
+ "i_frem",
+ "i_freturn",
+ "i_fstore",
+ "i_fstore_0",
+ "i_fstore_1",
+ "i_fstore_2",
+ "i_fstore_3",
+ "i_fsub",
+ "i_getfield",
+ "i_getstatic",
+ "i_goto",
+ "i_goto_w",
+ "i_i2d",
+ "i_i2f",
+ "i_i2l",
+ "i_iadd",
+ "i_iaload",
+ "i_iand",
+ "i_iastore",
+ "i_iconst_0",
+ "i_iconst_1",
+ "i_iconst_2",
+ "i_iconst_3",
+ "i_iconst_4",
+ "i_iconst_5",
+ "i_iconst_m1",
+ "i_idiv",
+ "i_if_acmpeq",
+ "i_if_acmpne",
+ "i_if_icmpeq",
+ "i_if_icmpge",
+ "i_if_icmpgt",
+ "i_if_icmple",
+ "i_if_icmplt",
+ "i_if_icmpne",
+ "i_ifeq",
+ "i_ifge",
+ "i_ifgt",
+ "i_ifle",
+ "i_iflt",
+ "i_ifne",
+ "i_ifnonnull",
+ "i_ifnull",
+ "i_iinc",
+ "i_iload",
+ "i_iload_0",
+ "i_iload_1",
+ "i_iload_2",
+ "i_iload_3",
+ "i_imul",
+ "i_ineg",
+ "i_instanceof",
+ "i_int2byte",
+ "i_int2char",
+ "i_int2short",
+ "i_i2b",
+ "i_i2c",
+ "i_i2s",
+ "i_invokeinterface",
+ "i_invokenonvirtual",
+ "i_invokespecial",
+ "i_invokestatic",
+ "i_invokevirtual",
+ "i_invokedynamic",
+ "i_ior",
+ "i_irem",
+ "i_ireturn",
+ "i_ishl",
+ "i_ishr",
+ "i_istore",
+ "i_istore_0",
+ "i_istore_1",
+ "i_istore_2",
+ "i_istore_3",
+ "i_isub",
+ "i_iushr",
+ "i_ixor",
+ "i_jsr",
+ "i_jsr_w",
+ "i_l2d",
+ "i_l2f",
+ "i_l2i",
+ "i_ladd",
+ "i_laload",
+ "i_land",
+ "i_lastore",
+ "i_lcmp",
+ "i_lconst_0",
+ "i_lconst_1",
+ "i_ldc",
+ "i_ldc_w",
+ "i_ldc2_w",
+ "i_ldiv",
+ "i_lload",
+ "i_lload_0",
+ "i_lload_1",
+ "i_lload_2",
+ "i_lload_3",
+ "i_lmul",
+ "i_lneg",
+ "i_lookupswitch",
+ "i_lor",
+ "i_lrem",
+ "i_lreturn",
+ "i_lshl",
+ "i_lshr",
+ "i_lstore",
+ "i_lstore_0",
+ "i_lstore_1",
+ "i_lstore_2",
+ "i_lstore_3",
+ "i_lsub",
+ "i_lushr",
+ "i_lxor",
+ "i_monitorenter",
+ "i_monitorexit",
+ "i_multianewarray",
+ "i_new",
+ "i_newarray",
+ "i_nop",
+ "i_pop",
+ "i_pop2",
+ "i_putfield",
+ "i_putstatic",
+ "i_ret",
+ "i_ret_w",
+ "i_return",
+ "i_saload",
+ "i_sastore",
+ "i_sipush",
+ "i_swap",
+ "i_tableswitch",
+ "i_wide",
+ "Str",
+ "Word",
+ "Int",
+ "Num"
+ };
}
=====================================
src/tables.out/shortarray_0.obj
=====================================
Binary files /dev/null and b/src/tables.out/shortarray_0.obj differ
=====================================
src/tables.out/shortarray_1.obj
=====================================
Binary files /dev/null and b/src/tables.out/shortarray_1.obj differ
=====================================
src/tables.out/shortarray_2.obj
=====================================
Binary files /dev/null and b/src/tables.out/shortarray_2.obj differ
View it on GitLab: https://salsa.debian.org/java-team/jasmin-sable/-/commit/8b89371e04ede1b1e56ee8a881a3030a27af5d7d
--
View it on GitLab: https://salsa.debian.org/java-team/jasmin-sable/-/commit/8b89371e04ede1b1e56ee8a881a3030a27af5d7d
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20250129/fc6f09bc/attachment.htm>
More information about the pkg-java-commits
mailing list