From f28544ec25ceee5fe2b783f1980cdf19caf0e977 Mon Sep 17 00:00:00 2001 From: Peter Mikkelsen Date: Sat, 22 Jan 2022 20:34:21 +0000 Subject: Implement fgh and gh trains --- apl9.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'apl9.h') diff --git a/apl9.h b/apl9.h index 8be337c..78b5c11 100644 --- a/apl9.h +++ b/apl9.h @@ -39,6 +39,7 @@ typedef enum FunctypeOp, FunctypeQuad, FunctypeHybrid, + FunctypeTrain, } functionType; typedef enum @@ -59,6 +60,7 @@ typedef enum typedef struct Array Array; typedef struct Statement Statement; typedef struct Operator Operator; +typedef struct FunctionTrain FunctionTrain; typedef struct Function Function; typedef struct Datum Datum; typedef struct Symbol Symbol; @@ -103,6 +105,12 @@ struct Operator Datum *right; }; +struct FunctionTrain +{ + int nfuncs; + Function *funcs; +}; + struct Function { functionType type; @@ -111,6 +119,7 @@ struct Function Rune *dfn; Operator operator; QuadnameDef *quad; + FunctionTrain train; }; Array *left; }; @@ -179,6 +188,7 @@ Rune *ppdatum(Datum); Rune *ppdatums(Datum *, int); Rune *pparray(Array *); Rune *ppoperator(Operator); +Rune *ppfunction(Function); /* lexer.c */ Statement *lexline(Rune *, int); @@ -219,6 +229,7 @@ void incref(Array *); /* functions.c */ Array *runfunc(Function, Array *,Array *); Array *rundfn(Rune *, Array *, Array *); +Array *runtrain(Function *, int, Array *, Array *, Array *); /* quadnames.c */ Datum quadnamedatum(QuadnameDef); -- cgit v1.2.3