Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Caml-list] Unbound type constructor

293 views
Skip to first unread message

snowfall

unread,
Apr 25, 2007, 4:23:15 PM4/25/07
to caml...@yquem.inria.fr

Hi.

I am developing a compiler for a language. I have done the parser, the lexer
and the ast. But when I execute the command ocamlc -c parser.mli is shown
the error "unbound type constructor abacus_ast.progr".

Here is the code of the AST:

open Lexing

type ident = string
;;

..

type progr= ident * (tipo list) * (declaracao_de_variaveis list) * (funcoes
list) * (instrucao list)
;;

and in the parser I put:
% type < Abacus_ast.progr > programa

Can anyone tell me what I am doing wrong?

Best regards
--
View this message in context: http://www.nabble.com/Unbound-type-constructor-tf3647847.html#a10188741
Sent from the Caml Discuss2 mailing list archive at Nabble.com.

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

skaller

unread,
Apr 25, 2007, 11:04:42 PM4/25/07
to snowfall
On Wed, 2007-04-25 at 13:21 -0700, snowfall wrote:
> Hi.
>
> I am developing a compiler for a language. I have done the parser, the lexer
> and the ast. But when I execute the command ocamlc -c parser.mli is shown
> the error "unbound type constructor abacus_ast.progr".

>

> and in the parser I put:
> % type < Abacus_ast.progr > programa
>
> Can anyone tell me what I am doing wrong?

yep .. you have to do

ocamlc -c abacus_ast.mli

first. If A depends on B, you must compile B before you
compile A. This applies to all files whether ml or mli
files. x.ml depends on x.mli if it exists.

--
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net

0 new messages