/
ColdC/Functions/
ColdC/Structure/
<head><title>ColdC: Language Structure: Tokens</title></head>

<body>
<h1 align=center><a href="/ColdC/">ColdC</a>: <a href="/ColdC/Structure/">Language Structure</a>: Tokens</h1>

<hr>
<p>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:</p>

<blockquote>
<pre>
{   }   [   ]   #[  ]   `[  ]   (   )   (|  |)  (>  <)
,   ;   =   +=  -=  *=  /=  !   -   +   *   /   %   ..
==  !=  >   >=  <   <=  .   ||  &&  ?   |   @   --  ++  
</pre>
</blockquote>

<p>The above tokens are used as operators and punctuation in ColdC expressions.</p>

<p>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 <code>CAR</code> and <code>car</code> are not equivalent.
The following are valid identifiers:</p>

<blockquote><pre>
we_3_kings
obj
a
</pre></blockquote>

<p>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:</p>

<blockquote><pre>
var, if, else, while, for, switch, case, default, break, continue, return,
catch, any, with handler, pass, to, in
</pre></blockquote>

<p>There are several kinds of tokens for denoting literal expressions of
various data types. These are <i>integers</i>, denoted by a sequence of
digits; <i>strings</i>, denoted by a sequence of characters enclosed in
double quotes; <i>object numbers</i>, denoted by a hash mark (<code>#</code>)
and a number; <i>object names</i>, denoted by a dollar sign (<code>$</code>)
followed by an identifier; <i>symbols</i>, denoted by a single forward
quote (<code>'</code>) and an identifier; and <i>error codes</i>, denoted by
a tilde (<code>~</code>) and an identifier. These literals are described
more fully in the section <a href="types.htmL">Data Types</a>.</p>

<hr size=4><p align=center><i>Last Modified on Jan 25 1996</i>
<br><i>Copyright &copy; 1995, 1996, Brandon Gillespie</i>
</body>