Removed sand worm spice state from steno lexer
This commit is contained in:
parent
f630b919f2
commit
e04aa1440b
|
@ -36,6 +36,7 @@ import org.x4o.fc18.cake2.FourCornerX18CakePointSequence;
|
||||||
import org.x4o.fc18.cake2.pie9d.FCDotPIE9DDash09;
|
import org.x4o.fc18.cake2.pie9d.FCDotPIE9DDash09;
|
||||||
import org.x4o.fc18.cake2.zero33.FCDotCDC1604DashP6;
|
import org.x4o.fc18.cake2.zero33.FCDotCDC1604DashP6;
|
||||||
import org.x4o.fc18.zion7.FourCornerZion7Candlelier;
|
import org.x4o.fc18.zion7.FourCornerZion7Candlelier;
|
||||||
|
import org.x4o.fc18.zion7.FourCornerZion7WaterCodex;
|
||||||
import org.x4o.fc18.zion7.FourCornerZionStenoLexer;
|
import org.x4o.fc18.zion7.FourCornerZionStenoLexer;
|
||||||
import org.x4o.fc18.zion7.FourCornerZionStenoLexerSmoke;
|
import org.x4o.fc18.zion7.FourCornerZionStenoLexerSmoke;
|
||||||
|
|
||||||
|
@ -118,7 +119,7 @@ public class FourCornerUnicodeDisplay {
|
||||||
lexer.withSmokeSignals(printer).read(chars);
|
lexer.withSmokeSignals(printer).read(chars);
|
||||||
}
|
}
|
||||||
|
|
||||||
private final class StenoUnicodePrinter implements FourCornerZion7Candlelier, FourCornerZionStenoLexerSmoke.Adapter {
|
private final class StenoUnicodePrinter implements FourCornerZion7Candlelier, FourCornerZion7WaterCodex, FourCornerZionStenoLexerSmoke.Adapter {
|
||||||
|
|
||||||
private final StringBuilder output;
|
private final StringBuilder output;
|
||||||
private FourCornerZionStenoLexer thisDisplayEscaked = null;
|
private FourCornerZionStenoLexer thisDisplayEscaked = null;
|
||||||
|
@ -216,11 +217,6 @@ public class FourCornerUnicodeDisplay {
|
||||||
renderFromInt18(math, output);
|
renderFromInt18(math, output);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void strobeUnicode(List<Integer> codePoints) {
|
|
||||||
codePoints.forEach(v -> output.appendCodePoint(v));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void strobeRecursiveCake(List<Integer> cakePoints) {
|
public void strobeRecursiveCake(List<Integer> cakePoints) {
|
||||||
if (thisDisplayEscaked == null) {
|
if (thisDisplayEscaked == null) {
|
||||||
|
@ -230,8 +226,11 @@ public class FourCornerUnicodeDisplay {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void strobeSandWorm(List<Integer> head, List<Integer> body) {
|
public void strobeSandWalker(List<Integer> rhythm) {
|
||||||
// TODO Auto-generated method stub
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void strobeSandWorm(List<Integer> spice) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -245,5 +244,14 @@ public class FourCornerUnicodeDisplay {
|
||||||
output.append(";");
|
output.append(";");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void strobeWaterUnicode(List<Integer> codePoints) {
|
||||||
|
codePoints.forEach(v -> output.appendCodePoint(v));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void strobeWaterKanji(List<Integer> kuTenPoints) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,14 +42,14 @@ public interface FourCornerZion7Candlelier {
|
||||||
/// 1152 bit fractions of two 576 bit numbers.
|
/// 1152 bit fractions of two 576 bit numbers.
|
||||||
void strobeNCR1632(BigInteger denominator, BigInteger numerator);
|
void strobeNCR1632(BigInteger denominator, BigInteger numerator);
|
||||||
|
|
||||||
/// To support current code and resources which require unicode to access.
|
|
||||||
void strobeUnicode(List<Integer> codePoints);
|
|
||||||
|
|
||||||
/// Allows a 6 bit computer to use the nether,fractions or unicode.
|
/// Allows a 6 bit computer to use the nether,fractions or unicode.
|
||||||
void strobeRecursiveCake(List<Integer> cakePoints);
|
void strobeRecursiveCake(List<Integer> cakePoints);
|
||||||
|
|
||||||
/// Octal sand worm, with up to 576 bit mime-type data type header.
|
/// Octal sand walker, with an 72 to 576 bit mime-type rhythm header.
|
||||||
void strobeSandWorm(List<Integer> head, List<Integer> body);
|
void strobeSandWalker(List<Integer> rhythm);
|
||||||
|
|
||||||
|
/// Octal sand worm spice
|
||||||
|
void strobeSandWorm(List<Integer> spice);
|
||||||
|
|
||||||
interface Adapter extends FourCornerZion7Candlelier {
|
interface Adapter extends FourCornerZion7Candlelier {
|
||||||
|
|
||||||
|
@ -65,16 +65,16 @@ public interface FourCornerZion7Candlelier {
|
||||||
default void strobeNCR1632(BigInteger denominator, BigInteger numerator) {
|
default void strobeNCR1632(BigInteger denominator, BigInteger numerator) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
default void strobeUnicode(List<Integer> codePoints) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
default void strobeRecursiveCake(List<Integer> cakePoints) {
|
default void strobeRecursiveCake(List<Integer> cakePoints) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
default void strobeSandWorm(List<Integer> head, List<Integer> body) {
|
default void strobeSandWalker(List<Integer> rhythm) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
default void strobeSandWorm(List<Integer> spice) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,12 +24,26 @@ package org.x4o.fc18.zion7;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.x4o.fc18.cake2.zero33.FCDotDEC0901DashEU;
|
|
||||||
|
|
||||||
/// Handles the lexer water codex strobes.
|
/// Handles the lexer water codex strobes.
|
||||||
///
|
///
|
||||||
/// @author Willem Cazander
|
/// @author Willem Cazander
|
||||||
/// @version 1.0 Jan 22, 2025
|
/// @version 1.0 Jan 22, 2025
|
||||||
public interface FourCornerZion7WaterCodex extends FourCornerZion7Candlelier {
|
public interface FourCornerZion7WaterCodex extends FourCornerZion7Candlelier {
|
||||||
|
|
||||||
|
/// To support current code and resources which require unicode to access.
|
||||||
|
void strobeWaterUnicode(List<Integer> codePoints);
|
||||||
|
|
||||||
|
/// To support native rendering on the MSX
|
||||||
|
void strobeWaterKanji(List<Integer> kuTenPoints);
|
||||||
|
|
||||||
|
interface Adapter extends FourCornerZion7WaterCodex, FourCornerZion7Candlelier.Adapter {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
default void strobeWaterUnicode(List<Integer> codePoints) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
default void strobeWaterKanji(List<Integer> kuTenPoints) {
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,20 +45,18 @@ import org.x4o.fc18.cake2.zero33.FCDotDEC2701DashPX0;
|
||||||
public class FourCornerZionStenoLexer {
|
public class FourCornerZionStenoLexer {
|
||||||
|
|
||||||
private final static FourCornerZion7AlphaOmega CLEAN_BIBLE = new FourCornerZion7AlphaOmega.Adapter() {};
|
private final static FourCornerZion7AlphaOmega CLEAN_BIBLE = new FourCornerZion7AlphaOmega.Adapter() {};
|
||||||
|
private final static FourCornerZion7WaterCodex CLEAN_WATER = new FourCornerZion7WaterCodex.Adapter() {};
|
||||||
private final static FourCornerZionStenoLexerFire CLEAN_FIRE = new FourCornerZionStenoLexerFire.Adapter() {};
|
private final static FourCornerZionStenoLexerFire CLEAN_FIRE = new FourCornerZionStenoLexerFire.Adapter() {};
|
||||||
private final static FourCornerZionStenoLexerSmoke CLEAN_SMOKE = new FourCornerZionStenoLexerSmoke.Adapter() {};
|
private final static FourCornerZionStenoLexerSmoke CLEAN_SMOKE = new FourCornerZionStenoLexerSmoke.Adapter() {};
|
||||||
private final boolean handlerEscape;
|
private final boolean handlerEscape;
|
||||||
private final FourCornerZion7Candlelier handler;
|
private final FourCornerZion7Candlelier handler;
|
||||||
private final FourCornerZion7AlphaOmega handlerDocument;
|
private final FourCornerZion7AlphaOmega handlerDocument;
|
||||||
|
private final FourCornerZion7WaterCodex handlerCodex;
|
||||||
private final FourCornerZion7SalahSequence handlerSalahSequence;
|
private final FourCornerZion7SalahSequence handlerSalahSequence;
|
||||||
private final FourCornerZion7TempleScrolls handlerTempleScrolls;
|
private final FourCornerZion7TempleScrolls handlerTempleScrolls;
|
||||||
private final List<StenoScanner> scanners = new ArrayList<>(); // TODO: make static is WIP
|
private final List<StenoScanner> scanners = new ArrayList<>(); // TODO: make static is WIP
|
||||||
private final int denominatorBank[] = new int[64]; // <== is the terminator select per 9 bit group
|
private final int denominatorBank[] = new int[64]; // <== is the terminator select per 9 bit group
|
||||||
private final int numeratorBank[] = new int[denominatorBank.length];
|
private final int numeratorBank[] = new int[denominatorBank.length];
|
||||||
private final List<Integer> sandwormHead = new ArrayList<>();
|
|
||||||
private boolean sandwormSign = false;
|
|
||||||
private int sandwormSignLine = 0;
|
|
||||||
private int sandwormSignColumn = 0;
|
|
||||||
private List<Integer> input;
|
private List<Integer> input;
|
||||||
private int inputIndex = 0;
|
private int inputIndex = 0;
|
||||||
private int currLine = 0;
|
private int currLine = 0;
|
||||||
|
@ -78,6 +76,11 @@ public class FourCornerZionStenoLexer {
|
||||||
} else {
|
} else {
|
||||||
this.handlerDocument = CLEAN_BIBLE;
|
this.handlerDocument = CLEAN_BIBLE;
|
||||||
}
|
}
|
||||||
|
if (handler instanceof FourCornerZion7WaterCodex) {
|
||||||
|
this.handlerCodex = FourCornerZion7WaterCodex.class.cast(handler);
|
||||||
|
} else {
|
||||||
|
this.handlerCodex = CLEAN_WATER;
|
||||||
|
}
|
||||||
if (handler instanceof FourCornerZion7SalahSequence) {
|
if (handler instanceof FourCornerZion7SalahSequence) {
|
||||||
this.handlerSalahSequence = FourCornerZion7SalahSequence.class.cast(handler);
|
this.handlerSalahSequence = FourCornerZion7SalahSequence.class.cast(handler);
|
||||||
} else {
|
} else {
|
||||||
|
@ -170,9 +173,6 @@ public class FourCornerZionStenoLexer {
|
||||||
smokeSignals.burnUnsupported(currLine, currCol, input.get(inputIndex));
|
smokeSignals.burnUnsupported(currLine, currCol, input.get(inputIndex));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (sandwormSign) {
|
|
||||||
smokeSignals.burnSandWormSignUnused(sandwormSignLine, sandwormSignColumn);
|
|
||||||
}
|
|
||||||
handlerDocument.strobeDocumentOmega();
|
handlerDocument.strobeDocumentOmega();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -301,9 +301,6 @@ public class FourCornerZionStenoLexer {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void process(FourCornerZionStenoLexer lexer, int idxFirst, int idxLast) {
|
public void process(FourCornerZionStenoLexer lexer, int idxFirst, int idxLast) {
|
||||||
if (lexer.sandwormSign) {
|
|
||||||
lexer.smokeSignals.burnSandWormSignUnused(lexer.sandwormSignLine, lexer.sandwormSignColumn);
|
|
||||||
}
|
|
||||||
int bitSize = 0;
|
int bitSize = 0;
|
||||||
int bitIdxLast = 0;
|
int bitIdxLast = 0;
|
||||||
int[] sandWalking = new int[576];
|
int[] sandWalking = new int[576];
|
||||||
|
@ -318,7 +315,7 @@ public class FourCornerZionStenoLexer {
|
||||||
sandWalking[bitOff] = 1;
|
sandWalking[bitOff] = 1;
|
||||||
bitSize = bitOff;
|
bitSize = bitOff;
|
||||||
}
|
}
|
||||||
lexer.sandwormHead.clear();
|
List<Integer> sandwormHead = new ArrayList<>();
|
||||||
PrimitiveIterator.OfInt i = Arrays.stream(sandWalking).iterator();
|
PrimitiveIterator.OfInt i = Arrays.stream(sandWalking).iterator();
|
||||||
int octalIdx = 2;
|
int octalIdx = 2;
|
||||||
int octalValue = 0;
|
int octalValue = 0;
|
||||||
|
@ -334,20 +331,17 @@ public class FourCornerZionStenoLexer {
|
||||||
octalIdx--;
|
octalIdx--;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
lexer.sandwormHead.add(octalValue);
|
sandwormHead.add(octalValue);
|
||||||
octalIdx = 2;
|
octalIdx = 2;
|
||||||
octalValue = 0;
|
octalValue = 0;
|
||||||
}
|
}
|
||||||
int wormHeadSize = lexer.sandwormHead.size();
|
int wormHeadSize = sandwormHead.size();
|
||||||
if (WORM_SIGN.contains(wormHeadSize)) {
|
if (!WORM_SIGN.contains(wormHeadSize)) {
|
||||||
lexer.sandwormSign = true;
|
lexer.smokeSignals.burnSandWormSignIncorrect(lexer.currLine, lexer.currCol, wormHeadSize);
|
||||||
lexer.sandwormSignLine = lexer.currLine;
|
return;
|
||||||
lexer.sandwormSignColumn = lexer.currCol;
|
|
||||||
lexer.fireSignals.fireStateSandWormSign(wormHeadSize);
|
|
||||||
return; // Sand walking signal pulses have been stamped correctly to call the worm
|
|
||||||
}
|
}
|
||||||
lexer.sandwormHead.clear();
|
// Sand walking signal pulses have been stamped correctly to call the worm
|
||||||
lexer.smokeSignals.burnSandWormSignIncorrect(lexer.currLine, lexer.currCol, wormHeadSize);
|
lexer.handler.strobeSandWalker(sandwormHead);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -359,12 +353,11 @@ public class FourCornerZionStenoLexer {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void process(FourCornerZionStenoLexer lexer, int idxFirst, int idxLast) {
|
public void process(FourCornerZionStenoLexer lexer, int idxFirst, int idxLast) {
|
||||||
lexer.sandwormSign = false;
|
|
||||||
List<Integer> wormBody15 = new ArrayList<>();
|
List<Integer> wormBody15 = new ArrayList<>();
|
||||||
for (int i = idxFirst; i <= idxLast; i++) {
|
for (int i = idxFirst; i <= idxLast; i++) {
|
||||||
wormBody15.add(lexer.input.get(i));
|
wormBody15.add(lexer.input.get(i));
|
||||||
}
|
}
|
||||||
List<Integer> wormBody = new ArrayList<>();
|
List<Integer> wormSpice = new ArrayList<>();
|
||||||
Iterator<Integer> i15 = wormBody15.iterator();
|
Iterator<Integer> i15 = wormBody15.iterator();
|
||||||
while (i15.hasNext()) {
|
while (i15.hasNext()) {
|
||||||
int bitValue15 = i15.next();
|
int bitValue15 = i15.next();
|
||||||
|
@ -388,13 +381,13 @@ public class FourCornerZionStenoLexer {
|
||||||
octal0 += ((bitValue15 >> 2) & 0b1) << 2;
|
octal0 += ((bitValue15 >> 2) & 0b1) << 2;
|
||||||
octal0 += ((bitValue15 >> 1) & 0b1) << 1;
|
octal0 += ((bitValue15 >> 1) & 0b1) << 1;
|
||||||
octal0 += ((bitValue15 >> 0) & 0b1) << 0;
|
octal0 += ((bitValue15 >> 0) & 0b1) << 0;
|
||||||
wormBody.add(octal4);
|
wormSpice.add(octal4);
|
||||||
wormBody.add(octal3);
|
wormSpice.add(octal3);
|
||||||
wormBody.add(octal2);
|
wormSpice.add(octal2);
|
||||||
wormBody.add(octal1);
|
wormSpice.add(octal1);
|
||||||
wormBody.add(octal0);
|
wormSpice.add(octal0);
|
||||||
}
|
}
|
||||||
lexer.handler.strobeSandWorm(lexer.sandwormHead, wormBody);
|
lexer.handler.strobeSandWorm(wormSpice);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -471,7 +464,7 @@ public class FourCornerZionStenoLexer {
|
||||||
lexer.smokeSignals.burnUNI21UnusedBigIndian(lexer.currLine, lexer.currCol);
|
lexer.smokeSignals.burnUNI21UnusedBigIndian(lexer.currLine, lexer.currCol);
|
||||||
}
|
}
|
||||||
if (!result.isEmpty()) {
|
if (!result.isEmpty()) {
|
||||||
lexer.handler.strobeUnicode(result);
|
lexer.handlerCodex.strobeWaterUnicode(result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,8 +38,6 @@ public interface FourCornerZionStenoLexerFire {
|
||||||
|
|
||||||
void fireStateNCR1632BankReset(boolean magic);
|
void fireStateNCR1632BankReset(boolean magic);
|
||||||
|
|
||||||
void fireStateSandWormSign(int size);
|
|
||||||
|
|
||||||
interface Adapter extends FourCornerZionStenoLexerFire {
|
interface Adapter extends FourCornerZionStenoLexerFire {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -61,9 +59,5 @@ public interface FourCornerZionStenoLexerFire {
|
||||||
@Override
|
@Override
|
||||||
default void fireStateNCR1632BankReset(boolean magic) {
|
default void fireStateNCR1632BankReset(boolean magic) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
default void fireStateSandWormSign(int size) {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,8 +45,6 @@ public interface FourCornerZionStenoLexerSmoke {
|
||||||
|
|
||||||
void burnSandWormSignIncorrect(int line, int col, int size);
|
void burnSandWormSignIncorrect(int line, int col, int size);
|
||||||
|
|
||||||
void burnSandWormSignUnused(int line, int col);
|
|
||||||
|
|
||||||
|
|
||||||
interface Adapter extends FourCornerZionStenoLexerSmoke {
|
interface Adapter extends FourCornerZionStenoLexerSmoke {
|
||||||
|
|
||||||
|
@ -77,9 +75,5 @@ public interface FourCornerZionStenoLexerSmoke {
|
||||||
@Override
|
@Override
|
||||||
default void burnSandWormSignIncorrect(int line, int col, int size) {
|
default void burnSandWormSignIncorrect(int line, int col, int size) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
default void burnSandWormSignUnused(int line, int col) {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue