Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] parser error
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Flavio Leonardo Cavalcanti de Moura <flavio@m...>
Subject: [Caml-list] parser error
I wrote a parser originally in ocaml 3.02 and it works well. It was a
suprise for me to receive an error message when I tryed to compile it in
ocaml 3.07. The error message I receive is:

File "selexerlse.ml", line 21, characters 6-8:
Syntax error
File "selexerls.ml", line 27, characters 6-8:
Syntax error
File "selexersus.ml", line 74, characters 6-8:
Syntax error
File "subsexpl.ml", line 129, characters 45-47:
Warning: Illegal backslash escape in string
make: ** [depend] Erro 2

The error occurs exactly at the same string in three files (selexerlse.ml,
selexerls.ml and selexersus.ml) above. It in
the first occurrence of [< in the code below:

let rec  parse_expr1 = parser
      [< 'Ident s >] -> (Vr s)
    | [< 'Int 1 >] -> (One)
    | [< 'Int n >] -> (convertN(n))
    | [< 'Kwd "A";  'Kwd "("; e1 = parse_expr1; 'Kwd ","; e2 =
parse_expr1; 'Kwd ")" >] -> A(e1,e2)
    | [< 'Kwd "L"; 'Kwd "("; e1 = parse_expr1;  'Kwd ")" >] -> L(e1)
    | [< 'Kwd "Sb"; 'Kwd "("; e1 = parse_expr1 ;  'Kwd ","; sb =
parse_subs; 'Kwd ")" >] -> Sb(e1,sb)
and
parse_subs = parser
  [< 'Kwd "Id" >] -> (Id)
| [< 'Kwd "Up" >] -> (Up)
| [< 'Kwd "Pt"; 'Kwd "("; e1 = parse_expr1 ;  'Kwd ","; sb = parse_subs;
'Kwd ")" >] -> Pt(e1,sb)
| [< 'Kwd "Cp"; 'Kwd "("; s1 = parse_subs ;  'Kwd ","; s2 = parse_subs ;
'Kwd ")" >] -> Cp(s1,s2)
 ;;

Does anyone know what is the problem?

Best Regards,

  	Flávio Leonardo Cavalcanti de Moura
   		flavio@mat.unb.br      ^v^
	     www.mat.unb.br/~flavio   /(_)\
                 Use GNU/Linux!        ^ ^

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners