Re: Parsing a language with optional spaces

Akim Demaille <[email protected]>
Newsgroups gmane.comp.parsers.bison.general
Message-ID <[email protected]>

> Le 6 juil. 2020 à 22:17, Christian Schoenebeck <[email protected]> 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 :)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.