Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] ocamlyacc bug?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-04-22 (07:46)
From: SooHyoung Oh <shoh@d...>
Subject: [Caml-list] ocamlyacc bug?

Is the following an ocamlyacc bug?

When making application with using ocamlyacc + ocamllex,
you can make main function in trailer part (after second "%%") of "foo.mly"
It that case, it generates an error like this:
    This expression has type Lexing.lexbuf -> Eg_parse.token
    but is here used with type Lexing.lexbuf -> token

It can be fixed by excluding type specification of start non-terminal
function in "" like this:

    let line (lexfun : Lexing.lexbuf -> token) (lexbuf : Lexing.lexbuf) =
       (yyparse yytables 1 lexfun lexbuf : int)


    let line lexfun (lexbuf : Lexing.lexbuf) =
       (yyparse yytables 1 lexfun lexbuf : int)

If you want, you can view my full source in

SooHyoung Oh

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: