From d596e90554816e62d39fbaf68713810ed1eaf764 Mon Sep 17 00:00:00 2001 From: Peter Mikkelsen Date: Wed, 12 Jan 2022 18:46:55 +0000 Subject: =?UTF-8?q?Add=20statements=20separated=20by=20=E2=8B=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apl9.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'apl9.h') diff --git a/apl9.h b/apl9.h index 620eae6..f6c963c 100644 --- a/apl9.h +++ b/apl9.h @@ -29,7 +29,7 @@ typedef enum /* Data types */ typedef struct Array Array; -typedef struct Expr Expr; +typedef struct Statement Statement; typedef struct Function Function; typedef struct Datum Datum; typedef struct Symbol Symbol; @@ -49,17 +49,18 @@ struct Array }; }; -struct Expr +struct Statement { int ntoks; Datum *toks; + Statement *next; }; struct Function { union { int code; - Expr *dfn; + Statement *dfn; }; Array *left; }; @@ -69,7 +70,7 @@ struct Datum datumTag tag; union { Array *array; - Expr expr; + Statement stmt; Function func; Symbol *symbol; }; @@ -98,7 +99,7 @@ Rune *ppdatums(Datum *, int); Rune *pparray(Array *); /* lexer.c */ -Datum *lexline(Rune *, int *, Symtab *); +Statement *lexline(Rune *, Symtab *); /* array.c */ Array *mkarray(int, int, int); @@ -108,7 +109,7 @@ int simplearray(Array *); int simplescalar(Array *); /* eval.c */ -Datum *eval(Datum *, int *); +Datum *eval(Statement *); /* symbol.c */ Symbol *getsym(Symtab *, Rune *); -- cgit v1.2.3