Commit 958d4642 authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2003-07-12 15:31:23 by cvscast] Empty log message

Original author: cvscast
Date: 2003-07-12 15:31:23+00:00
parent efbcff14
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<page name="tutorial_errors">
<title>Error messages</title>
<banner>Error messages</banner>
<left>
<boxes-toc/>
</left>
<box title="Key concepts" link="p1">
<b style="color:#FF0080">TO BE DONE</b>
</box>
<box title="Empty types" link="pr">
<p>
type system can find very nasty errors. For instance look at this declaration
</p>
<p>
<tt>
&lt;!ELEMENT person (name,children)><br/>
&lt;!ELEMENT children (person+)><br/>
&lt;!ELEMENT name (#PCDATA)><br/>
</tt>
</p>
<p>
You see the problem? There is no document (without refs) that can be valid,
as a person contains a sequence of childrens that contain a non empty
sequence of persons, etc generating an infinite tree.
</p>
<p>
Let us write the same type in CDuce and look at the result (taken verbatim
from the on line demo, no color or formatting added)
</p>
<tt>
type Person = &lt;person>[ Name Children ]
type Children = &lt;children>[Person+]
type Name = &lt;name>[PCDATA]
Warning at chars 57-76:
<i>type Children = <font color="red"><b>&lt;children&gt;[Person+]</b></font></i>
This definition yields an empty type for Children
Warning at chars 14-39:
<i>type Person = <font color="red"><b>&lt;person&gt;[ Name Children ]</b></font></i>
This definition yields an empty type for Person
</code>
<p>
We paid special care in localizing errors and suggesting solutions. I can
give you more significative examples if you want, but you can ust try it by
yourself by picking the examples available on the <a
href="http://www.cduce.org/cgi-bin/cduce">on line demo</a> and putting in
them random errors.
</p>
</box>
</page>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment