Renaming project from bastokenizer to bastools to capture the ... expansion of its capabilities!

This commit is contained in:
Rob Greene 2018-06-12 19:39:33 -05:00
parent 68709f8ca1
commit 88ce03e970
45 changed files with 202 additions and 197 deletions

View File

@ -631,7 +631,7 @@ to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found. the "copyright" line and a pointer to where the full notice is found.
bastokenizer bastools
Copyright (C) 2018 Rob Greene Copyright (C) 2018 Rob Greene
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode: notice like this when it starts in an interactive mode:
bastokenizer Copyright (C) 2018 Rob Greene bastools Copyright (C) 2018 Rob Greene
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details. under certain conditions; type `show c' for details.

View File

@ -9,8 +9,8 @@ To include in a Maven project:
```xml ```xml
<dependency> <dependency>
<groupId>net.sf.applecommander</groupId> <groupId>net.sf.applecommander</groupId>
<artifactId>bastokenizer-api</artifactId> <artifactId>bastools-api</artifactId>
<version>0.2.0</version> <version>0.3.0</version>
</dependency> </dependency>
``` ```
@ -19,7 +19,7 @@ To include in a Gradle project:
``` ```
dependencies { dependencies {
// ... // ...
compile "net.sf.applecommander:bastokenizer-api:0.2.0" compile "net.sf.applecommander:bastools-api:0.2.0"
// ... // ...
} }
``` ```

View File

@ -13,7 +13,7 @@ dependencies {
jar { jar {
manifest { manifest {
attributes( attributes(
'Implementation-Title': 'B/BAS Tokenizer', 'Implementation-Title': 'B/BAS Tools API',
'Implementation-Version': "${version} (${new Date().format('yyyy-MM-dd HH:mm')})" 'Implementation-Version': "${version} (${new Date().format('yyyy-MM-dd HH:mm')})"
) )
} }
@ -55,11 +55,11 @@ uploadArchives {
pom.project { pom.project {
name archivesBaseName name archivesBaseName
packaging 'jar' packaging 'jar'
description 'Experiments with generating an AppleSoft B/BAS tokenized "binary".' description 'An Applesoft BASIC tools library.'
url 'https://applecommander.github.io/' url 'https://applecommander.github.io/'
scm { scm {
url 'https://github.com/AppleCommander/bastokenizer' url 'https://github.com/AppleCommander/bastools'
} }
licenses { licenses {

View File

@ -1,14 +0,0 @@
package io.github.applecommander.bastokenizer.api;
/**
* Since there are many pieces to bastokenizer, the version information is just a small,
* dedicated class.
*/
public class BasTokenizer {
public static final String VERSION;
static {
VERSION = BasTokenizer.class.getPackage().getImplementationVersion();
}
private BasTokenizer() {}
}

View File

@ -0,0 +1,16 @@
package io.github.applecommander.bastools.api;
/**
* Since there are many pieces to bastools, the version information is just a small,
* dedicated class.
*/
public class BasTools {
public static final String VERSION;
public static final String TITLE;
static {
TITLE = BasTools.class.getPackage().getImplementationTitle();
VERSION = BasTools.class.getPackage().getImplementationVersion();
}
private BasTools() {}
}

View File

@ -1,4 +1,4 @@
package io.github.applecommander.bastokenizer.api; package io.github.applecommander.bastools.api;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;

View File

@ -1,4 +1,4 @@
package io.github.applecommander.bastokenizer.api; package io.github.applecommander.bastools.api;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
@ -6,10 +6,10 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
import io.github.applecommander.bastokenizer.api.model.Line; import io.github.applecommander.bastools.api.model.Line;
import io.github.applecommander.bastokenizer.api.model.Token; import io.github.applecommander.bastools.api.model.Token;
import io.github.applecommander.bastokenizer.api.model.Token.Type; import io.github.applecommander.bastools.api.model.Token.Type;
import io.github.applecommander.bastokenizer.api.utils.Converters; import io.github.applecommander.bastools.api.utils.Converters;
public abstract class Directive { public abstract class Directive {
protected Configuration config; protected Configuration config;

View File

@ -1,12 +1,12 @@
package io.github.applecommander.bastokenizer.api; package io.github.applecommander.bastools.api;
import java.io.OutputStream; import java.io.OutputStream;
import java.lang.reflect.Constructor; import java.lang.reflect.Constructor;
import java.util.Map; import java.util.Map;
import java.util.TreeMap; import java.util.TreeMap;
import io.github.applecommander.bastokenizer.api.directives.EmbeddedBinaryDirective; import io.github.applecommander.bastools.api.directives.EmbeddedBinaryDirective;
import io.github.applecommander.bastokenizer.api.directives.HexDirective; import io.github.applecommander.bastools.api.directives.HexDirective;
public class Directives { public class Directives {
private Directives() { /* Prevent construction. */ } private Directives() { /* Prevent construction. */ }

View File

@ -1,12 +1,12 @@
package io.github.applecommander.bastokenizer.api; package io.github.applecommander.bastools.api;
import java.util.function.Function; import java.util.function.Function;
import io.github.applecommander.bastokenizer.api.optimizations.ExtractConstantValues; import io.github.applecommander.bastools.api.optimizations.ExtractConstantValues;
import io.github.applecommander.bastokenizer.api.optimizations.MergeLines; import io.github.applecommander.bastools.api.optimizations.MergeLines;
import io.github.applecommander.bastokenizer.api.optimizations.RemoveEmptyStatements; import io.github.applecommander.bastools.api.optimizations.RemoveEmptyStatements;
import io.github.applecommander.bastokenizer.api.optimizations.RemoveRemStatements; import io.github.applecommander.bastools.api.optimizations.RemoveRemStatements;
import io.github.applecommander.bastokenizer.api.optimizations.Renumber; import io.github.applecommander.bastools.api.optimizations.Renumber;
/** /**
* All optimization capabilities are definined here in the "best" manner of execution. * All optimization capabilities are definined here in the "best" manner of execution.

View File

@ -1,13 +1,13 @@
package io.github.applecommander.bastokenizer.api; package io.github.applecommander.bastools.api;
import java.util.Objects; import java.util.Objects;
import java.util.Queue; import java.util.Queue;
import io.github.applecommander.bastokenizer.api.model.Line; import io.github.applecommander.bastools.api.model.Line;
import io.github.applecommander.bastokenizer.api.model.Program; import io.github.applecommander.bastools.api.model.Program;
import io.github.applecommander.bastokenizer.api.model.Statement; import io.github.applecommander.bastools.api.model.Statement;
import io.github.applecommander.bastokenizer.api.model.Token; import io.github.applecommander.bastools.api.model.Token;
import io.github.applecommander.bastokenizer.api.model.Token.Type; import io.github.applecommander.bastools.api.model.Token.Type;
/** /**
* The Parser will read a series of Tokens and build a Program. * The Parser will read a series of Tokens and build a Program.

View File

@ -1,4 +1,4 @@
package io.github.applecommander.bastokenizer.api; package io.github.applecommander.bastools.api;
import java.io.File; import java.io.File;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
@ -12,8 +12,8 @@ import java.util.LinkedList;
import java.util.Optional; import java.util.Optional;
import java.util.Queue; import java.util.Queue;
import io.github.applecommander.bastokenizer.api.model.ApplesoftKeyword; import io.github.applecommander.bastools.api.model.ApplesoftKeyword;
import io.github.applecommander.bastokenizer.api.model.Token; import io.github.applecommander.bastools.api.model.Token;
/** /**
* The TokenReader, given a text file, generates a series of Tokens (in the compiler sense, * The TokenReader, given a text file, generates a series of Tokens (in the compiler sense,

View File

@ -1,9 +1,9 @@
package io.github.applecommander.bastokenizer.api; package io.github.applecommander.bastools.api;
import io.github.applecommander.bastokenizer.api.model.Line; import io.github.applecommander.bastools.api.model.Line;
import io.github.applecommander.bastokenizer.api.model.Program; import io.github.applecommander.bastools.api.model.Program;
import io.github.applecommander.bastokenizer.api.model.Statement; import io.github.applecommander.bastools.api.model.Statement;
import io.github.applecommander.bastokenizer.api.model.Token; import io.github.applecommander.bastools.api.model.Token;
/** /**
* The Visitor interface allows some flexibility in what can be done with the * The Visitor interface allows some flexibility in what can be done with the

View File

@ -1,17 +1,17 @@
package io.github.applecommander.bastokenizer.api; package io.github.applecommander.bastools.api;
import java.io.PrintStream; import java.io.PrintStream;
import java.util.Map; import java.util.Map;
import java.util.Objects; import java.util.Objects;
import java.util.function.Function; import java.util.function.Function;
import io.github.applecommander.bastokenizer.api.visitors.ByteVisitor; import io.github.applecommander.bastools.api.visitors.ByteVisitor;
import io.github.applecommander.bastokenizer.api.visitors.LineNumberTargetCollector; import io.github.applecommander.bastools.api.visitors.LineNumberTargetCollector;
import io.github.applecommander.bastokenizer.api.visitors.PrettyPrintVisitor; import io.github.applecommander.bastools.api.visitors.PrettyPrintVisitor;
import io.github.applecommander.bastokenizer.api.visitors.PrintVisitor; import io.github.applecommander.bastools.api.visitors.PrintVisitor;
import io.github.applecommander.bastokenizer.api.visitors.ReassignmentVisitor; import io.github.applecommander.bastools.api.visitors.ReassignmentVisitor;
import io.github.applecommander.bastokenizer.api.visitors.VariableCollectorVisitor; import io.github.applecommander.bastools.api.visitors.VariableCollectorVisitor;
import io.github.applecommander.bastokenizer.api.visitors.VariableReportVisitor; import io.github.applecommander.bastools.api.visitors.VariableReportVisitor;
/** /**
* This class presents all of the common Visitor implementations via builder patterns. * This class presents all of the common Visitor implementations via builder patterns.

View File

@ -1,4 +1,4 @@
package io.github.applecommander.bastokenizer.api.directives; package io.github.applecommander.bastools.api.directives;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.File; import java.io.File;
@ -7,10 +7,10 @@ import java.io.OutputStream;
import java.nio.file.Files; import java.nio.file.Files;
import java.util.Optional; import java.util.Optional;
import io.github.applecommander.bastokenizer.api.Configuration; import io.github.applecommander.bastools.api.Configuration;
import io.github.applecommander.bastokenizer.api.Directive; import io.github.applecommander.bastools.api.Directive;
import io.github.applecommander.bastokenizer.api.model.ApplesoftKeyword; import io.github.applecommander.bastools.api.model.ApplesoftKeyword;
import io.github.applecommander.bastokenizer.api.model.Line; import io.github.applecommander.bastools.api.model.Line;
public class EmbeddedBinaryDirective extends Directive { public class EmbeddedBinaryDirective extends Directive {
public EmbeddedBinaryDirective(Configuration config, OutputStream outputStream) { public EmbeddedBinaryDirective(Configuration config, OutputStream outputStream) {

View File

@ -1,12 +1,12 @@
package io.github.applecommander.bastokenizer.api.directives; package io.github.applecommander.bastools.api.directives;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
import io.github.applecommander.bastokenizer.api.Configuration; import io.github.applecommander.bastools.api.Configuration;
import io.github.applecommander.bastokenizer.api.Directive; import io.github.applecommander.bastools.api.Directive;
import io.github.applecommander.bastokenizer.api.model.ApplesoftKeyword; import io.github.applecommander.bastools.api.model.ApplesoftKeyword;
import io.github.applecommander.bastokenizer.api.model.Line; import io.github.applecommander.bastools.api.model.Line;
/** /**
* A simple directive to introduce hexidecimal capabilities. StreamTokenizer does not * A simple directive to introduce hexidecimal capabilities. StreamTokenizer does not

View File

@ -1,4 +1,4 @@
package io.github.applecommander.bastokenizer.api.model; package io.github.applecommander.bastools.api.model;
import java.io.IOException; import java.io.IOException;
import java.io.Reader; import java.io.Reader;

View File

@ -1,11 +1,11 @@
package io.github.applecommander.bastokenizer.api.model; package io.github.applecommander.bastools.api.model;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
import java.util.Optional; import java.util.Optional;
import io.github.applecommander.bastokenizer.api.Visitor; import io.github.applecommander.bastools.api.Visitor;
/** An AppleSoft BASIC Line representation. */ /** An AppleSoft BASIC Line representation. */
public class Line { public class Line {

View File

@ -1,9 +1,9 @@
package io.github.applecommander.bastokenizer.api.model; package io.github.applecommander.bastools.api.model;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import io.github.applecommander.bastokenizer.api.Visitor; import io.github.applecommander.bastools.api.Visitor;
/** A Program is a series of lines. */ /** A Program is a series of lines. */
public class Program { public class Program {

View File

@ -1,9 +1,9 @@
package io.github.applecommander.bastokenizer.api.model; package io.github.applecommander.bastools.api.model;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import io.github.applecommander.bastokenizer.api.Visitor; import io.github.applecommander.bastools.api.Visitor;
/** A Statement is simply a series of Tokens. */ /** A Statement is simply a series of Tokens. */
public class Statement { public class Statement {

View File

@ -1,6 +1,6 @@
package io.github.applecommander.bastokenizer.api.model; package io.github.applecommander.bastools.api.model;
import io.github.applecommander.bastokenizer.api.Visitor; import io.github.applecommander.bastools.api.Visitor;
/** /**
* A Token in the classic compiler sense, in that this represents a component of the application. * A Token in the classic compiler sense, in that this represents a component of the application.

View File

@ -1,14 +1,14 @@
package io.github.applecommander.bastokenizer.api.optimizations; package io.github.applecommander.bastools.api.optimizations;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import io.github.applecommander.bastokenizer.api.Visitor; import io.github.applecommander.bastools.api.Visitor;
import io.github.applecommander.bastokenizer.api.Visitors; import io.github.applecommander.bastools.api.Visitors;
import io.github.applecommander.bastokenizer.api.model.Line; import io.github.applecommander.bastools.api.model.Line;
import io.github.applecommander.bastokenizer.api.model.Program; import io.github.applecommander.bastools.api.model.Program;
import io.github.applecommander.bastokenizer.api.model.Statement; import io.github.applecommander.bastools.api.model.Statement;
import io.github.applecommander.bastokenizer.api.model.Token; import io.github.applecommander.bastools.api.model.Token;
/** /**
* Common base class for optimization visitors that allow the program tree to be rewritten. * Common base class for optimization visitors that allow the program tree to be rewritten.

View File

@ -1,4 +1,4 @@
package io.github.applecommander.bastokenizer.api.optimizations; package io.github.applecommander.bastools.api.optimizations;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
@ -7,15 +7,15 @@ import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.function.Function; import java.util.function.Function;
import io.github.applecommander.bastokenizer.api.Configuration; import io.github.applecommander.bastools.api.Configuration;
import io.github.applecommander.bastokenizer.api.Visitors; import io.github.applecommander.bastools.api.Visitors;
import io.github.applecommander.bastokenizer.api.model.ApplesoftKeyword; import io.github.applecommander.bastools.api.model.ApplesoftKeyword;
import io.github.applecommander.bastokenizer.api.model.Line; import io.github.applecommander.bastools.api.model.Line;
import io.github.applecommander.bastokenizer.api.model.Program; import io.github.applecommander.bastools.api.model.Program;
import io.github.applecommander.bastokenizer.api.model.Statement; import io.github.applecommander.bastools.api.model.Statement;
import io.github.applecommander.bastokenizer.api.model.Token; import io.github.applecommander.bastools.api.model.Token;
import io.github.applecommander.bastokenizer.api.utils.VariableNameGenerator; import io.github.applecommander.bastools.api.utils.VariableNameGenerator;
import io.github.applecommander.bastokenizer.api.visitors.VariableCollectorVisitor; import io.github.applecommander.bastools.api.visitors.VariableCollectorVisitor;
/** /**
* Find constants and extract to variables in order to have the number parsed only once. * Find constants and extract to variables in order to have the number parsed only once.

View File

@ -1,18 +1,18 @@
package io.github.applecommander.bastokenizer.api.optimizations; package io.github.applecommander.bastools.api.optimizations;
import java.io.PrintStream; import java.io.PrintStream;
import java.util.Set; import java.util.Set;
import io.github.applecommander.bastokenizer.api.Configuration; import io.github.applecommander.bastools.api.Configuration;
import io.github.applecommander.bastokenizer.api.Visitors; import io.github.applecommander.bastools.api.Visitors;
import io.github.applecommander.bastokenizer.api.model.ApplesoftKeyword; import io.github.applecommander.bastools.api.model.ApplesoftKeyword;
import io.github.applecommander.bastokenizer.api.model.Line; import io.github.applecommander.bastools.api.model.Line;
import io.github.applecommander.bastokenizer.api.model.Program; import io.github.applecommander.bastools.api.model.Program;
import io.github.applecommander.bastokenizer.api.model.Statement; import io.github.applecommander.bastools.api.model.Statement;
import io.github.applecommander.bastokenizer.api.model.Token; import io.github.applecommander.bastools.api.model.Token;
import io.github.applecommander.bastokenizer.api.model.Token.Type; import io.github.applecommander.bastools.api.model.Token.Type;
import io.github.applecommander.bastokenizer.api.visitors.ByteVisitor; import io.github.applecommander.bastools.api.visitors.ByteVisitor;
import io.github.applecommander.bastokenizer.api.visitors.LineNumberTargetCollector; import io.github.applecommander.bastools.api.visitors.LineNumberTargetCollector;
public class MergeLines extends BaseVisitor { public class MergeLines extends BaseVisitor {
private Set<Integer> targets; private Set<Integer> targets;

View File

@ -1,7 +1,7 @@
package io.github.applecommander.bastokenizer.api.optimizations; package io.github.applecommander.bastools.api.optimizations;
import io.github.applecommander.bastokenizer.api.Configuration; import io.github.applecommander.bastools.api.Configuration;
import io.github.applecommander.bastokenizer.api.model.Statement; import io.github.applecommander.bastools.api.model.Statement;
/** Remove any empty statements during the tree walk. Effective removes double "::"'s. */ /** Remove any empty statements during the tree walk. Effective removes double "::"'s. */
public class RemoveEmptyStatements extends BaseVisitor { public class RemoveEmptyStatements extends BaseVisitor {

View File

@ -1,8 +1,8 @@
package io.github.applecommander.bastokenizer.api.optimizations; package io.github.applecommander.bastools.api.optimizations;
import io.github.applecommander.bastokenizer.api.Configuration; import io.github.applecommander.bastools.api.Configuration;
import io.github.applecommander.bastokenizer.api.model.Statement; import io.github.applecommander.bastools.api.model.Statement;
import io.github.applecommander.bastokenizer.api.model.Token.Type; import io.github.applecommander.bastools.api.model.Token.Type;
/** Drop all REM statements as they are encountered in the tree walk. */ /** Drop all REM statements as they are encountered in the tree walk. */
public class RemoveRemStatements extends BaseVisitor { public class RemoveRemStatements extends BaseVisitor {

View File

@ -1,7 +1,7 @@
package io.github.applecommander.bastokenizer.api.optimizations; package io.github.applecommander.bastools.api.optimizations;
import io.github.applecommander.bastokenizer.api.Configuration; import io.github.applecommander.bastools.api.Configuration;
import io.github.applecommander.bastokenizer.api.model.Line; import io.github.applecommander.bastools.api.model.Line;
/** /**
* A simple renumbering algorithm that maps the reassignments and lets {@code BaseVisitor} * A simple renumbering algorithm that maps the reassignments and lets {@code BaseVisitor}

View File

@ -1,4 +1,4 @@
package io.github.applecommander.bastokenizer.api.utils; package io.github.applecommander.bastools.api.utils;
public class Converters { public class Converters {
private Converters() { /* Prevent construction */ } private Converters() { /* Prevent construction */ }

View File

@ -1,4 +1,4 @@
package io.github.applecommander.bastokenizer.api.utils; package io.github.applecommander.bastools.api.utils;
import java.util.Optional; import java.util.Optional;
import java.util.function.Supplier; import java.util.function.Supplier;

View File

@ -1,4 +1,4 @@
package io.github.applecommander.bastokenizer.api.visitors; package io.github.applecommander.bastools.api.visitors;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.IOException; import java.io.IOException;
@ -7,15 +7,15 @@ import java.util.Optional;
import java.util.Stack; import java.util.Stack;
import java.util.TreeMap; import java.util.TreeMap;
import io.github.applecommander.bastokenizer.api.Configuration; import io.github.applecommander.bastools.api.Configuration;
import io.github.applecommander.bastokenizer.api.Directive; import io.github.applecommander.bastools.api.Directive;
import io.github.applecommander.bastokenizer.api.Directives; import io.github.applecommander.bastools.api.Directives;
import io.github.applecommander.bastokenizer.api.Visitor; import io.github.applecommander.bastools.api.Visitor;
import io.github.applecommander.bastokenizer.api.model.ApplesoftKeyword; import io.github.applecommander.bastools.api.model.ApplesoftKeyword;
import io.github.applecommander.bastokenizer.api.model.Line; import io.github.applecommander.bastools.api.model.Line;
import io.github.applecommander.bastokenizer.api.model.Program; import io.github.applecommander.bastools.api.model.Program;
import io.github.applecommander.bastokenizer.api.model.Statement; import io.github.applecommander.bastools.api.model.Statement;
import io.github.applecommander.bastokenizer.api.model.Token; import io.github.applecommander.bastools.api.model.Token;
public class ByteVisitor implements Visitor { public class ByteVisitor implements Visitor {
private Stack<ByteArrayOutputStream> stack; private Stack<ByteArrayOutputStream> stack;

View File

@ -1,13 +1,13 @@
package io.github.applecommander.bastokenizer.api.visitors; package io.github.applecommander.bastools.api.visitors;
import java.util.Set; import java.util.Set;
import java.util.TreeSet; import java.util.TreeSet;
import io.github.applecommander.bastokenizer.api.Visitor; import io.github.applecommander.bastools.api.Visitor;
import io.github.applecommander.bastokenizer.api.model.ApplesoftKeyword; import io.github.applecommander.bastools.api.model.ApplesoftKeyword;
import io.github.applecommander.bastokenizer.api.model.Statement; import io.github.applecommander.bastools.api.model.Statement;
import io.github.applecommander.bastokenizer.api.model.Token; import io.github.applecommander.bastools.api.model.Token;
import io.github.applecommander.bastokenizer.api.model.Token.Type; import io.github.applecommander.bastools.api.model.Token.Type;
public class LineNumberTargetCollector implements Visitor { public class LineNumberTargetCollector implements Visitor {
private Set<Integer> targets = new TreeSet<>(); private Set<Integer> targets = new TreeSet<>();

View File

@ -1,12 +1,12 @@
package io.github.applecommander.bastokenizer.api.visitors; package io.github.applecommander.bastools.api.visitors;
import java.io.PrintStream; import java.io.PrintStream;
import io.github.applecommander.bastokenizer.api.Visitor; import io.github.applecommander.bastools.api.Visitor;
import io.github.applecommander.bastokenizer.api.Visitors.PrintBuilder; import io.github.applecommander.bastools.api.Visitors.PrintBuilder;
import io.github.applecommander.bastokenizer.api.model.Line; import io.github.applecommander.bastools.api.model.Line;
import io.github.applecommander.bastokenizer.api.model.Statement; import io.github.applecommander.bastools.api.model.Statement;
import io.github.applecommander.bastokenizer.api.model.Token; import io.github.applecommander.bastools.api.model.Token;
public class PrettyPrintVisitor implements Visitor { public class PrettyPrintVisitor implements Visitor {
private PrintStream printStream; private PrintStream printStream;

View File

@ -1,12 +1,12 @@
package io.github.applecommander.bastokenizer.api.visitors; package io.github.applecommander.bastools.api.visitors;
import java.io.PrintStream; import java.io.PrintStream;
import io.github.applecommander.bastokenizer.api.Visitor; import io.github.applecommander.bastools.api.Visitor;
import io.github.applecommander.bastokenizer.api.Visitors.PrintBuilder; import io.github.applecommander.bastools.api.Visitors.PrintBuilder;
import io.github.applecommander.bastokenizer.api.model.Line; import io.github.applecommander.bastools.api.model.Line;
import io.github.applecommander.bastokenizer.api.model.Statement; import io.github.applecommander.bastools.api.model.Statement;
import io.github.applecommander.bastokenizer.api.model.Token; import io.github.applecommander.bastools.api.model.Token;
public class PrintVisitor implements Visitor { public class PrintVisitor implements Visitor {
private PrintStream printStream; private PrintStream printStream;

View File

@ -1,14 +1,14 @@
package io.github.applecommander.bastokenizer.api.visitors; package io.github.applecommander.bastools.api.visitors;
import java.util.Map; import java.util.Map;
import io.github.applecommander.bastokenizer.api.Visitor; import io.github.applecommander.bastools.api.Visitor;
import io.github.applecommander.bastokenizer.api.model.ApplesoftKeyword; import io.github.applecommander.bastools.api.model.ApplesoftKeyword;
import io.github.applecommander.bastokenizer.api.model.Line; import io.github.applecommander.bastools.api.model.Line;
import io.github.applecommander.bastokenizer.api.model.Program; import io.github.applecommander.bastools.api.model.Program;
import io.github.applecommander.bastokenizer.api.model.Statement; import io.github.applecommander.bastools.api.model.Statement;
import io.github.applecommander.bastokenizer.api.model.Token; import io.github.applecommander.bastools.api.model.Token;
import io.github.applecommander.bastokenizer.api.model.Token.Type; import io.github.applecommander.bastools.api.model.Token.Type;
/** This is a mildly rewritable Visitor. */ /** This is a mildly rewritable Visitor. */
public class ReassignmentVisitor implements Visitor { public class ReassignmentVisitor implements Visitor {

View File

@ -1,11 +1,11 @@
package io.github.applecommander.bastokenizer.api.visitors; package io.github.applecommander.bastools.api.visitors;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
import io.github.applecommander.bastokenizer.api.Visitor; import io.github.applecommander.bastools.api.Visitor;
import io.github.applecommander.bastokenizer.api.model.Token; import io.github.applecommander.bastools.api.model.Token;
import io.github.applecommander.bastokenizer.api.model.Token.Type; import io.github.applecommander.bastools.api.model.Token.Type;
public class VariableCollectorVisitor implements Visitor { public class VariableCollectorVisitor implements Visitor {
private Set<String> variableNames = new HashSet<>(); private Set<String> variableNames = new HashSet<>();

View File

@ -1,4 +1,4 @@
package io.github.applecommander.bastokenizer.api.visitors; package io.github.applecommander.bastools.api.visitors;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
@ -6,11 +6,11 @@ import java.util.Map;
import java.util.SortedSet; import java.util.SortedSet;
import java.util.TreeSet; import java.util.TreeSet;
import io.github.applecommander.bastokenizer.api.Visitor; import io.github.applecommander.bastools.api.Visitor;
import io.github.applecommander.bastokenizer.api.model.Line; import io.github.applecommander.bastools.api.model.Line;
import io.github.applecommander.bastokenizer.api.model.Program; import io.github.applecommander.bastools.api.model.Program;
import io.github.applecommander.bastokenizer.api.model.Token; import io.github.applecommander.bastools.api.model.Token;
import io.github.applecommander.bastokenizer.api.model.Token.Type; import io.github.applecommander.bastools.api.model.Token.Type;
public class VariableReportVisitor implements Visitor { public class VariableReportVisitor implements Visitor {
private Map<String,SortedSet<Integer>> refs = new HashMap<>(); private Map<String,SortedSet<Integer>> refs = new HashMap<>();

View File

@ -1,4 +1,4 @@
package io.github.applecommander.bastokenizer.api.utils; package io.github.applecommander.bastools.api.utils;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
@ -7,6 +7,8 @@ import java.util.Map;
import org.junit.Test; import org.junit.Test;
import io.github.applecommander.bastools.api.utils.VariableNameGenerator;
public class VariableNameGeneratorTest { public class VariableNameGeneratorTest {
@Test @Test
public void testNameSequence() { public void testNameSequence() {

View File

@ -1,8 +1,8 @@
# Universal applesingle version number. Used for: # Universal bastools version number. Used for:
# - Naming JAR file. # - Naming JAR file.
# - The build will insert this into a file that is read at run time as well. # - The build will insert this into a file that is read at run time as well.
version=0.3.0 version=0.3.0
# Maven Central Repository G and A of GAV coordinate. :-) # Maven Central Repository G and A of GAV coordinate. :-)
group=net.sf.applecommander group=net.sf.applecommander
archivesBaseName=bastokenizer archivesBaseName=bastools

View File

@ -1,7 +1,7 @@
include 'api' include 'api'
include 'tools:bt' include 'tools:bt'
rootProject.name = 'bastokenizer' rootProject.name = 'bastools'
project(":api").name = 'bastokenizer-api' project(":api").name = 'bastools-api'
project(":tools").name = 'bastokenizer-tools' project(":tools").name = 'bastools-tools'
project(":tools:bt").name = 'bastokenizer-tools-bt' project(":tools:bt").name = 'bastools-tools-bt'

View File

@ -15,11 +15,11 @@ Options:
--addresses Dump line number addresses out. --addresses Dump line number addresses out.
--applesingle Write output in AppleSingle format --applesingle Write output in AppleSingle format
--debug Print debug output. --debug Print debug output.
--list List structure as bastokenizer understands it. --list List structure as bastools understands it.
--max-line-length=<maxLineLength> --max-line-length=<maxLineLength>
Maximum line length for generated lines. Maximum line length for generated lines.
Default: 255 Default: 255
--pretty Pretty print structure as bastokenizer understands it. --pretty Pretty print structure as bastools understands it.
--stdout Send binary output to stdout. --stdout Send binary output to stdout.
--tokens Dump token list to stdout for debugging. --tokens Dump token list to stdout for debugging.
--variables Generate a variable report --variables Generate a variable report

View File

@ -8,12 +8,12 @@ repositories {
apply plugin: 'application' apply plugin: 'application'
mainClassName = "io.github.applecommander.bastokenizer.tools.bt.Main" mainClassName = "io.github.applecommander.bastools.tools.bt.Main"
bootJar { bootJar {
manifest { manifest {
attributes( attributes(
'Implementation-Title': 'bastokenizer', 'Implementation-Title': 'BT CLI',
'Implementation-Version': "${version} (${new Date().format('yyyy-MM-dd HH:mm')})" 'Implementation-Version': "${version} (${new Date().format('yyyy-MM-dd HH:mm')})"
) )
} }
@ -22,5 +22,5 @@ bootJar {
dependencies { dependencies {
compile 'info.picocli:picocli:3.0.2' compile 'info.picocli:picocli:3.0.2'
compile 'net.sf.applecommander:applesingle-api:1.2.1' compile 'net.sf.applecommander:applesingle-api:1.2.1'
compile project(':bastokenizer-api') compile project(':bastools-api')
} }

View File

@ -1,4 +1,4 @@
package io.github.applecommander.bastokenizer.tools.bt; package io.github.applecommander.bastools.tools.bt;
import java.io.PrintStream; import java.io.PrintStream;
import java.util.Arrays; import java.util.Arrays;

View File

@ -1,6 +1,6 @@
package io.github.applecommander.bastokenizer.tools.bt; package io.github.applecommander.bastools.tools.bt;
import io.github.applecommander.bastokenizer.api.utils.Converters; import io.github.applecommander.bastools.api.utils.Converters;
import picocli.CommandLine.ITypeConverter; import picocli.CommandLine.ITypeConverter;
/** Add support for "$801" and "0x801" instead of just decimal like 2049. */ /** Add support for "$801" and "0x801" instead of just decimal like 2049. */

View File

@ -1,4 +1,4 @@
package io.github.applecommander.bastokenizer.tools.bt; package io.github.applecommander.bastools.tools.bt;
import java.io.File; import java.io.File;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
@ -14,15 +14,15 @@ import java.util.Queue;
import java.util.concurrent.Callable; import java.util.concurrent.Callable;
import io.github.applecommander.applesingle.AppleSingle; import io.github.applecommander.applesingle.AppleSingle;
import io.github.applecommander.bastokenizer.api.Configuration; import io.github.applecommander.bastools.api.Configuration;
import io.github.applecommander.bastokenizer.api.Optimization; import io.github.applecommander.bastools.api.Optimization;
import io.github.applecommander.bastokenizer.api.Parser; import io.github.applecommander.bastools.api.Parser;
import io.github.applecommander.bastokenizer.api.TokenReader; import io.github.applecommander.bastools.api.TokenReader;
import io.github.applecommander.bastokenizer.api.Visitors; import io.github.applecommander.bastools.api.Visitors;
import io.github.applecommander.bastokenizer.api.model.Program; import io.github.applecommander.bastools.api.model.Program;
import io.github.applecommander.bastokenizer.api.model.Token; import io.github.applecommander.bastools.api.model.Token;
import io.github.applecommander.bastokenizer.api.model.Token.Type; import io.github.applecommander.bastools.api.model.Token.Type;
import io.github.applecommander.bastokenizer.api.visitors.ByteVisitor; import io.github.applecommander.bastools.api.visitors.ByteVisitor;
import picocli.CommandLine; import picocli.CommandLine;
import picocli.CommandLine.Command; import picocli.CommandLine.Command;
import picocli.CommandLine.Help.Visibility; import picocli.CommandLine.Help.Visibility;
@ -60,10 +60,10 @@ public class Main implements Callable<Void> {
@Option(names = "--applesingle", description = "Write output in AppleSingle format") @Option(names = "--applesingle", description = "Write output in AppleSingle format")
private boolean applesingleFlag; private boolean applesingleFlag;
@Option(names = "--pretty", description = "Pretty print structure as bastokenizer understands it.") @Option(names = "--pretty", description = "Pretty print structure as bastools understands it.")
private boolean prettyPrint; private boolean prettyPrint;
@Option(names = "--list", description = "List structure as bastokenizer understands it.") @Option(names = "--list", description = "List structure as bastools understands it.")
private boolean listPrint; private boolean listPrint;
@Option(names = "--tokens", description = "Dump token list to stdout for debugging.") @Option(names = "--tokens", description = "Dump token list to stdout for debugging.")

View File

@ -1,6 +1,6 @@
package io.github.applecommander.bastokenizer.tools.bt; package io.github.applecommander.bastools.tools.bt;
import io.github.applecommander.bastokenizer.api.Optimization; import io.github.applecommander.bastools.api.Optimization;
import picocli.CommandLine.ITypeConverter; import picocli.CommandLine.ITypeConverter;
/** Add support for lower-case Optimization flags. */ /** Add support for lower-case Optimization flags. */

View File

@ -1,15 +1,16 @@
package io.github.applecommander.bastokenizer.tools.bt; package io.github.applecommander.bastools.tools.bt;
import io.github.applecommander.applesingle.AppleSingle; import io.github.applecommander.applesingle.AppleSingle;
import io.github.applecommander.bastokenizer.api.BasTokenizer; import io.github.applecommander.bastools.api.BasTools;
import picocli.CommandLine.IVersionProvider; import picocli.CommandLine.IVersionProvider;
/** Display version information. Note that this is dependent on Gradle configuration. */ /** Display version information. Note that this is dependent on Gradle configuration. */
public class VersionProvider implements IVersionProvider { public class VersionProvider implements IVersionProvider {
public String[] getVersion() { public String[] getVersion() {
return new String[] { return new String[] {
String.format("BT CLI: %s", Main.class.getPackage().getImplementationVersion()), String.format("%s: %s", Main.class.getPackage().getImplementationTitle(),
String.format("BT API: %s", BasTokenizer.VERSION), Main.class.getPackage().getImplementationVersion()),
String.format("%s: %s", BasTools.TITLE, BasTools.VERSION),
String.format("AppleSingle API: %s", AppleSingle.VERSION) String.format("AppleSingle API: %s", AppleSingle.VERSION)
}; };
} }