bs(1) | bs(1) |
NAME
bs - a compiler/interpreter for
SYNOPSIS
bs [ ®le [ args ] ]
DESCRIPTION
bs is a remote descendant of BASIC and SNOBOL4 with some C language added. bs is designed for programming tasks where program development time is as important as the resulting speed of execution. Formalities of data declaration and ®le/process manipulation are minimized.
If ®le is speci®ed on the
bs programs are made up of input lines. If the last character on a line is a \, the line is continued. bs accepts lines of the following form:
statement
label statement
A label is a name (see below) followed by a colon. A label and a variable can have the same name.
Abs statement is either an expression or a keyword followed by zero or more expressions. Some key- words (clear, compile, !, execute, include, ibase, obase, and run) are always executed as they are compiled.
Statement Syntax:
expression The expression is executed for its side effects (value, assignment, or function call). The details of expressions follow the description of statement types below.
break | break exits from the innermost for/while loop. |
clear | Clears the symbol table and compiled statements. clear is executed immediately. |
compile [expression] | |
| Succeeding statements are compiled (overrides the immediate execution default). The |
| optional expression is evaluated and used as a ®le name for further input. A clear is |
| associated with this latter case. compile is executed immediately. |
continue | continue transfers to the |
dump [name] The name and current value of every
edit | A call is made to the editor selected by the EDITOR environment variable if it is present, |
| or ed(1) if EDITOR is unde®ned or null. If the ®le argument is present on the command |
| line, ®le is passed to the editor as the ®le to edit (otherwise no ®le name is used). Upon |
| exiting the editor, a compile statement (and associated clear) is executed giving that |
| ®le name as its argument. |
exit [expression] | |
| Return to system level. The expression is returned as process status. |
execute | Change to immediate execution mode (an interrupt has a similar effect). This statement |
b
− 1 − | Section 1−49 |