Blame | Last modification | View Log | RSS feed
<!-- Crown Copyright (c) 1998 -->
<HTML>
<HEAD>
<TITLE>PL_TDF Definition</TITLE>
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#400080" ALINK="#FF0000">
<A NAME=S2>
<H1>PL_TDF Definition</H1>
<H3>January 1998</H3>
<A HREF="pl4.html"><IMG SRC="../images/next.gif" ALT="next section">
</A> <A HREF="pl1.html">
<IMG SRC="../images/prev.gif" ALT="previous section"></A>
<A HREF="pl1.html"><IMG SRC="../images/top.gif" ALT="current document"></A>
<A HREF="../index.html"><IMG SRC="../images/home.gif" ALT="TenDRA home page">
</A>
<IMG SRC="../images/no_index.gif" ALT="document index"><P>
<HR>
<DL>
<DT><A HREF="#S3"><B>2.1 </B> - Syntax description</A><DD>
<DT><A HREF="#S4"><B>2.2 </B> - Lexical Units</A><DD>
<DT><A HREF="#S5"><B>2.3 </B> - Pre-processing</A><DD>
</DL>
<HR>
<H1>2 Notation</H1>
<A NAME=S3>
<HR><H2>2.1. Syntax description</H2>
Words enclosed in angle brackets, < >, form non-terminal symbols.
Other symbols and words stand for themselves as terminal symbols.
An expansion of a non-terminal is indicated using ::= with its expansion
given as a sequence (possibly empty) of terminals and non-terminals.
For example:<P>
<PRE>
<Exp> ::= * <ident>
</PRE>
is a possible expansion of an EXP SORT. If the word for the non-terminal
starts with a capital letter then it will be totally described by
a set of such expansions; otherwise the expansion of the non-terminal
will be given by other methods in the text. <P>
The post-fix -Opt on a non terminal is an abreviation allowing an
empty expansion. For example:<P>
<PRE>
<Access>-Opt
</PRE>
is equivalent to the use of another non-terminal <AccessOption>
whose expansions are:<P>
<PRE>
<AccessOption> ::=
<AccessOption> ::= <Access>
</PRE>
The post-fix -List on a non terminal is an abreviation for lists of
objects seperated by the ,-symbol. For example:<P>
<PRE>
<Exp>-List
</PRE>
is equivalent to the use of another non-terminal <ExpList> whose
expansions are:<P>
<PRE>
<ExpList> ::= <Exp>
<ExpList> ::= <ExpList> , <Exp>
</PRE>
Both of these post-fix notations are also used with sequences of terminals
and non-terminals within the angle brackets with the same kind of
expansion. In these cases, the expansion within the angle brackets
form an anonymous non-terminal.<P>
<A NAME=S4>
<HR><H2>2.2. Lexical Units</H2>
The terminal symbols ( ), [ ], and { } always occur as parenthetic
pairs and never form part of other terminal symbols.<P>
The terminal symbols , ; and : are similarly terminators for other
terminal symbols.<P>
White space is a terminator for other terminal symbols but is otherwise
ignored except in strings.<P>
All other terminal symbols are sequences of ACSII symbols not including
the above. These are divided into seven classes: keywords, TDF constructors,
operators, <integer_denotation>s, <floating_denotation>s,
<string>s and <ident>s.<P>
The keywords and operators are expressed directly in the syntax description.
The TDF constructors are those given in the TDF specification which
have first-class SORTs as parameters and results.<P>
An <integer_denotatation> allows one to express an integer in
any base less than 16, with the default being 10. <P>
<PRE>
<integer_denotation> ::= <digit>
<integer_denotation> ::= <integer_denotation> <digit>
<integer_denotation> ::= <base> <integer_denotation>
<base> ::= <integer_denotation> r
</PRE>
Examples are 31, 16r1f, 8r37, 2r11111 - all giving the same value.<P>
A <floating_denotation> is an <integer_denotation> followed
by the . symbol and a sequence of digits. The radix of the <floating_denotation>
is given by the base of its component <integer_denotation><P>
A <string> is the same as a C string - any sequence of characters
within " ". The same C conventions hold for \ within strings
for single characters.<P>
A <character> is an string character within ` `. The same \
conventions hold.<P>
An <ident> is any other sequence of characters. They will be
used to form names for TAGs, TOKENs, AL_TAGs and LABELs.<P>
<A NAME=S5>
<HR><H2>2.3. Pre-processing</H2>
At the moment there is only one pre-processing directive. A line starting
with #include will textually include the following file (named within
string quotes), using the same path conventions as C.<P>
Comments may be included in the text using the /* ... */ notation;
this differs slightly from the C convention in that comments may be
nested.<P>
<HR>
<P><I>Part of the <A HREF="../index.html">TenDRA Web</A>.<BR>Crown
Copyright © 1998.</I></P>
</BODY>
</HTML>