From 42b0f90931974ee084a525de7a1789819df44da5 Mon Sep 17 00:00:00 2001
From: Rob Greene <robgreene@gmail.com>
Date: Tue, 8 May 2018 20:25:09 -0500
Subject: [PATCH] Adding comments.

---
 .../sf/applecommander/bastokenizer/ApplesoftKeyword.java   | 1 +
 .../main/java/net/sf/applecommander/bastokenizer/Line.java | 1 +
 .../main/java/net/sf/applecommander/bastokenizer/Main.java | 1 +
 .../java/net/sf/applecommander/bastokenizer/Parser.java    | 4 ++++
 .../java/net/sf/applecommander/bastokenizer/Program.java   | 1 +
 .../java/net/sf/applecommander/bastokenizer/Statement.java | 1 +
 .../java/net/sf/applecommander/bastokenizer/Token.java     | 5 +++++
 .../net/sf/applecommander/bastokenizer/TokenReader.java    | 7 +++++++
 8 files changed, 21 insertions(+)

diff --git a/bastokenizer/src/main/java/net/sf/applecommander/bastokenizer/ApplesoftKeyword.java b/bastokenizer/src/main/java/net/sf/applecommander/bastokenizer/ApplesoftKeyword.java
index 49d6029..297a7f0 100644
--- a/bastokenizer/src/main/java/net/sf/applecommander/bastokenizer/ApplesoftKeyword.java
+++ b/bastokenizer/src/main/java/net/sf/applecommander/bastokenizer/ApplesoftKeyword.java
@@ -10,6 +10,7 @@ import java.util.List;
 import java.util.Objects;
 import java.util.Optional;
 
+/** All elements of AppleSoft that are tokenized in some manner.  "Keyword" was picked as it is not the word token. ;-) */
 public enum ApplesoftKeyword {
     END(0x80, "END"), 
     FOR(0x81, "FOR"), 
diff --git a/bastokenizer/src/main/java/net/sf/applecommander/bastokenizer/Line.java b/bastokenizer/src/main/java/net/sf/applecommander/bastokenizer/Line.java
index 02b7895..39f6806 100644
--- a/bastokenizer/src/main/java/net/sf/applecommander/bastokenizer/Line.java
+++ b/bastokenizer/src/main/java/net/sf/applecommander/bastokenizer/Line.java
@@ -6,6 +6,7 @@ import java.io.PrintStream;
 import java.util.ArrayList;
 import java.util.List;
 
+/** An AppleSoft BASIC Line representation. */
 public class Line {
 	public final int lineNumber;
 	public final List<Statement> statements = new ArrayList<>();
diff --git a/bastokenizer/src/main/java/net/sf/applecommander/bastokenizer/Main.java b/bastokenizer/src/main/java/net/sf/applecommander/bastokenizer/Main.java
index 4ad0da3..ef16fcc 100644
--- a/bastokenizer/src/main/java/net/sf/applecommander/bastokenizer/Main.java
+++ b/bastokenizer/src/main/java/net/sf/applecommander/bastokenizer/Main.java
@@ -4,6 +4,7 @@ import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.util.Queue;
 
+/** A simple driver for the tokenizer for a sample and rudimentary test. */
 public class Main {
 	public static void main(String[] args) throws FileNotFoundException, IOException {
 		if (args.length != 1) {
diff --git a/bastokenizer/src/main/java/net/sf/applecommander/bastokenizer/Parser.java b/bastokenizer/src/main/java/net/sf/applecommander/bastokenizer/Parser.java
index 3c7f4ac..66e8249 100644
--- a/bastokenizer/src/main/java/net/sf/applecommander/bastokenizer/Parser.java
+++ b/bastokenizer/src/main/java/net/sf/applecommander/bastokenizer/Parser.java
@@ -5,6 +5,10 @@ import java.util.Queue;
 
 import net.sf.applecommander.bastokenizer.Token.Type;
 
+/** 
+ * The Parser will read a series of Tokens and build a Program.
+ * Note that this is not a compiler and does not "understand" the program. 
+ */
 public class Parser {
 	private final Queue<Token> tokens;
 	
diff --git a/bastokenizer/src/main/java/net/sf/applecommander/bastokenizer/Program.java b/bastokenizer/src/main/java/net/sf/applecommander/bastokenizer/Program.java
index 445b3be..37c2681 100644
--- a/bastokenizer/src/main/java/net/sf/applecommander/bastokenizer/Program.java
+++ b/bastokenizer/src/main/java/net/sf/applecommander/bastokenizer/Program.java
@@ -6,6 +6,7 @@ import java.io.PrintStream;
 import java.util.ArrayList;
 import java.util.List;
 
+/** A Program is a series of lines. */
 public class Program {
 	public final List<Line> lines = new ArrayList<>();
 	
diff --git a/bastokenizer/src/main/java/net/sf/applecommander/bastokenizer/Statement.java b/bastokenizer/src/main/java/net/sf/applecommander/bastokenizer/Statement.java
index 04eed46..24c48bd 100644
--- a/bastokenizer/src/main/java/net/sf/applecommander/bastokenizer/Statement.java
+++ b/bastokenizer/src/main/java/net/sf/applecommander/bastokenizer/Statement.java
@@ -6,6 +6,7 @@ import java.io.PrintStream;
 import java.util.ArrayList;
 import java.util.List;
 
+/** A Statement is simply a series of Tokens. */
 public class Statement {
 	public final List<Token> tokens = new ArrayList<>();
 	
diff --git a/bastokenizer/src/main/java/net/sf/applecommander/bastokenizer/Token.java b/bastokenizer/src/main/java/net/sf/applecommander/bastokenizer/Token.java
index bc912f6..6a0f0a8 100644
--- a/bastokenizer/src/main/java/net/sf/applecommander/bastokenizer/Token.java
+++ b/bastokenizer/src/main/java/net/sf/applecommander/bastokenizer/Token.java
@@ -5,6 +5,11 @@ import java.io.IOException;
 import java.io.PrintStream;
 import java.util.Optional;
 
+/**
+ * A Token in the classic compiler sense, in that this represents a component of the application.
+ * 
+ * @author rob
+ */
 public class Token {
 	public final int line;
 	public final Type type;
diff --git a/bastokenizer/src/main/java/net/sf/applecommander/bastokenizer/TokenReader.java b/bastokenizer/src/main/java/net/sf/applecommander/bastokenizer/TokenReader.java
index 8c78e38..0157ea3 100644
--- a/bastokenizer/src/main/java/net/sf/applecommander/bastokenizer/TokenReader.java
+++ b/bastokenizer/src/main/java/net/sf/applecommander/bastokenizer/TokenReader.java
@@ -9,6 +9,12 @@ import java.util.LinkedList;
 import java.util.Optional;
 import java.util.Queue;
 
+/**
+ * The TokenReader, given a text file, generates a series of Tokens (in the compiler sense, 
+ * not AppleSoft) for the AppleSoft program.
+ *  
+ * @author rob
+ */
 public class TokenReader {
 	private boolean hasMore = true;
 	// Internal flag just in case we consume the EOL (see REM for instance)s
@@ -16,6 +22,7 @@ public class TokenReader {
 	private Reader reader;
 	private StreamTokenizer tokenizer;
 
+	/** A handy method to generate a list of Tokens from a file. */
 	public static Queue<Token> tokenize(String filename) throws FileNotFoundException, IOException {
 		try (FileReader fileReader = new FileReader(filename)) {
 			TokenReader tokenReader = new TokenReader(fileReader);