<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
Dear list, <BR>
&nbsp;<BR>
I am trying to make a compiler and we are having a hard time getting Alex to work. We have succeded to work out Alex using older version, but with the the 2.2 version we keep getting this error and we havent been able to figure it out.<BR>
&nbsp;<BR>
So this is our tokens definition:<BR>
&nbsp;<BR><SPAN lang=ES-UY>
{<BR>
&nbsp;&nbsp; module Lexico where<BR>
&nbsp;&nbsp;&nbsp; import Alex<BR>
}<BR>
&nbsp;<BR>
%wrapper "posn"<BR>
&nbsp;<BR>
$digit = 0-9 -- digits<BR>
$alpha = [a-zA-Z] -- alphabetic characters<BR>
&nbsp;<BR>
tokens :-<BR>
&nbsp;<BR>
$white+ ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;--Los espacios en blanco los omito<BR>
\/\/.* ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --Lo que venga después de dos barras omito<BR>
\/\*.*\*\/ ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --Lo que está entre las barras de comentario omito<BR>
$digit+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { \p s -&gt; TokenEntero p (read s) }<BR>
\' [$alpha $digit \_]* \'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { \p s -&gt; TokenString p (read s)}<BR>
[$digit]+\.[$digit]+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { \p s -&gt; TokenDouble p (read s) }<BR>
$alpha [$alpha $digit \_]*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{ \p s -&gt; TokenVar p (read s) }<BR>
&nbsp;<BR>
&nbsp;<BR>
And when we call the alexScanTokens "hello" we get this error:<BR>
&nbsp;<BR>
[TokenVar (AlexPn 0 1 1) "*** Exception: Prelude.read: no parse<BR>
&nbsp;<BR>
So we are concerned about the "<STRONG>TokenVar p (read s)</STRONG>"&nbsp;. Would that be the way to read a string? <BR>
&nbsp;<BR>
We just get this error with TokenVar and TokenString, whenever we call the function like: alexScanTokens 19&nbsp;&nbsp; , for instance we dont get any problems and the token 19 is recognized ok.<BR>
&nbsp;<BR>
Please, any ideas on what am i doing wrong????????</SPAN><BR><BR>regards, <BR>
&nbsp;<BR>
L<BR>
&nbsp;<BR>
<BR>&nbsp;<BR>                                               <br /><hr />Keep your friends updated— <a href='http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_5:092010' target='_new'>even when you’re not signed in.</a></body>
</html>