sno Command

Purpose

Provides a SNOBOL interpreter.

Syntax

sno [File ...]

Description

The sno command provides a SNOBOL compiler and interpreter, with some differences from standard SNOBOL. It reads the named files and the standard input and compiles all input through a statement containing the end label. The rest is available to the syspit pseudo-variable.

The sno command differs from standard SNOBOL in the following ways:

  • There are no unanchored searches. To get the same effect, use lines similar to the following:
    Item Description
    a ** b Produces an unanchored search for b.
    a *x* b = x c Produces an unanchored assignment.
  • There is no back referencing.

    x = "abc"

    Item Description
    a *x* x Produces an unanchored search for abc.
  • Function declaration is done at compile time by the use of the (non-unique) define label. Execution of a function call begins at the statement following the define label. Functions cannot be defined at run time, and the use of the name define is preempted. There is no provision for automatic variables other than parameters. For example:
    define f()
    define f(a, b, c)
  • All labels except define (even end), must have a nonempty statement.
  • Labels, functions, and variables must all have distinct names. In particular, the nonempty statement on end cannot merely name a label.
  • If start is a label in the program, program execution begins there. If not, execution begins with the first executable statement. The define label is not an executable statement.
  • There are no built-in functions.
  • Parentheses for arithmetic are not needed. Normal precedence applies. Because of this, the arithmetic operators \ (backslash) and * (asterisk) must be set off by spaces.
  • The right side of assignments must be nonempty.
  • Either ' (single quotation mark) or " (double quotation mark) can be used for literal quotation marks.
  • The pseudo-variable sysppt is not available.

Examples

To run the file test.s through the sno command and direct the output into the file output, enter:

sno < test.s > output

Files

Item Description
/usr/bin/sno Contains the sno command.