User Tools

Site Tools


detokeniser

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
detokeniser [2018/04/17 15:47] – Added syntax highlighting tbest3112detokeniser [2024/01/05 00:22] (current) – external edit 127.0.0.1
Line 1: Line 1:
 =====Detokeniser===== =====Detokeniser=====
  
-//by Jon Ripley, January 2008, May 2011//\\ \\  The //FNdetokenise// function listed below accepts a string containing either a tokenised program line or tokenised code and returns a string containing detokenised code:\\ +//by Jon Ripley, January 2008, May 2011// 
 + 
 +The //FNdetokenise// function listed below accepts a string containing either a tokenised program line or tokenised code and returns a string containing detokenised code: 
 <code bb4w> <code bb4w>
         DEF FNdetokenise(S$)         DEF FNdetokenise(S$)
Line 54: Line 57:
         =O$         =O$
 </code> </code>
-\\ +
 ==== Using FNdetokenise to list the error line ==== ==== Using FNdetokenise to list the error line ====
-\\ //FNdetokenise// is useful to [[/Listing%20the%20line%20an%20error%20occurs%20in%20ON%20ERROR|list the source code of a line when one occurs]].\\ \\ + 
 +//FNdetokenise// is useful to [[/Listing%20the%20line%20an%20error%20occurs%20in%20ON%20ERROR|list the source code of a line when one occurs]]. 
 + 
 ==== Using FNdetokeniser to write a Quine ==== ==== Using FNdetokeniser to write a Quine ====
-\\  Using //FNdetokenise// it is possible to write a [[http://en.wikipedia.org/wiki/Quine_%28computing%29|Quine]], that is, a program which when run outputs its own listing:\\ + 
 +Using //FNdetokenise// it is possible to write a [[http://en.wikipedia.org/wiki/Quine_%28computing%29|Quine]], that is, a program which when run outputs its own listing: 
 <code bb4w> <code bb4w>
         P% = PAGE         P% = PAGE
Line 71: Line 78:
         END         END
 </code> </code>
-In the author's opinion using this method or ***LIST** to write a Quine is cheating.\\ \\ +In the author's opinion using this method or ***LIST** to write a Quine is cheating. 
 ==== Using the built-in detokeniser ==== ==== Using the built-in detokeniser ====
-\\  The BBC BASIC for Windows interpreter has a built-in detokeniser accessed using the ***LIST** command that detokenises a specified file and outputs the listing on the current output device. Whilst it is possible to write a simpler looking detokeniser utilising ***LIST** the resulting routine is significantly slower due to the number of file operations required.\\ \\ + 
 +The //BBC BASIC for Windows// and //BBC BASIC for SDL 2.0// interpreters have a built-in detokeniser accessed using the ***LIST** command that detokenises a specified file and outputs the listing on the current output device. Whilst it is possible to write a simpler looking detokeniser utilising ***LIST** the resulting routine is significantly slower due to the number of file operations required. 
 <code bb4w> <code bb4w>
         DEF FNdetokenise(S$)         DEF FNdetokenise(S$)
Line 102: Line 112:
         =S$         =S$
 </code> </code>
-\\ \\ **Do not use** this version in production code.+ 
 +**Do not use** this version in production code.
detokeniser.1523980047.txt.gz · Last modified: 2024/01/05 00:18 (external edit)