summaryrefslogtreecommitdiff
path: root/apl9.h
diff options
context:
space:
mode:
authorPeter Mikkelsen <petermikkelsen10@gmail.com>2022-01-15 22:46:56 +0000
committerPeter Mikkelsen <petermikkelsen10@gmail.com>2022-01-15 22:46:56 +0000
commitf02e90b27e37f91d4409842dd21cd00c999c805d (patch)
tree26117d12dadf2a15cc57bfc8b34c221ae0378dec /apl9.h
parentd464a1d3a62d620b6336131c355467bdc273e3c5 (diff)
Implement quad names for variables
Diffstat (limited to 'apl9.h')
-rw-r--r--apl9.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/apl9.h b/apl9.h
index 8eb570f..f65e8f7 100644
--- a/apl9.h
+++ b/apl9.h
@@ -46,7 +46,7 @@ typedef struct Function Function;
typedef struct Datum Datum;
typedef struct Symbol Symbol;
typedef struct Symtab Symtab;
-
+typedef struct QuadnameDef QuadnameDef;
struct Array
{
arrayDataType type;
@@ -110,11 +110,14 @@ struct Symbol
int undefined;
Rune *name;
Datum value;
+ Datum *(*getfn)(void);
+ int (*setfn)(Datum);
};
struct Symtab
{
int nsyms;
+ int io; /* index origin */
Symbol **syms;
};
@@ -123,9 +126,22 @@ typedef Array* (*fndyad)(Array*, Array*);
typedef Array* (*opmonad)(Datum *, Array *, Array *);
typedef Array* (*opdyad)(Datum *, Datum *, Array *, Array *);
+struct QuadnameDef
+{
+ Rune *name;
+ datumTag tag;
+ Datum *(*get)(void);
+ int (*set)(Datum);
+ fnmonad monadfn;
+ fnmonad dyadfn;
+ opmonad monadop;
+ opdyad dyadop;
+};
+
/* Function prototypes for the different source files */
/* main.c */
Datum *evalline(Rune *);
+Rune *prompt(Rune *);
/* print.c */
Rune *ppdatum(Datum);
@@ -166,6 +182,9 @@ void incref(Array *);
/* functions.c */
Array *runfunc(Function, Array *,Array *);
+/* quadnames.c */
+Datum quadnamedatum(QuadnameDef);
+
/* Monadic functions from function.c */
Array *fnSame(Array *);
Array *fnTally(Array *);
@@ -210,3 +229,4 @@ extern opdyad dyadoperatordefs[]; /* operators.c */
extern Symtab *globalsymtab; /* symbol.c */
extern Symtab *currentsymtab; /* symbol.c */
extern int alloccounts; /* memory.c */
+extern QuadnameDef quadnames[]; /* quadnames.c */