gitweb on Svarog
projekti pod git sistemom za održavanje verzija -- projects under the git version control systemdiff --git a/src/com/quemaster/transformations/mjc2wsl/MicroJavaInput.java b/src/com/quemaster/transformations/mjc2wsl/MicroJavaInput.java
package com.quemaster.transformations.mjc2wsl;
/*
package com.quemaster.transformations.mjc2wsl;
/*
- Copyright (C) 2014 Doni Pracner
+ Copyright (C) 2014,2015,2018 Doni Pracner
This file is part of mjc2wsl.
This file is part of mjc2wsl.
public class MicroJavaInput {
private HashMap<Integer, String> opMap;
public class MicroJavaInput {
private HashMap<Integer, String> opMap;
- public String opCodeFile = "/mj-bytecodes.properties";
+ public String opCodeFile = "mj-bytecodes.properties";
private InputStream mainIn;
int counter = -1;
private InputStream mainIn;
int counter = -1;
int numberOfWords;
private int codesize;
int numberOfWords;
private int codesize;
- public MicroJavaInput() {
-
+ public MicroJavaInput(InputStream input) throws Exception {
+ mainIn = input;
+ processHeader();
}
public int get() {
}
public int get() {
return (get2() << 16) + (get2() << 16 >>> 16);
}
return (get2() << 16) + (get2() << 16 >>> 16);
}
- public void processHeader(mjc2wsl mjc2wsl) throws Exception {
+ public void processHeader() throws Exception {
byte m = (byte) get();
byte j = (byte) get();
if (m != 'M' || j != 'J')
throw new Exception("Wrong start of bytecode file");
codesize = get4();
byte m = (byte) get();
byte j = (byte) get();
if (m != 'M' || j != 'J')
throw new Exception("Wrong start of bytecode file");
codesize = get4();
- setNumberOfWords(get4());
- setMainAdr(get4());
+ this.numberOfWords = get4();
+ this.mainAdr = get4();
}
}
- public void setStream(InputStream ins) {
- mainIn = ins;
- }
public int getCounter() {
return counter;
public int getCounter() {
return counter;
return codesize;
}
return codesize;
}
- public int getMainAdr(mjc2wsl mjc2wsl) {
+ public int getMainAdr() {
return mainAdr;
}
return mainAdr;
}
- public int getNumberOfWords(mjc2wsl mjc2wsl) {
+ public int getNumberOfWords() {
return numberOfWords;
}
return numberOfWords;
}
- void setNumberOfWords(int numberOfWords) {
- this.numberOfWords = numberOfWords;
- }
-
- void setMainAdr(int mainAdr) {
- this.mainAdr = mainAdr;
- }
-
String getRelationFor(int opcode) throws Exception {
switch (opcode) {
case mjc2wsl.jeq:
String getRelationFor(int opcode) throws Exception {
switch (opcode) {
case mjc2wsl.jeq: