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
.