aboutsummaryrefslogtreecommitdiffstats
path: root/source/core.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/core.hpp')
-rw-r--r--source/core.hpp36
1 files changed, 21 insertions, 15 deletions
diff --git a/source/core.hpp b/source/core.hpp
index a134804..d85cccc 100644
--- a/source/core.hpp
+++ b/source/core.hpp
@@ -20,29 +20,35 @@
#include "types.hpp"
+/**
+ * To be implemented by the user: Adds available input to the source buffer.
+ * @see addkey(int k)
+ */
extern void getinput();
+/**
+ * "Function exit" word, analagous to a function's return statement.
+ */
constexpr auto fexit = WordWrap<[] {
extern FuncList IP;
extern Cell *RP;
IP = reinterpret_cast<FuncList>(*RP--);
}>();
-void jump(FuncList ip);
-void jumper();
-void compileliteral();
-
-bool haskey();
-void addkey(int k);
-
-int key();
-Cell *comma(Cell n);
-Addr aligned(Addr addr);
-void align();
-void word();
-void colon();
-void semic();
-void tick();
+void jump(FuncList ip); /** Jumps to the given instruction pointer. */
+void compileliteral(); /** Compiles LITERAL into the current definition. */
+
+bool haskey(); /** Returns true if the source buffer is not empty. */
+void addkey(int k); /** Adds the given character to the source buffer. */
+int key(); /** Gets the next key available from the source buffer. */
+
+Cell *comma(Cell n); /** Stores `n` to HERE++, returns `n`'s storage. */
+Addr aligned(Addr addr); /** Aligns the given address and returns it. */
+void align(); /** Aligns HERE to the next Cell boundary. */
+void word(); /** Gets word from source buffer, stores and allots from HERE. */
+void colon(); /** Begins definition of a new word. */
+void semic(); /** Ends the current word definition which becomes new LATEST. */
+void tick(); /** Gets the execution token for the source buffer's next word. */
#endif // CORE_HPP