Presentation is loading. Please wait.

Presentation is loading. Please wait.

SNOBOL StriNg Oriented SymBOlic Language

Similar presentations


Presentation on theme: "SNOBOL StriNg Oriented SymBOlic Language"— Presentation transcript:

1 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

2 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!

3 Simple Data Types Integers and Strings Integers; positive or negative
Illegal: ,076 Reals; originally not allowed (e.g 13.4) Strings Maximum length of a string is 5,000 characters

4 Simple Operators Unary vs. Binary Assignment Operator
-6 4 - 1 more on it later Assignment Operator = Arithmetic Operators * / ** Parentheses

5 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)

6 Variables Examples: Illegal WAGER wager P23 VerbClause SUM.OF.SQUARES

7 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

8 Snobol Statement Structure
The GOTO Field :(label) :S(label) :F(label) :S(label1) F(label2)

9 Types of Statements Assignment Pattern Matching Replacement End

10 Assignment Statement variable = value v = 5 w.1 = v w = 14 + 3 * -2
Spaces around arithmetic operators are necessary No Spaces; Unary operator!

11 Strings v = ‘Dog’ v = “Cat’s” NULL =


Download ppt "SNOBOL StriNg Oriented SymBOlic Language"

Similar presentations


Ads by Google