diff --git a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/FourCornerUnicodeDisplay.java b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/FourCornerUnicodeDisplay.java index b158f6c..b0a523f 100644 --- a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/FourCornerUnicodeDisplay.java +++ b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/FourCornerUnicodeDisplay.java @@ -26,7 +26,6 @@ import java.math.BigInteger; import java.util.ArrayList; import java.util.List; import java.util.Objects; -import java.util.Optional; import java.util.function.Consumer; import org.x4o.fc18.cake2.FourCornerDotCake; @@ -130,10 +129,10 @@ public class FourCornerUnicodeDisplay { this.output = Objects.requireNonNull(output); } - private boolean printedEscape(FourCornerDotCake slice, int cakePoint) { + private boolean printedEscape(FourCornerDotCake slice, int offset) { if (FourCornerDotCake.FC_CDC1604_P6.equals(slice)) { - if (cakePoint < 4) { - output.appendCodePoint(FCDotPIE9DDash09.values()[cakePoint].codePointDotIndex()); + if (offset < 4) { + output.appendCodePoint(FCDotPIE9DDash09.values()[offset].codePointDotIndex()); return true; } } @@ -157,35 +156,27 @@ public class FourCornerUnicodeDisplay { } @Override - public void strobeWords(List cakePoints) { - for (int i = 0; i < cakePoints.size(); i++) { - strobeWord(cakePoints.get(i)); + public void strobeWords(FourCornerDotCake slice, List offsets) { + for (int i = 0; i < offsets.size(); i++) { + strobeWord(slice, offsets.get(i)); } } @Override - public void strobeWord(int cakePoint) { - - // TODO: remove slice here; - Optional sliceOpt = FourCornerDotCake.valueFromCakePoint(cakePoint); - if (sliceOpt.isEmpty()) { - return; - } - FourCornerDotCake slice = sliceOpt.get(); - - if (printedEscape(slice, cakePoint)) { + public void strobeWord(FourCornerDotCake slice, int offset) { + if (printedEscape(slice, offset)) { return; } FourCornerX00PetitVide[] videPoints = slice.getVidePoints(); if (slice.isExternWord()) { String nameSpec = slice.nameSpec(); - String key = nameSpec + "." + Integer.toString(cakePoint); + String key = nameSpec + "." + Integer.toString(offset); String value = null; if (value != null) { output.append(value); } else { - FourCornerX00PetitVide videPoint = videPoints[cakePoint - slice.getStart()]; + FourCornerX00PetitVide videPoint = videPoints[offset]; if (videPoint.kaasX18CakeDotName().isPresent()) { List nameX18 = videPoint.kaasX18CakeDotName().get().nameX18(); for (FourCornerX18CakePointSequence letter : nameX18) { @@ -209,7 +200,7 @@ public class FourCornerUnicodeDisplay { //if (offset < 0 || offset > videPoints.length) { // continue; //} - FourCornerX00PetitVide videPoint = videPoints[cakePoint - slice.getStart()]; + FourCornerX00PetitVide videPoint = videPoints[offset]; videPoint.kaasX21CodeSequence().ifPresent(v -> { v.codePointSequence().forEach(vv -> output.appendCodePoint(vv)); }); @@ -218,7 +209,7 @@ public class FourCornerUnicodeDisplay { output.append(slice.name()); output.append("#"); - output.append(cakePoint); + output.append(offset); output.append("#"); } diff --git a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/FourCornerDotCake.java b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/FourCornerDotCake.java index 44a9bc5..beee5a6 100644 --- a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/FourCornerDotCake.java +++ b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/FourCornerDotCake.java @@ -164,12 +164,6 @@ public enum FourCornerDotCake { // =========== Allow pie terminators for symbols without escaping - // build from ovewviews; - // - https://www.msx.org/wiki/KuTen_-_JIS_-_SJIS_Code_Conversion_Tables - // - https://en.wikipedia.org/wiki/Digital_encoding_of_APL_symbols - // - https://en.wikipedia.org/wiki/BraSCII - // - https://en.wikipedia.org/wiki/List_of_Unicode_characters - FC_PIE9C_01(256 + 0 , 1, FCDotPIE9CDash01.values()), FC_PIE9C_02(1 + FC_PIE9C_01.getStop(), 2, FCDotPIE9CDash02.values()), FC_PIE9C_03(1 + FC_PIE9C_02.getStop(), 3, FCDotPIE9CDash03.values()), diff --git a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/pie9c/FCDotPIE9CDash06.java b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/pie9c/FCDotPIE9CDash06.java index 61fd019..2e3100e 100644 --- a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/pie9c/FCDotPIE9CDash06.java +++ b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/pie9c/FCDotPIE9CDash06.java @@ -38,7 +38,7 @@ import org.x4o.fc18.cake2.zero33.FCDotCDC1604DashP6; public enum FCDotPIE9CDash06 implements FourCornerDotCollePie9 { NXX_1('⍟'), // ⍟ = FROM APL - NXX_2('⊕'), // ⊕ = FROM APL + NXX_2('⊗'), // ⊗ = FROM APL NXX_3('⊗'), // ⊗ = FROM APL NXX_4('⊖'), // ⊖ = FROM APL NXX_5('⍉'), // ⍉ = FROM APL diff --git a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/pie9d/FCDotPIE9DDash12.java b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/pie9d/FCDotPIE9DDash12.java index 4d8806f..8e4a346 100644 --- a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/pie9d/FCDotPIE9DDash12.java +++ b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/pie9d/FCDotPIE9DDash12.java @@ -37,18 +37,18 @@ import org.x4o.fc18.cake2.zero33.FCDotCDC1604DashP6; */ public enum FCDotPIE9DDash12 implements FourCornerDotCollePie9 { - NXX_01('≠'), // ≠ from APL - NXX_02('≡'), // ≡ from APL - NXX_03('≢'), // ≢ from APL - NXX_04('≣'), - NXX_05('≤'), // ≤ from APL - NXX_06('≥'), // ≥ from APL - NXX_07('≰'), - NXX_08('≱'), - NXX_09('≮'), - NXX_10('≯'), - NXX_11('≍'), - NXX_12('≭'), + NXX_01(' '), + NXX_02(' '), + NXX_03(' '), + NXX_04(' '), + NXX_05(' '), + NXX_06(' '), + NXX_07(' '), + NXX_08(' '), + NXX_09(' '), + NXX_10(' '), + NXX_11(' '), + NXX_12(' '), ; private final List codePointDisplay; diff --git a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/pie9d/FCDotPIE9DDash21.java b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/pie9d/FCDotPIE9DDash21.java index 6a9a155..b013f13 100644 --- a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/pie9d/FCDotPIE9DDash21.java +++ b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/pie9d/FCDotPIE9DDash21.java @@ -37,27 +37,27 @@ import org.x4o.fc18.cake2.zero33.FCDotCDC1604DashP6; */ public enum FCDotPIE9DDash21 implements FourCornerDotCollePie9 { - NXX_01('⊲'), - NXX_02('⊳'), - NXX_03('⋪'), - NXX_04('⋫'), - NXX_05('⊴'), - NXX_06('⊵'), - NXX_07('⋬'), - NXX_08('⋭'), - NXX_09('∆'), // from APL - NXX_10('∇'), // from APL - NXX_11('⍋'), // from APL - NXX_12('⍒'), // from APL - NXX_13('∧'), // from APL - NXX_14('∨'), // from APL - NXX_15('⊼'), - NXX_16('⊻'), - NXX_17('⍲'), // from APL - NXX_18('⍱'), // from APL - NXX_19('⍙'), // from APL - NXX_20('⍫'), // from APL - NXX_21('⍝'), // from APL + NXX_01(' '), + NXX_02(' '), + NXX_03(' '), + NXX_04(' '), + NXX_05(' '), + NXX_06(' '), + NXX_07(' '), + NXX_08(' '), + NXX_09(' '), + NXX_10(' '), + NXX_11(' '), + NXX_12(' '), + NXX_13(' '), + NXX_14(' '), + NXX_15(' '), + NXX_16(' '), + NXX_17(' '), + NXX_18(' '), + NXX_19(' '), + NXX_20(' '), + NXX_21(' '), ; private final List codePointDisplay; diff --git a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/zero33/FCDotAPL0127DashP7A.java b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/zero33/FCDotAPL0127DashP7A.java index 089777e..e8f3fcf 100644 --- a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/zero33/FCDotAPL0127DashP7A.java +++ b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/zero33/FCDotAPL0127DashP7A.java @@ -56,21 +56,21 @@ public enum FCDotAPL0127DashP7A implements FourCornerDotColleZero33 { // === 8 directions T arrows /// SL610000 - __UP_ARROW(' '), + UP_ARROW('↑'), /// SL600000 - __RIGHT_ARROW(' '), + RIGHT_ARROW('→'), /// SL620000 - __DOWN_ARROW(' '), + DOWN_ARROW('↓'), /// SL590000 - __LEFT_ARROW(' '), + LEFT_ARROW('←'), /// SL220000 - __UP_TACK(' '), + UP_TACK('⊤'), /// SL350000 - __RIGHT_TACK(' '), + RIGHT_TACK('⊣'), /// SL230000 - __DOWN_TACK(' '), + DOWN_TACK('⊥'), /// SL340000 - __LEFT_TACK(' '), + LEFT_TACK('⊢'), // === 8 mirrors @@ -87,21 +87,21 @@ public enum FCDotAPL0127DashP7A implements FourCornerDotColleZero33 { /// SL020000 DOWN_STILE('⌊'), /// SL030000 (used in GNU GPL) - __DEL(' '), + DEL('∇'), /// SL060000 (used in GNU GPL) - __DELTA(' '), + DELTA('∆'), // === 8 Oooohhhs /// SL110000 - __CIRCLE_STAR(' '), + CIRCLE_STAR('⍟'), /// SL090000 - __CIRCLE_STILE(' '), + CIRCLE_STILE('⌽'), /// SL120000 - __CIRCLE_BAR(' '), + CIRCLE_BAR('⊖'), /// SL100000 - __CIRCLE_SLOPE(' '), + CIRCLE_SLOPE('⍉'), ; diff --git a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/zero33/FCDotAPL0127DashP7B.java b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/zero33/FCDotAPL0127DashP7B.java index 863f66f..c37305a 100644 --- a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/zero33/FCDotAPL0127DashP7B.java +++ b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/zero33/FCDotAPL0127DashP7B.java @@ -49,45 +49,45 @@ public enum FCDotAPL0127DashP7B implements FourCornerDotColleZero33 { // SL790000 = Plus = FCDotCDC1604DashP6._PLUS // SL690000 = Bar = FCDotCDC1604DashP6._MINUS /// SL550000 - __TIMES(' '), + TIMES('×'), // SL760000 = Slash = FCDotCDC1604DashP6.BAR_V_RIGHT /// SL540000 - __DIVIDE(' '), + DIVIDE('÷'), // === ALGOL_60 ::= <, ≤, =, ≥, >, ≠ // SL520000 = Less than = FCDotCDC1604DashP6.TAG_COMPARE_LEFT /// SL560000 - __NOT_GREATER(' '), + NOT_GREATER('≤'), // SL810000 = Equal = FCDotCDC1604DashP6._EQUALS /// SL570000 - __NOT_LESS(' '), + NOT_LESS('≥'), // SL530000 = Greater than = FCDotCDC1604DashP6.TAG_COMPARE_RIGHT /// SL820000 - __NOT_EQUAL(' '), + NOT_EQUAL('≠'), /// SL050000 - __DEL_STILE(' '), // grade down + DEL_STILE('⍒'), // grade down /// SL070000 - __DELTA_STILE(' '), + DELTA_STILE('⍋'), // === ALGOL_60 ::= ≡ | ⊃ | ∧ | ∨ | ¬ /// SL300000 - __EQUALS_UNDERBAR(' '), + EQUALS_UNDERBAR('≡'), /// SL430000 - __RIGHT_SHOE(' '), + RIGHT_SHOE('⊃'), /// SL510000 - __UP_CARET(' '), + UP_CARET('∧'), /// SL500000 - __DOWN_CARET(' '), + DOWN_CARET('∨'), /// NEW: This comes from ALGOL_60 chars. ALGOL_NOT('¬'), /// SL170000 - __UP_CARET_TILDE(' '), // NAND + UP_CARET_TILDE('⍲'), // NAND /// SL180000 - __DOWN_CARET_TILDE(' '), + DOWN_CARET_TILDE('⍱'), /// NEW: from Dynalog_APL - __EQUALS_UNDERNOT(' '), + EQUALS_UNDERNOT('≢'), /// === Left over from modern APL for Zilog Z8000 see https://aplwiki.com/wiki/Dyalog_APL @@ -98,11 +98,11 @@ public enum FCDotAPL0127DashP7B implements FourCornerDotColleZero33 { /// SL450000 DIAERESIS('¨'), // SL870000 - __EPSILON_UNDERBAR(' '), + EPSILON_UNDERBAR('⍷'), // SL860000 = Iota Underbar - __IOTA_UNDERBAR(' '), + IOTA_UNDERBAR('⍸'), /// SL730000 - __IOTA(' '), + IOTA('⍳'), /// SL410000 DOWN_SHOE('∪'), /// SL400000 diff --git a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/zero33/FCDotAPL0127DashP7C.java b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/zero33/FCDotAPL0127DashP7C.java index 4b06719..e71585a 100644 --- a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/zero33/FCDotAPL0127DashP7C.java +++ b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/zero33/FCDotAPL0127DashP7C.java @@ -36,30 +36,30 @@ import org.x4o.fc18.cake2.zero33.dec1.FCDotINC0801DashP8; public enum FCDotAPL0127DashP7C implements FourCornerDotColleZero33 { /// SL720000 - __EPSILON(' '), + EPSILON('∊'), /// NEW from dynslog APL - __LEFT_SHOE_UNDERBAR(' '), + LEFT_SHOE_UNDERBAR('⊆'), /// SL420000 - __LEFT_SHOE(' '), + LEFT_SHOE('⊂'), /// SL740000 - __RHO(' '), + RHO('⍴'), /// NEW from dynlog APL MINUS_COMMA('⍪'), /// --------- Left over from IBM APL /// SL210000 - __UP_SHOE_NULL(' '), + UP_SHOE_NULL('⍝'), /// SL630000 OVERBAR('‾'), /// SL710000 - __ALPHA(' '), + ALPHA('⍺'), /// SL750000 - __OMEGA(' '), + OMEGA('⍵'), /// SL040000 - __DEL_TILDE(' '), /// === ⎕LOCK + DEL_TILDE('⍫'), /// === ⎕LOCK /// SL130000 QUAD_QUOTE('⍞'), // GNU APL: stdin and debug out /// SL270000 @@ -69,23 +69,23 @@ public enum FCDotAPL0127DashP7C implements FourCornerDotColleZero33 { /// SL320000 DIAERESIS_DOT('∵'), // each item // SL330000 - __DELTA_UNDERBAR(' '), // GNU APL: user var: starts (A-Z) or one of the 3 characters _, ∆ , or ⍙ + DELTA_UNDERBAR('⍙'), // GNU APL: user var: starts (A-Z) or one of the 3 characters _, ∆ , or ⍙ /// SL370000 LESS_GREATER('⋄'), // each stmt /// SL480000 - __CIRCLE_PLUS(' '), // group + CIRCLE_PLUS('⊕'), // group /// SL490000 - __CIRCLE_TIMES(' '), // index of + CIRCLE_TIMES('⊗'), // index of - OPEN_19(' '), - OPEN_20(' '), - OPEN_21(' '), - OPEN_22(' '), - OPEN_23(' '), - OPEN_24(' '), - OPEN_25(' '), - OPEN_26(' '), - OPEN_27(' '), + OPEN_19('?'), + OPEN_20('?'), + OPEN_21('?'), + OPEN_22('?'), + OPEN_23('?'), + OPEN_24('?'), + OPEN_25('?'), + OPEN_26('?'), + OPEN_27('?'), diff --git a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/FourCornerZion7Candlelier.java b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/FourCornerZion7Candlelier.java index d4471b6..bc8d52f 100644 --- a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/FourCornerZion7Candlelier.java +++ b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/FourCornerZion7Candlelier.java @@ -25,22 +25,29 @@ package org.x4o.fc18.zion7; import java.math.BigInteger; import java.util.List; +import org.x4o.fc18.cake2.FourCornerDotCake; + /// Handles the main lexer four corner cake strobes. /// /// @author Willem Cazander /// @version 1.0 Jan 09, 2025 public interface FourCornerZion7Candlelier { - /// Single word cake point. - void strobeWord(int cakePoint); + // TODO: remove dot cake enum and change offsets to full cake points + // (and remove duplicate list objects like;) + // maybe remove cakeSliceStart as that is not needed for write support, (is already in fire) + //void strobeWords(List text, int textStart, int textStop, int cakeSliceStart); - /// Block of word cake points. - void strobeWords(List cakePoints); + /// Single word from slice. + void strobeWord(FourCornerDotCake slice, int offset); + + /// Block of relative word slice offsets. + void strobeWords(FourCornerDotCake slice, List offsets); /// 1152 bit fractions of two 576 bit numbers. void strobeNCR1632(BigInteger denominator, BigInteger numerator); - /// Allows a 6 bit computer to use the full FC18 space for nether or fractions. + /// Allows a 6 bit computer to use the nether,fractions or unicode. void strobeRecursiveCake(List cakePoints); /// Octal sand walker, with an 72 to 576 bit mime-type rhythm header. @@ -52,11 +59,11 @@ public interface FourCornerZion7Candlelier { interface Adapter extends FourCornerZion7Candlelier { @Override - default void strobeWord(int cakePoint) { + default void strobeWords(FourCornerDotCake slice, List offsets) { } @Override - default void strobeWords(List cakePoints) { + default void strobeWord(FourCornerDotCake slice, int offset) { } @Override diff --git a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/FourCornerZion7SalahSequence.java b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/FourCornerZion7SalahSequence.java index ce39764..144faf5 100644 --- a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/FourCornerZion7SalahSequence.java +++ b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/FourCornerZion7SalahSequence.java @@ -24,18 +24,20 @@ package org.x4o.fc18.zion7; import java.util.List; +import org.x4o.fc18.cake2.zero33.dec1.FCDotDEC2701DashPX0; + /// Handles the lexer salah sequence strobes. /// /// @author Willem Cazander /// @version 1.0 Jan 11, 2025 public interface FourCornerZion7SalahSequence extends FourCornerZion7Candlelier { - void strobeSalahSequence(int type, List> arguments); + void strobeSalahSequence(FCDotDEC2701DashPX0 type, List> arguments); interface Adapter extends FourCornerZion7SalahSequence, FourCornerZion7Candlelier.Adapter { @Override - default void strobeSalahSequence(int type, List> arguments) { + default void strobeSalahSequence(FCDotDEC2701DashPX0 type, List> arguments) { } } } diff --git a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/FourCornerZionStenoGrapher.java b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/FourCornerZionStenoGrapher.java index c87be19..fe9dafe 100644 --- a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/FourCornerZionStenoGrapher.java +++ b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/FourCornerZionStenoGrapher.java @@ -20,66 +20,14 @@ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.x4o.fc18.zion7; - -import java.math.BigInteger; -import java.util.List; -import java.util.Objects; - -import org.x4o.fc18.cake2.zero33.dec1.FCDotDEC2701DashPX0; +package org.x4o.fc18.zion7; /// Write steno for zion. /// /// @author Willem Cazander /// @version 1.0 Jan 11, 2025 public class FourCornerZionStenoGrapher { - - private final List out; - - public FourCornerZionStenoGrapher(List out) { - this.out = Objects.requireNonNull(out); - } - - class FourCornerWriter implements FourCornerZion7AlphaOmega,FourCornerZion7SalahSequence { - - @Override - public void strobeDocumentAlpha() { - } - - @Override - public void strobeDocumentOmega() { - } - - @Override - public void strobeWord(int cakePoint) { - out.add(cakePoint); - } - - @Override - public void strobeWords(List cakePoints) { - out.addAll(cakePoints); - } - - @Override - public void strobeNCR1632(BigInteger denominator, BigInteger numerator) { - } - - @Override - public void strobeRecursiveCake(List cakePoints) { - } - - @Override - public void strobeSandWalker(List rhythm) { - } - - @Override - public void strobeSandWorm(List spice) { - } - - @Override - public void strobeSalahSequence(int type, List> arguments) { - FCDotDEC2701DashPX0 cdcDECMode = FCDotDEC2701DashPX0.valueOf(type); - } + public void write() { } } diff --git a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/FourCornerZionStenoLexer.java b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/FourCornerZionStenoLexer.java index b7b21d3..5f8932a 100644 --- a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/FourCornerZionStenoLexer.java +++ b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/FourCornerZionStenoLexer.java @@ -32,8 +32,6 @@ import java.util.Optional; import java.util.PrimitiveIterator; import org.x4o.fc18.cake2.FourCornerDotCake; -import org.x4o.fc18.cake2.flag4.FCDotF4TTY0001DashNL; -import org.x4o.fc18.cake2.flag4.FCDotF4TXT0001DashSP; import org.x4o.fc18.cake2.zero33.FCDotCDC1604DashP6; import org.x4o.fc18.cake2.zero33.dec1.FCDotCMD5401Dash2D; import org.x4o.fc18.cake2.zero33.dec1.FCDotDEC0801DashE10; @@ -305,21 +303,20 @@ public class FourCornerZionStenoLexer { static class StenoScannerWordCakeSlice extends StenoScanner { - //private final FourCornerDotCake cakeSlice; + private final FourCornerDotCake cakeSlice; public StenoScannerWordCakeSlice(FourCornerDotCake cakeSlice) { super(cakeSlice); - //this.cakeSlice = Objects.requireNonNull(cakeSlice); + this.cakeSlice = Objects.requireNonNull(cakeSlice); } @Override public void process(FourCornerZionStenoLexer lexer, int idxFirst, int idxLast) { -// List offsets = new ArrayList<>(); -// for (int i = idxFirst; i <= idxLast; i++) { -// offsets.add(lexer.input.get(i) - blockStart); -// } -// lexer.handler.strobeWords(cakeSlice, offsets); - lexer.handler.strobeWords(lexer.input.subList(idxFirst, idxLast + 1)); + List offsets = new ArrayList<>(); + for (int i = idxFirst; i <= idxLast; i++) { + offsets.add(lexer.input.get(i) - blockStart); + } + lexer.handler.strobeWords(cakeSlice, offsets); } } @@ -520,12 +517,11 @@ public class FourCornerZionStenoLexer { continue; } int cdcDECPoint = lexer.input.get(lexer.cdcDECScanIndex); - lexer.handler.strobeWord(cdcDECPoint); -// if (FourCornerDotCake.FC_DEC2701_PX0.contains(cdcDECPoint)) { -// lexer.handler.strobeWord(FourCornerDotCake.FC_DEC2701_PX0, cdcDECPoint - FourCornerDotCake.FC_DEC2701_PX0.getStart()); -// } else { -// lexer.handler.strobeWord(FourCornerDotCake.FC_CDC1604_P6, cdcDECPoint); -// } + if (FourCornerDotCake.FC_DEC2701_PX0.contains(cdcDECPoint)) { + lexer.handler.strobeWord(FourCornerDotCake.FC_DEC2701_PX0, cdcDECPoint - FourCornerDotCake.FC_DEC2701_PX0.getStart()); + } else { + lexer.handler.strobeWord(FourCornerDotCake.FC_CDC1604_P6, cdcDECPoint); + } } } @@ -607,7 +603,7 @@ public class FourCornerZionStenoLexer { if (readOK == false) { return true; // point is eaten } - lexer.handlerSalahSequence.strobeSalahSequence(cdcDECMode.ordinal(), args); + lexer.handlerSalahSequence.strobeSalahSequence(cdcDECMode, args); return true; } if (FCDotDEC2701DashPX0.ESC68_2PIE9C.equals(cdcDECMode)) { @@ -658,8 +654,7 @@ public class FourCornerZionStenoLexer { lexer.decModeReset(); return false; } - //lexer.handler.strobeWord(displayCake, cdcPoint - FCDotCDC1604DashP6.NX01_A.ordinal()); - lexer.handler.strobeWord(displayCake.getStart() + cdcPoint - FCDotCDC1604DashP6.NX01_A.ordinal()); + lexer.handler.strobeWord(displayCake, cdcPoint - FCDotCDC1604DashP6.NX01_A.ordinal()); return true; } @@ -686,8 +681,7 @@ public class FourCornerZionStenoLexer { // } if (FCDotDEC0801DashE10.E10_CDC1604_P6.equals(lexer.cdcDECModeE10)) { - lexer.handler.strobeWord(cdcPoint); // not A based offset here - //lexer.handler.strobeWord(FourCornerDotCake.FC_CDC1604_P6, cdcPoint); // not A based offset here + lexer.handler.strobeWord(FourCornerDotCake.FC_CDC1604_P6, cdcPoint); // not A based offset here return true; } FourCornerDotCake displayCake = lexer.cdcDECModeE10.displayCake(); @@ -695,8 +689,7 @@ public class FourCornerZionStenoLexer { lexer.decModeReset(); return false; } - //lexer.handler.strobeWord(displayCake, cdcPoint - FCDotCDC1604DashP6.NX01_A.ordinal()); - lexer.handler.strobeWord(displayCake.getStart() + cdcPoint - FCDotCDC1604DashP6.NX01_A.ordinal()); + lexer.handler.strobeWord(displayCake, cdcPoint - FCDotCDC1604DashP6.NX01_A.ordinal()); return true; } @@ -711,8 +704,7 @@ public class FourCornerZionStenoLexer { FCDotCMD5401Dash2D cmdMode = cmdModeOpt.get(); if (FCDotCMD5401Dash2D.CMD_F4TXT0001_SP.equals(cmdMode)) { lexer.decModeReset(); - //lexer.handler.strobeWord(FourCornerDotCake.FC_F4TXT0001_SP, 0); // white space - lexer.handler.strobeWord(FCDotF4TXT0001DashSP.SPANISH_PEACE.cakePointDotIndex()); // white space + lexer.handler.strobeWord(FourCornerDotCake.FC_F4TXT0001_SP, 0); // white space return true; } if (FCDotCMD5401Dash2D.CMD_F4TTY0001_NL.equals(cmdMode)) { @@ -720,8 +712,7 @@ public class FourCornerZionStenoLexer { lexer.currLine++; lexer.currCol = 0; lexer.fireSignals.fireStateLine(lexer.currLine); - //lexer.handler.strobeWord(FourCornerDotCake.FC_F4TTY0001_NL, 0); // new line - lexer.handler.strobeWord(FCDotF4TTY0001DashNL.NETHER_LINE.cakePointDotIndex()); // new line + lexer.handler.strobeWord(FourCornerDotCake.FC_F4TTY0001_NL, 0); // new line return true; } lexer.decModeReset(); @@ -767,8 +758,7 @@ public class FourCornerZionStenoLexer { sliceBase = FourCornerDotCake.FC_PIE9D_01.ordinal(); } FourCornerDotCake slice = FourCornerDotCake.valueOf(terminatorOffZero + sliceBase); - //lexer.handler.strobeWord(slice, numberIdxOffZero); - lexer.handler.strobeWord(slice.getStart() + numberIdxOffZero); + lexer.handler.strobeWord(slice, numberIdxOffZero); return true; } diff --git a/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/zero33/FCDotAPL.java b/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/zero33/FCDotAPL.java deleted file mode 100644 index 542ad0b..0000000 --- a/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/zero33/FCDotAPL.java +++ /dev/null @@ -1,270 +0,0 @@ -/* - * Copyright (c) 2004-2014, Willem Cazander - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are permitted provided - * that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this list of conditions and the - * following disclaimer. - * * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and - * the following disclaimer in the documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package org.x4o.fc18.cake2.zero33; - -/** - * Enum to convert APL to FC18. - * - * TODO: finish write when needed.. - * - * @author Willem Cazander - * @version 1.0 Jul 30, 2025 - */ -public enum FCDotAPL { - - - /// SL080000 One is pi - CIRCLE('○'), - - // === 2 + 6 boxes - - /// SL360000 - QUAD('⎕'), - /// SL260000 - SQUISH_QUAD('⌷'), - /// SL140000 - QUAD_DIVIDE('⌹'), - /// NEW from Dynlog APL - QUAD_DOT2('⍠'), - /// NEW from Dynlog APL - QUAD_BOX3('⌸'), - /// NEW from Dynlog APl - QUAD_QUAD('⌺'), - - // === 8 directions T arrows - - /// SL610000 - UP_ARROW('↑'), - /// SL600000 - RIGHT_ARROW('→'), - /// SL620000 - DOWN_ARROW('↓'), - /// SL590000 - LEFT_ARROW('←'), - /// SL220000 - UP_TACK('⊤'), - /// SL350000 - RIGHT_TACK('⊣'), - /// SL230000 - DOWN_TACK('⊥'), - /// SL340000 - LEFT_TACK('⊢'), - - // === 8 mirrors - - /// SL190000 - DOWN_TACK_JOT('⍎'), - /// SL200000 - UP_TACK_JOT('⍕'), - /// SL150000 - SLASH_BAR('⌿'), - /// SL160000 - SLOPE_BAR('⍀'), - /// SL010000 - UP_STILE('⌈'), - /// SL020000 - DOWN_STILE('⌊'), - /// SL030000 (used in GNU GPL) - DEL('∇'), - /// SL060000 (used in GNU GPL) - DELTA('∆'), - - - // === 8 Oooohhhs - - /// SL110000 - CIRCLE_STAR('⍟'), - /// SL090000 - CIRCLE_STILE('⌽'), - /// SL120000 - CIRCLE_BAR('⊖'), - /// SL100000 - CIRCLE_SLOPE('⍉'), - - //-------------------------------------------- - - - /// NEW from dynlog APL - CIRCLE_DOT_XL('⍥'), - /// NEW from dynlog APL - CIRLCE_DOT('⍤'), - /// SL250000 - JOT('∘'), - /// NEW from dynlog APL - STAR_DOT('⍣'), - - // === ALGOL_60 ::= + | - | × | / | ÷ | ↑ - - // SL790000 = Plus = FCDotCDC1604DashP6._PLUS - // SL690000 = Bar = FCDotCDC1604DashP6._MINUS - /// SL550000 - TIMES('×'), - // SL760000 = Slash = FCDotCDC1604DashP6.BAR_V_RIGHT - /// SL540000 - DIVIDE('÷'), - - // === ALGOL_60 ::= <, ≤, =, ≥, >, ≠ - - // SL520000 = Less than = FCDotCDC1604DashP6.TAG_COMPARE_LEFT - /// SL560000 - NOT_GREATER('≤'), - // SL810000 = Equal = FCDotCDC1604DashP6._EQUALS - /// SL570000 - NOT_LESS('≥'), - // SL530000 = Greater than = FCDotCDC1604DashP6.TAG_COMPARE_RIGHT - /// SL820000 - NOT_EQUAL('≠'), - /// SL050000 - DEL_STILE('⍒'), // grade down - /// SL070000 - DELTA_STILE('⍋'), - - // === ALGOL_60 ::= ≡ | ⊃ | ∧ | ∨ | ¬ - - /// SL300000 - EQUALS_UNDERBAR('≡'), - /// SL430000 - RIGHT_SHOE('⊃'), - /// SL510000 - UP_CARET('∧'), - /// SL500000 - DOWN_CARET('∨'), - /// NEW: This comes from ALGOL_60 chars. - ALGOL_NOT('¬'), - /// SL170000 - UP_CARET_TILDE('⍲'), // NAND - /// SL180000 - DOWN_CARET_TILDE('⍱'), - /// NEW: from Dynalog_APL - EQUALS_UNDERNOT('≢'), - - /// === Left over from modern APL for Zilog Z8000 see https://aplwiki.com/wiki/Dyalog_APL - - /// SL240000 - IBEAM_TACK('⌶'), - /// NEW from DYNA - DOTTED_TILDE('⍨'), - /// SL450000 - DIAERESIS('¨'), - // SL870000 - EPSILON_UNDERBAR('⍷'), - // SL860000 = Iota Underbar - IOTA_UNDERBAR('⍸'), - /// SL730000 - IOTA('⍳'), - /// SL410000 - DOWN_SHOE('∪'), - /// SL400000 - UP_SHOE('∩'), - - // ------------------------------------------------ - - - /// SL720000 - EPSILON('∊'), - /// NEW from dynslog APL - LEFT_SHOE_UNDERBAR('⊆'), - /// SL420000 - LEFT_SHOE('⊂'), - /// SL740000 - RHO('⍴'), - /// NEW from dynlog APL - MINUS_COMMA('⍪'), - - /// --------- Left over from IBM APL - - /// SL210000 - UP_SHOE_NULL('⍝'), - /// SL630000 - OVERBAR('‾'), - /// SL710000 - ALPHA('⍺'), - /// SL750000 - OMEGA('⍵'), - - - /// SL040000 - DEL_TILDE('⍫'), /// === ⎕LOCK - /// SL130000 - QUAD_QUOTE('⍞'), // GNU APL: stdin and debug out - /// SL270000 - QUAD_JOT('⌻'), // file meta info - /// SL280000 - QUAD_SLOPE('⍂'), // was expand - /// SL320000 - DIAERESIS_DOT('∵'), // each item - // SL330000 - DELTA_UNDERBAR('⍙'), // GNU APL: user var: starts (A-Z) or one of the 3 characters _, ∆ , or ⍙ - /// SL370000 - LESS_GREATER('⋄'), // each stmt - /// SL480000 - CIRCLE_PLUS('⊕'), // group - /// SL490000 - CIRCLE_TIMES('⊗'), // index of - - OPEN_19('?'), - OPEN_20('?'), - OPEN_21('?'), - OPEN_22('?'), - OPEN_23('?'), - OPEN_24('?'), - OPEN_25('?'), - OPEN_26('?'), - OPEN_27('?'), - - - - // SL290000 = Unsupported = Ampersand Underbar - // SL310000 = Unsupported = OUT Symbol = Not used by IBM ? - // SL380000 = Stile = FCDotCDC1604DashP6.BAR_VERTICAL - // SL390000 = undefined - // SL440000 = Underbar = FCDotCDC1604DashP6.BAR_UNDER - // SL460000 = Tilde = FCDotCDC1604DashP6._TILDE - // SL470000 = undefined - // SL580000 = Quote Dot = FCDotCDC1604DashP6._EXCLAMATION - // SL640000 = Slope = FCDotCDC1604DashP6.BAR_V_LEFT - // SL650000 = Star = FCDotCDC1604DashP6._ASTRIKS - // SL660000 = Quota = FCDotCDC1604DashP6._APOSTROPHE - // SL670000 = Left Parenthesis = FCDotCDC1604DashP6.TAG_ROUND_LEFT - // SL680000 = Right Parenthesis = FCDotCDC1604DashP6.TAG_ROUND_RIGHT - // SL700000 = Query = FCDotCDC1604DashP6._QUESTION - // SL770000 = Left Bracket = FCDotCDC1604DashP6.TAG_SQUARE_LEFT - // SL780000 = Right Bracket = FCDotCDC1604DashP6.TAG_SQUARE_RIGHT - // SL800000 = Semicolon = FCDotCDC1604DashP6._SEMICOLON - // SL830000 = Colon = FCDotCDC1604DashP6._COLON - // SL840000 = Dot = FCDotCDC1604DashP6._DOT - // SL850000 = Comma = FCDotCDC1604DashP6._COMMA - - - - ; - private final int codePoint; - - private FCDotAPL(int codePoint) { - this.codePoint = codePoint; - } - - public int codePoint() { - return codePoint; - } -}