--- In ocaml_beginners%40yahoogroups.com">ocaml_beginners
yahoogroups.com, "William D. Neumann"
<wneumann
...> wrote:
>
> On Tue, 8 May 2007, mo.deeq wrote:
>
> > Hi all
> > First of all, sorry for the complete newbie question, I'm trying to
> > create an abstract syntax tree + parser for a small language, can
> > some one help me understand what they following error is telling me
> > and why?
> >
> >
> > -----
> > The implementation parser.ml does not match the interface parser.cmi:
> > Values do not match:
> > val file : (Lexing.lexbuf -> Lexer.token) -> Lexing.lexbuf -> Ast.ast
> > is not included in
> > val file : (Lexing.lexbuf -> token) -> Lexing.lexbuf -> Ast.ast
> > make: *** [parser.cmo] Error 2
>
>
> What it's telling you is that your lexer is returning a type of
> Lexer.token, rather than the expected (Parser.)token. Did you
define your
> set of tokens over in your mll file as well? If so, you'll want to use
> the ones defined by the parser. You can do this easily enough by
tossing
> an "open Parser" up in the header of the lexer source. Just make
sure you
> compile parser.mli before lexer.ml so it'll have the token type
> information.
>
> William D. Neumann
>
> ---
>
> "There's just so many extra children, we could just feed the
> children to these tigers. We don't need them, we're not doing
> anything with them.
>
> Tigers are noble and sleek; children are loud and messy."
>
> -- Neko Case
>
> Life is unfair. Kill yourself or get over it.
> -- Black Box Recorder
>
Hi William,
Thank you very much for that, it made sense, I have defined them in
my lexer, however, i had also included a "open Parser" to the top of
my .mll file ... but it seemed to make no difference. However
removing the definitions from my .mll file has finally got is compiling.
Thanks again....
p.s. is there a knack or pointers to understanding the somewhat
cryptic (to a newbie at least) error messages that ocaml returns?
-deeq
.