Initial commit of main compiler sources (or should I say ... SAUCES!)

This commit is contained in:
2025-06-08 23:58:21 +10:00
parent 60c566025c
commit 06f2613083
214 changed files with 22210 additions and 0 deletions

View File

@ -0,0 +1,29 @@
package slangc.api;
public abstract class BytecodeOutput {
protected int count = 0;
public abstract void endOfFile();
public abstract void processByte(byte b);
public final void write8(byte b) {
processByte(b);
count++;
}
public int getCount() {
return count;
}
public void write16(short w) {
write8((byte)w);
write8((byte)(w >> 8));
}
public void write32(int w) {
write16((short)w);
write16((short)(w >> 16));
}
public void write64(long w) {
write32((int)w);
write32((int)(w >> 32));
}
}