From ee6a9305a1009e6f1e3e99d5de3cfba5305a5d1b Mon Sep 17 00:00:00 2001 From: Ben Culkin Date: Sat, 13 Mar 2021 10:13:01 -0500 Subject: Update documentation Also, did the same thing for Die I did for DiePool, where I moved the specific classes to the same file as the interface. --- .../java/bjc/dicelang/neodice/commands/HelpCommand.java | 5 +++++ .../bjc/dicelang/neodice/commands/LiteralCommand.java | 16 ++++++++++++++++ .../dicelang/neodice/commands/PolyhedralDieCommand.java | 6 ++++++ .../java/bjc/dicelang/neodice/commands/RollCommand.java | 6 ++++++ .../dicelang/neodice/commands/ShowBindingsCommand.java | 6 ++++++ .../neodice/statements/IntegerStatementValue.java | 12 +++++++++++- .../dicelang/neodice/statements/VoidStatementValue.java | 4 +++- 7 files changed, 53 insertions(+), 2 deletions(-) (limited to 'dice/src/example/java/bjc/dicelang') diff --git a/dice/src/example/java/bjc/dicelang/neodice/commands/HelpCommand.java b/dice/src/example/java/bjc/dicelang/neodice/commands/HelpCommand.java index 705745e..c10db4e 100644 --- a/dice/src/example/java/bjc/dicelang/neodice/commands/HelpCommand.java +++ b/dice/src/example/java/bjc/dicelang/neodice/commands/HelpCommand.java @@ -7,6 +7,11 @@ import java.util.*; import bjc.dicelang.neodice.*; import bjc.dicelang.neodice.statements.*; +/** + * Diebox help command. Unimplemented as of yet. + * @author Ben Culkin + * + */ public class HelpCommand implements Command { @Override public StatementValue execute(Iterator words, DieBoxCLI state) { diff --git a/dice/src/example/java/bjc/dicelang/neodice/commands/LiteralCommand.java b/dice/src/example/java/bjc/dicelang/neodice/commands/LiteralCommand.java index 9b42b42..b781ae9 100644 --- a/dice/src/example/java/bjc/dicelang/neodice/commands/LiteralCommand.java +++ b/dice/src/example/java/bjc/dicelang/neodice/commands/LiteralCommand.java @@ -5,12 +5,28 @@ import java.util.*; import bjc.dicelang.neodice.*; import bjc.dicelang.neodice.statements.*; +/** + * A command that produces a literal statement value. + * + * This command will always produce the same statement value, so passing any sort + * of mutable statement value to it is asking to be hurt. + * + * @author Ben Culkin + * + */ public class LiteralCommand implements Command { private final StatementValue value; private final String shortHelp; private final String longHelp; + /** + * Create a new command producing a literal statement value. + * + * @param value The value this command returns. + * @param shortHelp The short-help (summary) for this command. + * @param longHelp The long-help (description) for this command. + */ public LiteralCommand(StatementValue value, String shortHelp, String longHelp) { this.value = value; diff --git a/dice/src/example/java/bjc/dicelang/neodice/commands/PolyhedralDieCommand.java b/dice/src/example/java/bjc/dicelang/neodice/commands/PolyhedralDieCommand.java index aad2a24..e0f66b1 100644 --- a/dice/src/example/java/bjc/dicelang/neodice/commands/PolyhedralDieCommand.java +++ b/dice/src/example/java/bjc/dicelang/neodice/commands/PolyhedralDieCommand.java @@ -7,6 +7,12 @@ import java.util.*; import bjc.dicelang.neodice.*; import bjc.dicelang.neodice.statements.*; +/** + * A command that produces a polyhedral die. + * + * @author Ben Culkin + * + */ public class PolyhedralDieCommand implements Command { @Override public StatementValue execute(Iterator words, DieBoxCLI state) { diff --git a/dice/src/example/java/bjc/dicelang/neodice/commands/RollCommand.java b/dice/src/example/java/bjc/dicelang/neodice/commands/RollCommand.java index eb8beda..cec7c48 100644 --- a/dice/src/example/java/bjc/dicelang/neodice/commands/RollCommand.java +++ b/dice/src/example/java/bjc/dicelang/neodice/commands/RollCommand.java @@ -7,6 +7,12 @@ import java.util.*; import bjc.dicelang.neodice.*; import bjc.dicelang.neodice.statements.*; +/** + * A command that rolls a die or die-pool. + * + * @author Ben Culkin + * + */ public class RollCommand implements Command { @Override public StatementValue execute(Iterator words, DieBoxCLI state) { diff --git a/dice/src/example/java/bjc/dicelang/neodice/commands/ShowBindingsCommand.java b/dice/src/example/java/bjc/dicelang/neodice/commands/ShowBindingsCommand.java index fe2ac89..75811b6 100644 --- a/dice/src/example/java/bjc/dicelang/neodice/commands/ShowBindingsCommand.java +++ b/dice/src/example/java/bjc/dicelang/neodice/commands/ShowBindingsCommand.java @@ -7,6 +7,12 @@ import java.util.*; import bjc.dicelang.neodice.*; import bjc.dicelang.neodice.statements.*; +/** + * A command that shows all of the currently bound variables. + * + * @author Ben Culkin + * + */ public class ShowBindingsCommand implements Command { @Override public StatementValue execute(Iterator words, DieBoxCLI state) { diff --git a/dice/src/example/java/bjc/dicelang/neodice/statements/IntegerStatementValue.java b/dice/src/example/java/bjc/dicelang/neodice/statements/IntegerStatementValue.java index 91e45b6..88508d2 100644 --- a/dice/src/example/java/bjc/dicelang/neodice/statements/IntegerStatementValue.java +++ b/dice/src/example/java/bjc/dicelang/neodice/statements/IntegerStatementValue.java @@ -2,9 +2,19 @@ package bjc.dicelang.neodice.statements; import static bjc.dicelang.neodice.statements.StatementValue.Type.*; +/** + * Statement value that represents an integer. + * @author Ben Culkin + * + */ public class IntegerStatementValue extends StatementValue { - public final int value; + /** The integer value. */ + public final int value; + /** + * Create an integer statement value. + * @param value The int to use as the value. + */ public IntegerStatementValue(int value) { super(INTEGER); diff --git a/dice/src/example/java/bjc/dicelang/neodice/statements/VoidStatementValue.java b/dice/src/example/java/bjc/dicelang/neodice/statements/VoidStatementValue.java index 7e437e7..a71d49c 100644 --- a/dice/src/example/java/bjc/dicelang/neodice/statements/VoidStatementValue.java +++ b/dice/src/example/java/bjc/dicelang/neodice/statements/VoidStatementValue.java @@ -3,11 +3,13 @@ package bjc.dicelang.neodice.statements; import static bjc.dicelang.neodice.statements.StatementValue.Type.*; /** + * The statement value of the null type. * @author Ben Culkin * */ public class VoidStatementValue extends StatementValue { - public static final VoidStatementValue VOID_INST = new VoidStatementValue(); + /** The singular instance of the null value. */ + public static final VoidStatementValue VOID_INST = new VoidStatementValue(); private VoidStatementValue() { super(VOID); -- cgit v1.2.3