From b94c7325d9b5c5b974d5bc13f2f8b52be74d0f90 Mon Sep 17 00:00:00 2001 From: Lars Brinkhoff Date: Wed, 24 Oct 2018 11:08:05 +0200 Subject: [PATCH] GT - generate tables for C compiler. - Rename YPRASE to C25, because that's what the STINKR script expects. - Rename the lextype variable to lextag, because that's what G1 expects. - Remove duplicate definition of STCMP; it's already in the C library. - No need to link in APFNAM; it's already in the C library. - Rewrite STINKR script for ITS. --- build/misc.tcl | 5 +++++ doc/programs.md | 1 + src/c/{yparse.c => c25.c} | 4 ++-- src/c/g1.c | 15 --------------- src/c/gt.stinkr | Bin 75 -> 83 bytes 5 files changed, 8 insertions(+), 17 deletions(-) rename src/c/{yparse.c => c25.c} (99%) diff --git a/build/misc.tcl b/build/misc.tcl index 3a8fd0cb..9177ffca 100644 --- a/build/misc.tcl +++ b/build/misc.tcl @@ -1153,6 +1153,11 @@ expect ":KILL" respond "*" ":stinkr cc\r" expect ":KILL" +# GT +respond "*" ":c;cc g0.c g1.c g2.c g3.c g4.c g5.c c25.c\r" +expect ":KILL" +respond "*" ":stinkr gt\r" + # TJ6 respond "*" ":midas sysbin;_tj6;tj6\r" expect ":KILL" diff --git a/doc/programs.md b/doc/programs.md index afe73afe..7e022549 100644 --- a/doc/programs.md +++ b/doc/programs.md @@ -101,6 +101,7 @@ - GETSYM, copy all symbols from running ITS to a file. - GLP/XGP, queue files to be printed by GLPSPL/XGPSPL. - GLPDEV/XGPDEV, device for viewing GLPSPL/XGPSPL printer queues. +- GT, generate tables for C compiler. - GTLEM, GT40 Lunar Lander. - GTLOAD, load programs into GT40. - GO, the Go board game. diff --git a/src/c/yparse.c b/src/c/c25.c similarity index 99% rename from src/c/yparse.c rename to src/c/c25.c index 50e5522b..7ad1df2d 100644 --- a/src/c/yparse.c +++ b/src/c/c25.c @@ -26,7 +26,7 @@ extern int cout; /* GLOBAL VARIABLES USED TO RECEIVE INFO FROM GETTOK */ -int lextype; /* indicates which terminal symbol read */ +int lextag; /* indicates which terminal symbol read */ int lexindex; /* used as translation element */ int lexline; /* line-number of line which token appears on */ @@ -498,7 +498,7 @@ rtoken(p) token *p; { gettok(); - p->type = lextype; + p->type = lextag; p->index = lexindex; p->line = lexline; } diff --git a/src/c/g1.c b/src/c/g1.c index d6c4ec4d..08e93b70 100644 --- a/src/c/g1.c +++ b/src/c/g1.c @@ -488,18 +488,3 @@ int lgetc() return (ch); } } - -/********************************************************************** - - STCMP - Compare Strings - -**********************************************************************/ - -int stcmp (s1, s2) char *s1,*s2; - - {int u; - - while ((u = *s1++) == *s2++) if (!u) return (TRUE); - return (FALSE); - } - \ No newline at end of file diff --git a/src/c/gt.stinkr b/src/c/gt.stinkr index 44d156989969baa64a0f8aabfbc486a1f30dff8a..545da2708c8e3297bace45ec73925121893dedf3 100644 GIT binary patch literal 83 zcmb LORY%dVgLdFHg*%n