Tokens are the base elements of ColdC. There are many different types of tokens ranging from single characters to lines of text. The following characters and pairs of characters are tokens in ColdC:
{ } [ ] #[ ] `[ ] ( ) (| |) (> <)
, ; = += -= *= /= ! - + * / % ..
== != > >= < <= . || && ? | @ -- ++
The above tokens are used as operators and punctuation in ColdC expressions.
You can use identifiers as tokens and as parts of tokens. An identifier
is a sequence of alphabetic and numeric characters or underlines which
does not begin with a number. Identifiers in ColdC are case-sensitive, so
the identifiers CAR and car are not equivalent.
The following are valid identifiers:
we_3_kings obj a
By themselves, identifiers usually represent variables. However, certain identifiers have special meanings to the parser. These reserved words are used in writing certain kinds of statements and expressions. They are:
var, if, else, while, for, switch, case, default, break, continue, return, catch, any, with handler, pass, to, in
There are several kinds of tokens for denoting literal expressions of
various data types. These are integers, denoted by a sequence of
digits; strings, denoted by a sequence of characters enclosed in
double quotes; object numbers, denoted by a hash mark (#)
and a number; object names, denoted by a dollar sign ($)
followed by an identifier; symbols, denoted by a single forward
quote (') and an identifier; and error codes, denoted by
a tilde (~) and an identifier. These literals are described
more fully in the section Data Types.
Last Modified on Jan 25 1996
Copyright © 1995, 1996, Brandon Gillespie