Introduction to SNOBOL Programming Language


Introduction :

SNOBOL was designed in the early 1960s by three people at Bell Laboratories: (D.J. Farber, R.E. Griswold, and F.P. Polensky (Farber et al., 1964).

History :

SNOBOL is a special purposed language developed to provide a powerful means of doing character string manipulation. Accordingly SNOBOL has a collection of powerful operations for doing string pattern matchings. The most common early application of SNOBOL was to write text editors. Because of the dynamic nature of SNOBOL and its interpreter implementation, it is now considered too slow for such applications. Infact SNOBOL is now close to being completely unused.

Basic Features :

  • Data Types :

The data types used by Snobol Language are as follows :

 
Data Type		Formal Identification

string			STRING
integer			INTEGER
real number		REAL
pattern structure	PATTERN
array			ARRAY
table			TABLE
created Name		NAME
unevaluated expression	EXPRESSION
object code		CODE
programmer-defined	Data type name
external		EXTERNAL
Integers, reals, strings, patterns, arrays, and tables are types of data objects that are built into the SNOBOL4 language. Facilities are provided in the language to permit a programmer to define additional types of data. This facilitates representation of structural relationships inherent in data.

  • Modular Units :
Many SNOBOL4 procedures are invoked by functions built into the system, called called primitive functions. Operations that occur frequently are implemented as primitive functions for efficiency. In addition, facilities are available for a programmer to define his own sournce language function. A programmer defined function in SNOBOL4 must include:
i) a call to the primitive function DEFINE for each programmer-defined function.
ii) a procedure, written in SNOBOL$, for each function.
Many functions are conveniently defined recursively. For example, factorials may be defined as
fact(0) = 1
fact(n) = n*fact(n-1) for n>0

  • Parameter Passing methods :
Parameters can be passed in SNOBOL by value. When a parameter is passed by value, the value of the actual parameter is used to intialize the corresponding formal parameter, which then acts as a local variable in the subprogram, thus providing in-mode semantics.

Relating Web Sites :


Web page designed by Mohammad Noman Hameed