caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] parser error
@ 2003-10-18 20:33 Flavio Leonardo Cavalcanti de Moura
  2003-10-18 21:56 ` Damien Doligez
  0 siblings, 1 reply; 4+ messages in thread
From: Flavio Leonardo Cavalcanti de Moura @ 2003-10-18 20:33 UTC (permalink / raw)
  To: caml-list

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] parser error
  2003-10-18 20:33 [Caml-list] parser error Flavio Leonardo Cavalcanti de Moura
@ 2003-10-18 21:56 ` Damien Doligez
  2003-10-20 10:46   ` Dmitry Bely
  0 siblings, 1 reply; 4+ messages in thread
From: Damien Doligez @ 2003-10-18 21:56 UTC (permalink / raw)
  To: flavio; +Cc: caml-list

On Saturday, October 18, 2003, at 10:33 PM, Flavio Leonardo Cavalcanti 
de Moura wrote:

> 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:

Since your parser is written with streams, you now need to compile
with "ocamlc -pp camlp4o" instead of simply "ocamlc".

-- Damien

-------------------
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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] parser error
  2003-10-18 21:56 ` Damien Doligez
@ 2003-10-20 10:46   ` Dmitry Bely
  2003-10-20 11:02     ` Sven Luther
  0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Bely @ 2003-10-20 10:46 UTC (permalink / raw)
  To: caml-list

Damien Doligez <damien.doligez@inria.fr> writes:

>> 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:
>
> Since your parser is written with streams, you now need to compile
> with "ocamlc -pp camlp4o" instead of simply "ocamlc".

BTW, now the situation with camplp4 is clear (it's integral part of Ocaml
distribution), so why not to make it the default parser for Ocaml and get
rid of yacc grammar completely?

- Dmitry Bely


-------------------
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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] parser error
  2003-10-20 10:46   ` Dmitry Bely
@ 2003-10-20 11:02     ` Sven Luther
  0 siblings, 0 replies; 4+ messages in thread
From: Sven Luther @ 2003-10-20 11:02 UTC (permalink / raw)
  To: Dmitry Bely; +Cc: caml-list

On Mon, Oct 20, 2003 at 02:46:38PM +0400, Dmitry Bely wrote:
> Damien Doligez <damien.doligez@inria.fr> writes:
> 
> >> 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:
> >
> > Since your parser is written with streams, you now need to compile
> > with "ocamlc -pp camlp4o" instead of simply "ocamlc".
> 
> BTW, now the situation with camplp4 is clear (it's integral part of Ocaml
> distribution), so why not to make it the default parser for Ocaml and get
> rid of yacc grammar completely?

Because it is so damn slow ?

Friendly,

Sven Luther

-------------------
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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-10-20 11:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-18 20:33 [Caml-list] parser error Flavio Leonardo Cavalcanti de Moura
2003-10-18 21:56 ` Damien Doligez
2003-10-20 10:46   ` Dmitry Bely
2003-10-20 11:02     ` Sven Luther

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).