Bare Bones Language Summary

Comments

In this implementation, a '#' character introduces a comment, which continues to the end of the source line.

Reserved words

The words in the following list are reserved, and may not be used as identifiers:

Reserved words are case-insensitive.

Identifiers

Identifiers must begin with an alphabetic character, and may contain alphabetic, numeric, and underscore characters. Identifiers are case-insensitive, thus "FOO", "Foo", and "foo" are the same identifier. Reserved words my not be used as identifiers.

Variables

In Bare Bones, variables are named by an identifier and may contain any arbitrarily large non-negative integer values. This implementation is currently limited to the size of the host C compiler's uintmax_t type, which typically is 2^64-1.

I/O

Bare Bones does not provide any I/O facilities. Input may be accomplished by initializing variables before program execution using either command-line options or an initialization section, or by using the "clear" and "incr" statements in the program.

Output consists of the state of variables when the program halts. This implementation will print the variable names and contents to standard output.

Statements

statement effect
clear <var>; Set the variable to zero.
incr <var>; Increment the value of the variable.
decr <var>; Decrement the value of the variable, except that if the value was already zero, it remains zero.
while <var> not 0 do;
<statements>
end;
Loop while the variable's value is not zero. May contain one or more statements, including nested while loops. If the statements do not alter the value of the loop variable, the loop will never terminate.
copy <var> to <var>; Copy one variable to another, preserving value of original.

Language extensions

One extension is added to the language as defined in the book. At the beginning of a Bare Bones source file, prior to the program proper, there may be an initialization section, in which variables may be initialized to non-negative integer values:


        init X = 37;

Last updated February 20, 2008

Copyright 2008 Eric Smith

eric@brouhaha.com

hacker emblem
Best Viewed With Any Browser Valid HTML 4.01! Valid CSS!

check now

check now