use ApplesoftConstants as interface

This commit is contained in:
Denis Molony 2021-01-08 17:52:47 +10:00
parent dbeedff1a2
commit e7554f7856
3 changed files with 5 additions and 40 deletions

View File

@ -1,18 +1,5 @@
package com.bytezone.diskbrowser.applefile;
import static com.bytezone.diskbrowser.applefile.ApplesoftConstants.TOKEN_DATA;
import static com.bytezone.diskbrowser.applefile.ApplesoftConstants.TOKEN_DIM;
import static com.bytezone.diskbrowser.applefile.ApplesoftConstants.TOKEN_FOR;
import static com.bytezone.diskbrowser.applefile.ApplesoftConstants.TOKEN_GOSUB;
import static com.bytezone.diskbrowser.applefile.ApplesoftConstants.TOKEN_GOTO;
import static com.bytezone.diskbrowser.applefile.ApplesoftConstants.TOKEN_IF;
import static com.bytezone.diskbrowser.applefile.ApplesoftConstants.TOKEN_INPUT;
import static com.bytezone.diskbrowser.applefile.ApplesoftConstants.TOKEN_NEXT;
import static com.bytezone.diskbrowser.applefile.ApplesoftConstants.TOKEN_ON;
import static com.bytezone.diskbrowser.applefile.ApplesoftConstants.TOKEN_PRINT;
import static com.bytezone.diskbrowser.applefile.ApplesoftConstants.TOKEN_REM;
import static com.bytezone.diskbrowser.applefile.ApplesoftConstants.TOKEN_RETURN;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@ -25,7 +12,7 @@ import com.bytezone.diskbrowser.utilities.HexFormatter;
import com.bytezone.diskbrowser.utilities.Utility;
// -----------------------------------------------------------------------------------//
public class ApplesoftBasicProgram extends BasicProgram
public class ApplesoftBasicProgram extends BasicProgram implements ApplesoftConstants
// -----------------------------------------------------------------------------------//
{
static final String underline = "----------------------------------------------------"

View File

@ -1,16 +1,12 @@
package com.bytezone.diskbrowser.applefile;
import static com.bytezone.diskbrowser.applefile.ApplesoftConstants.TOKEN_GOTO;
import static com.bytezone.diskbrowser.applefile.ApplesoftConstants.TOKEN_REM;
import static com.bytezone.diskbrowser.applefile.ApplesoftConstants.TOKEN_THEN;
import java.util.ArrayList;
import java.util.List;
import com.bytezone.diskbrowser.utilities.Utility;
// -----------------------------------------------------------------------------------//
public class SourceLine
public class SourceLine implements ApplesoftConstants
// -----------------------------------------------------------------------------------//
{
ApplesoftBasicProgram parent;

View File

@ -1,32 +1,17 @@
package com.bytezone.diskbrowser.applefile;
import static com.bytezone.diskbrowser.applefile.ApplesoftConstants.TOKEN_CALL;
import static com.bytezone.diskbrowser.applefile.ApplesoftConstants.TOKEN_DATA;
import static com.bytezone.diskbrowser.applefile.ApplesoftConstants.TOKEN_DEF;
import static com.bytezone.diskbrowser.applefile.ApplesoftConstants.TOKEN_EQUALS;
import static com.bytezone.diskbrowser.applefile.ApplesoftConstants.TOKEN_FN;
import static com.bytezone.diskbrowser.applefile.ApplesoftConstants.TOKEN_FOR;
import static com.bytezone.diskbrowser.applefile.ApplesoftConstants.TOKEN_GOSUB;
import static com.bytezone.diskbrowser.applefile.ApplesoftConstants.TOKEN_GOTO;
import static com.bytezone.diskbrowser.applefile.ApplesoftConstants.TOKEN_LET;
import static com.bytezone.diskbrowser.applefile.ApplesoftConstants.TOKEN_MINUS;
import static com.bytezone.diskbrowser.applefile.ApplesoftConstants.TOKEN_NEXT;
import static com.bytezone.diskbrowser.applefile.ApplesoftConstants.TOKEN_ON;
import static com.bytezone.diskbrowser.applefile.ApplesoftConstants.TOKEN_ONERR;
import static com.bytezone.diskbrowser.applefile.ApplesoftConstants.TOKEN_REM;
import static com.bytezone.diskbrowser.applefile.ApplesoftConstants.TOKEN_THEN;
import java.util.ArrayList;
import java.util.List;
import com.bytezone.diskbrowser.utilities.Utility;;
// -----------------------------------------------------------------------------------//
public class SubLine
public class SubLine implements ApplesoftConstants
// -----------------------------------------------------------------------------------//
{
SourceLine parent;
byte[] buffer;
int startPtr;
int length;
@ -39,7 +24,6 @@ public class SubLine
String functionName;
String callTarget;
byte[] buffer;
private final List<Integer> gotoLines = new ArrayList<> ();
private final List<Integer> gosubLines = new ArrayList<> ();
@ -171,10 +155,8 @@ public class SubLine
{
if (!arrays.contains (var))
arrays.add (var);
return;
}
if (!symbols.contains (var))
else if (!symbols.contains (var))
symbols.add (var);
}