Docsity

String Oriented Symbolic Language - Programming Languages - Lecture Slides, Slides of Programming Languages

Partial preview of the text

Download String Oriented Symbolic Language - Programming Languages - Lecture Slides and more Slides Programming Languages in PDF only on Docsity!

SNOBOL

• StriNg Oriented SymBOlic Language

• Special purpose language for string

manipulation and handling

• Invented in 1962 at the Bell Labs

• Farber, Griswold, and Polensky

• It was created out of the frustrations of

working with the languages of the that time

because they required the developers to

write large programs to do a single

operation

Application

  • It was used to do most of the work in designing

new software and interpreting different language grammars

  • Toward the end of the eighties, newer

languages were created which could also be used for string manipulation

  • They include the PERL and AWK languages.

Unlike SNOBOL, Perl and Awk use regular expressions to perform the string operations

  • Today, roughly forty years after its release, the

language is rarely used!

Simple Operators

• Unary vs. Binary

 more on it later

• Assignment Operator

• Arithmetic Operators

• Parentheses

Variables

  • The name of a variable must begin with an upper or lower case letter
  • The language is ‘case insensitive’
  • If it is more than one character long, the remaining characters may be any combination of letters, numbers, or the characters ‘.’ (period) and ‘_’ (underscore)
  • The name may not be longer than the maximum length of a line (120 characters)

Snobol Statement Structure

Label Statement body :GOTOField

  • Label
    • Must begin in the first character position of a statement
    • Must start with a letter or a number

Snobol Statement Structure

  • The GOTO Field

 :(label)  :S(label)  :F(label)  :S(label1) F(label2)

Assignment Statement

variable = value

v = 5

w.1 = v

w = 14 + 3 * -

Spaces around arithmetic operators are necessary

No Spaces; Unary operator!

Strings

v = ‘Dog’

v = “Cat’s”

NULL =