help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Parsing a language with optional spaces


From: Akim Demaille
Subject: Re: Parsing a language with optional spaces
Date: Wed, 8 Jul 2020 22:17:51 +0200


> Le 6 juil. 2020 à 22:17, Christian Schoenebeck <schoenebeck@crudebyte.com> a 
> écrit :
> 
> Ok, no idea where one can see the original code (if public at all). I just 
> found this:
> 
> http://newton.freehostia.com/hp/bas/TREKPT.txt

There are some most beautiful BASIC idioms in there.  I love this:

5245  LET L=ABS(A)
5247  GOSUB 9700

...


9695  REM Digit print subroutine, digit in L
9700  IF L=1 THEN 9810
9710  IF L=2 THEN 9830
9720  IF L=3 THEN 9850
9730  IF L=4 THEN 9870
9740  IF L=5 THEN 9890
9750  IF L=6 THEN 9910
9760  IF L=7 THEN 9930
9770  IF L=8 THEN 9950
9780  IF L=9 THEN 9970
9790  PRINT "0";
9800  RETURN
9810  PRINT "1";
9820  RETURN
9830  PRINT "2";
9840  RETURN
9850  PRINT "3";
9860  RETURN
9870  PRINT "4";
9880  RETURN
9890  PRINT "5";
9900  RETURN
9910  PRINT "6";
9920  RETURN
9930  PRINT "7";
9940  RETURN
9950  PRINT "8";
9960  RETURN
9970  PRINT "9";
9980  RETURN

BASIC is all about GOTO, yet it does not even feature computed GOTOs :)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]