[Oz] Compiling Oz file

Leif Kornstaedt kornstae at ps.uni-sb.de
Tue Jan 26 10:11:53 CET 1999


girault at info.unicaen.fr (Francois Girault) writes:
> I need to use a scanner, also, I tried the example. It works very well. But I need to compile my Oz programm (which use the scanner) and I can't compile. The result is :
> 
> %********************* binding analysis error *******************
> %**
> %** variable GumpScanner not introduced
> %**
> %** in file "/data/Langages/Mozart/share/gump/examples/LambdaScanner.ozg", line 2, column 27
> 
> Could anyone help me or tell me how to compile my program.

The example file you mention is meant to be run from the OPI,
which you seem to have done with success.  If you want to
compile a program (or module) stand-alone and save it into a
pickle, you have to turn it into a functor.  Thus, the file
must not have the form

   declare
   scanner LambdaScanner from GumpScanner.'class'
      ...
   end

but look somewhat like

   functor
   import
      GumpScanner('class')
   export
      LambdaScanner
   define
      scanner LambdaScanner from GumpScanner.'class'
	 ...
      end
   end

Be sure to compile with `ozc --gump' so that your Gump
definitions are processed.

See the Application Programming Tutorial for more information
on functors and developing stand-alone programs.

By the way, the interactive system is also compiler-based.
This means that your program's efficiency will be the same
no matter whether you compile it from the command line or
run it from the OPI.

Have fun,
Leif.

-
Please send submissions to users at mozart-oz.org
and administriva mail to users-request at mozart-oz.org.
The Mozart Oz web site is at http://www.mozart-oz.org/.





More information about the mozart-users mailing list