Final
This commit is contained in:
parent
7e9e25b77b
commit
1b45d6a0f9
@ -414,11 +414,9 @@ public class CodeGen {
|
|||||||
case Mem.RelAccess relAccess -> {
|
case Mem.RelAccess relAccess -> {
|
||||||
String initLabel = "$init:" + varDef.name + "@" + loc.location().begLine() + ":" + loc.location().begColumn();
|
String initLabel = "$init:" + varDef.name + "@" + loc.location().begLine() + ":" + loc.location().begColumn();
|
||||||
data.add(new PDM.LABEL(initLabel, loc));
|
data.add(new PDM.LABEL(initLabel, loc));
|
||||||
if (relAccess.inits != null) {
|
|
||||||
for (Integer init : relAccess.inits) {
|
for (Integer init : relAccess.inits) {
|
||||||
data.add(new PDM.DATA(init, loc));
|
data.add(new PDM.DATA(init, loc));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
code.add(new PDM.PUSH(-relAccess.size, loc));
|
code.add(new PDM.PUSH(-relAccess.size, loc));
|
||||||
code.add(new PDM.POPN(loc));
|
code.add(new PDM.POPN(loc));
|
||||||
|
@ -28,12 +28,12 @@ public class Machine {
|
|||||||
/**
|
/**
|
||||||
* Ali se opravi testni izpis ukazov.
|
* Ali se opravi testni izpis ukazov.
|
||||||
*/
|
*/
|
||||||
public static boolean debugInstrsList = true;
|
public static boolean debugInstrsList = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ali se opravi testni izpis vrednost oznak.
|
* Ali se opravi testni izpis vrednost oznak.
|
||||||
*/
|
*/
|
||||||
public static boolean debugLabelsList = true;
|
public static boolean debugLabelsList = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ali se opravi testni izpis dogajanja na skladu.
|
* Ali se opravi testni izpis dogajanja na skladu.
|
||||||
|
@ -230,7 +230,7 @@ public class Memory {
|
|||||||
int parOffset = 4; // +SL
|
int parOffset = 4; // +SL
|
||||||
Vector<Mem.RelAccess> debugPars = new Vector<>();
|
Vector<Mem.RelAccess> debugPars = new Vector<>();
|
||||||
for (AST.ParDef parDef : funDef.pars) {
|
for (AST.ParDef parDef : funDef.pars) {
|
||||||
Mem.RelAccess access = new Mem.RelAccess(parOffset, frameBuilder.depth, 4, null, parDef.name);
|
Mem.RelAccess access = new Mem.RelAccess(parOffset, frameBuilder.depth, 4, new Vector<>(), parDef.name);
|
||||||
parOffset += access.size;
|
parOffset += access.size;
|
||||||
debugPars.add(access);
|
debugPars.add(access);
|
||||||
attrAST.attrParAccess.put(parDef, access);
|
attrAST.attrParAccess.put(parDef, access);
|
||||||
@ -285,7 +285,6 @@ public class Memory {
|
|||||||
|
|
||||||
if (varDef.inits.size() == 0) {
|
if (varDef.inits.size() == 0) {
|
||||||
size = 4;
|
size = 4;
|
||||||
inits = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (frameBuilder == null) {
|
if (frameBuilder == null) {
|
||||||
@ -329,17 +328,12 @@ public class Memory {
|
|||||||
public static Integer decodeChrConst(final AST.AtomExpr chrAtomExpr, final Report.Locatable loc) {
|
public static Integer decodeChrConst(final AST.AtomExpr chrAtomExpr, final Report.Locatable loc) {
|
||||||
switch (chrAtomExpr.value.charAt(1)) {
|
switch (chrAtomExpr.value.charAt(1)) {
|
||||||
case '\\':
|
case '\\':
|
||||||
switch (chrAtomExpr.value.charAt(2)) {
|
return switch (chrAtomExpr.value.charAt(2)) {
|
||||||
case 'n':
|
case 'n' -> 10;
|
||||||
return 10;
|
case '\'' -> ((int) '\'');
|
||||||
case '\'':
|
case '\\' -> ((int) '\\');
|
||||||
return ((int) '\'');
|
default -> Integer.parseInt(chrAtomExpr.value.substring(2, 4), 16);
|
||||||
case '\\':
|
};
|
||||||
return ((int) '\\');
|
|
||||||
default:
|
|
||||||
return 16 * (((int) chrAtomExpr.value.charAt(2)) - ((int) '0'))
|
|
||||||
+ (((int) chrAtomExpr.value.charAt(3)) - ((int) '0'));
|
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
return ((int) chrAtomExpr.value.charAt(1));
|
return ((int) chrAtomExpr.value.charAt(1));
|
||||||
}
|
}
|
||||||
@ -371,8 +365,7 @@ public class Memory {
|
|||||||
c += 1;
|
c += 1;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
value.addLast(16 * (((int) strAtomExpr.value.charAt(c + 1)) - ((int) '0'))
|
value.addLast(Integer.parseInt(strAtomExpr.value.substring(c + 1, c + 3), 16));
|
||||||
+ (((int) strAtomExpr.value.charAt(c + 2)) - ((int) '0')));
|
|
||||||
c += 2;
|
c += 2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
5
zip.sh
5
zip.sh
@ -6,8 +6,9 @@ read -r phase
|
|||||||
mkdir pins25
|
mkdir pins25
|
||||||
rsync -av --exclude=".*" ./src ./pins25
|
rsync -av --exclude=".*" ./src ./pins25
|
||||||
mkdir ./pins25/prg
|
mkdir ./pins25/prg
|
||||||
cp ./prg/Makefile ./pins25/prg
|
#cp ./prg/Makefile ./pins25/prg
|
||||||
rm ./pins25/prg/*.pins25
|
#rm ./pins25/prg/*.pins25
|
||||||
|
cp -r ./prg ./pins25
|
||||||
rm 63230048-"$phase".zip
|
rm 63230048-"$phase".zip
|
||||||
zip -r 63230048-"$phase".zip ./pins25
|
zip -r 63230048-"$phase".zip ./pins25
|
||||||
rm -rf ./pins25
|
rm -rf ./pins25
|
||||||
|
Loading…
x
Reference in New Issue
Block a user