Commit aeb728fa 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 f12a2b0d
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<page name="tutorial_errors">
<title>Error messages</title>
<banner>Error messages</banner>
<box title="Key concepts" link="p1">
<b style="color:#FF0080">TO BE DONE</b>
<box title="Empty types" link="pr">
type system can find very nasty errors. For instance look at this declaration
&lt;!ELEMENT person (name,children)><br/>
&lt;!ELEMENT children (person+)><br/>
&lt;!ELEMENT name (#PCDATA)><br/>
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.
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)
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
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="">on line demo</a> and putting in
them random errors.
\ 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