Share on Facebook Share on Twitter Email
Answers.com

Stropping

 
Wikipedia: Stropping

When applied to computer languages, stropping refers to the method used to mark letter sequences as having a special property (most often being a keyword or certain type of variable/storage location). For instance, some implementations of Algol 68[1][2] treat letter sequences prefixed by a single quote, ', as being keywords (e.g., 'BEGIN)[3] whereas Algol 60 commonly used only the convention of quotes around the word (e.g. 'BEGIN' or ‘BEGIN’). In fact it was often the case that several stropping conventions might be in use within the one language, and sometimes even within the one language processor, such as ALGOL 68RS. The Atlas Autocode compiler had the choice of three: keywords could be underlined using backspace and overstrike on a Flexowriter keyboard, they could be introduced by a %percent %symbol, or they could be typed in UPPER CASE with no delimiting character (in which case all variables had to be in lower case).

The use of stropping allows the same letter sequence to be used both as a keyword and as an identifier. Most modern programming languages do not use stropping. Exceptions include Ruby and Perl, both of which use sigils to identify characteristics of variables/constants (Perl uses sigils to designate the type of variable, Ruby uses it to distinguish variables from constants and scope). As well as increasing the set of identifiers available, stropping allowed for a much more efficient lexical pre-pass (commonly called 'line reconstruction') before parsing, virtually eliminating the need for a complex lexer such as Lex.

Contents

Example of different ALGOL 68 program representations

Algol68 as typically published
¢ bold/underline typeface ¢
mode xint = int;
xint sum sq:=0;
for i while
  sum sq≠70×70
do
  sum sq+:=i↑2
od 
quote stropping (similar to wiki)
'pr' quote 'pr' 
'mode' 'xint' = 'int';
'xint' sum sq:=0;
'for' i 'while'
  sum sq≠70×70
'do'
  sum sq+:=i↑2
'od' 
Code for a 7-bit/ascii compiler
.PR UPPER .PR
MODE XINT = INT;
XINT sum sq:=0;
FOR i WHILE
  sum sq/=70*70
DO
  sum sq+:=i**2
OD 
Code for a 6-bits/byte compiler
.PR POINT .PR
.MODE .XINT = .INT;
.XINT SUM SQ:=0;
.FOR I .WHILE
  SUM SQ .NE 70*70
.DO
  SUM SQ .PLUSAB I .UP 2
.OD
Algol68 using RES stropping
.PR RES .PR
mode .xint = int;
.xint sum sq:=0;
for i while
  sum sq≠70×70
do
  sum sq+:=i↑2
od 

See also

References

  1. ^ http://www.fh-jena.de/~kleine/history/languages/Algol68-RR-HardwareRepresentation.pdf
  2. ^ van Wijngarten et al. (1976) Section 9.3
  3. ^ Lindsey and van der Meulen (1977) pp.348-349

References


Search unanswered questions...
Enter a question here...
Search: All sources Community Q&A Reference topics
 
 

 

Copyrights:

Wikipedia. This article is licensed under the Creative Commons Attribution/Share-Alike License. It uses material from the Wikipedia article "Stropping" Read more