Skip to content

Commit

Permalink
Update debug, docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Wodan58 committed Dec 12, 2023
1 parent f6edfb2 commit b34c078
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
joy.exe
joy.tar
CMakeCache.txt
CMakeFiles
Makefile
cmake_install.cmake
*.o
joy.*
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ See also
--------

Implementation|Dependencies
---|---
--------------|------------
[joy1](https://github.com/Wodan58/joy1)|[BDW garbage collector](https://github.com/ivmai/bdwgc)
[Moy](https://github.com/Wodan58/Moy)|[BDW garbage collector](https://github.com/ivmai/bdwgc) and [Lex & Yacc](https://sourceforge.net/projects/winflexbison/files/win_flex_bison-latest.zip)

Documentation
-------------

[Legacy Docs](https://wodan58.github.io)
9 changes: 6 additions & 3 deletions doc/JOYimplJOY.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
![](Wynn.PNG)
==============


Introduction
============

This presents a note about the technicalities of this Joy implementation. Most
of the remarks from joy1, the BDW version, also apply here.
This presents a note about the technicalities of this Joy implementation.
The remarks in
[joy1](https://github.com/Wodan58/joy1/blob/master/doc/JOYimplJOY.md),
the BDW version, also apply here.

Recent changes
==============

Both the memory area and the symbol table can grow when needed.
Symbol table, memory area, and tokenlist can grow when needed.

This repository is referred to from the wikipedia page about Joy. That page
contains this text: "Its library routines mirror those of ISO C, though the
Expand Down
14 changes: 7 additions & 7 deletions globals.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* FILE: globals.h */
/*
* module : globals.h
* version : 1.78
* date : 11/06/23
* version : 1.81
* date : 12/12/23
*/
#ifndef GLOBALS_H
#define GLOBALS_H
Expand Down Expand Up @@ -54,8 +54,8 @@
#define INIUNDEFERROR 0

/* installation dependent */
#define SETSIZE 64
#define MAXINT 9223372036854775807LL
#define SETSIZE (int)(CHAR_BIT * sizeof(uint64_t)) /* from limits.h */
#define MAXINT INT64_MAX /* from stdint.h */

/* symbols from getsym */
#define ILLEGAL_ 0
Expand Down Expand Up @@ -122,13 +122,13 @@ typedef void (*proc_t)(pEnv); /* procedure */

typedef union {
int64_t num; /* USR, BOOLEAN, CHAR, INTEGER */
proc_t proc; /* ANON_FUNCT */
uint64_t set; /* SET */
char *str; /* STRING */
Index lis; /* LIST */
double dbl; /* FLOAT */
FILE *fil; /* FILE */
Index lis; /* LIST */
pEntry ent; /* SYMBOL */
proc_t proc; /* ANON_FUNCT */
} Types;

typedef struct Node {
Expand Down Expand Up @@ -206,7 +206,7 @@ PUBLIC proc_t operproc(int o);
PUBLIC int operflags(int o);
PUBLIC int operindex(proc_t proc);
/* factor.c */
PUBLIC void readfactor(pEnv env) /* read a JOY factor */;
PUBLIC void readfactor(pEnv env); /* read a JOY factor */
PUBLIC void readterm(pEnv env);
PUBLIC void writefactor(pEnv env, Index n, FILE *fp);
PUBLIC void writeterm(pEnv env, Index n, FILE *fp);
Expand Down
8 changes: 4 additions & 4 deletions interp.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* FILE: interp.c */
/*
* module : interp.c
* version : 1.76
* date : 11/06/23
* version : 1.77
* date : 12/12/23
*/

/*
Expand Down Expand Up @@ -338,7 +338,7 @@ PUBLIC void exeterm(pEnv env, Index n)
#endif
#ifdef ENABLE_TRACEGC
if (env->tracegc > 5) {
printf("exeterm1: %d ", nodevalue(env->conts).lis);
printf("exeterm1: ");
printnode(env, nodevalue(env->conts).lis);
}
#endif
Expand Down Expand Up @@ -415,7 +415,7 @@ PUBLIC void exeterm(pEnv env, Index n)
}
#ifdef ENABLE_TRACEGC
if (env->tracegc > 5) {
printf("exeterm2: %d ", stepper);
printf("exeterm2: ");
printnode(env, stepper);
}
#endif
Expand Down
14 changes: 6 additions & 8 deletions utils.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* module : utils.c
* version : 1.24
* date : 09/12/23
* version : 1.25
* date : 12/12/23
*/
#include "globals.h"

Expand Down Expand Up @@ -85,12 +85,10 @@ PUBLIC void inimem2(pEnv env)
#ifdef ENABLE_TRACEGC
PUBLIC void printnode(pEnv env, Index p)
{
printf("%5d: %10s ", p, vec_at(env->symtab, nodetype(p)).name);
if (nodetype(p) == USR_)
printf("%10s", vec_at(env->symtab, nodevalue(p).num).name);
else
printf("%10" PRId64, nodevalue(p).num);
printf(" %5d\n", nextnode1(p));
printf("%d: ", p);
writefactor(env, p, stdout);
printf(" :%d\n", nextnode1(p));

}
#endif

Expand Down

0 comments on commit b34c078

Please sign in to comment.