caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Using ulex
@ 2005-07-03 19:12 Paul Snively
  2005-07-03 21:32 ` [Caml-list] " Alain Frisch
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Snively @ 2005-07-03 19:12 UTC (permalink / raw)
  To: caml-list

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi folks,

I'm trying to use Alain Frisch's ulex to write a simple .ini file  
lexer. I'm still pretty new to the module system, how libraries work,  
and in particular how camlp4 and syntax extensions work. Here are the  
things I've tried to just get ulex to tell me I'm not being foolish.  
This is with O'Caml 3.08.3 and findlib 1.0.4 on Mac OS X 10.4.1:

- -------------------------------------snip  
snip-------------------------------------
Valhalla:~ psnively$ ocaml
         Objective Caml version 3.08.3

# #load "camlp4o.cma";;
         Camlp4 Parsing version 3.08.3

# #load "/usr/local/lib/ocaml/site-lib/ulex/pa_ulex.cma";;
# #load "/usr/local/lib/ocaml/site-lib/ulex/ulexing.cma";;
# (lexer ("#!" [^ '\n']* "\n")? -> ()) lexbuf;;        (* This is  
from the README *)
Unbound value Ulexing.mark
#
- -------------------------------------snip  
snip-------------------------------------

OK, so maybe I need to "open Ulexing;;":

- -------------------------------------snip  
snip-------------------------------------
# open Ulexing;;
Unbound module Ulexing
#
- -------------------------------------snip  
snip-------------------------------------

I'm working too hard: this is what findlib is for. So, in a fresh ocaml:

- -------------------------------------snip  
snip-------------------------------------
Valhalla:~ psnively$ ocaml
         Objective Caml version 3.08.3

# #use "topfind";;
- - : unit = ()
Findlib has been successfully loaded. Additional directives:
   #require "package";;      to load a package
   #list;;                   to list the available packages
   #camlp4o;;                to load camlp4 (standard syntax)
   #camlp4r;;                to load camlp4 (revised syntax)
   #predicates "p,q,...";;   to set these predicates
   Topfind.reset();;         to force that packages will be reloaded
   #thread;;                 to enable threads

- - : unit = ()
# #camlp4o;;
/usr/local/lib/ocaml/camlp4: added to search path
/usr/local/lib/ocaml/camlp4/camlp4o.cma: loaded
         Camlp4 Parsing version 3.08.3

# #require "ulex";;
/usr/local/lib/ocaml/site-lib/ulex: added to search path
/usr/local/lib/ocaml/site-lib/ulex/pa_ulex.cma: loaded
/usr/local/lib/ocaml/site-lib/ulex/ulexing.cma: loaded
# (lexer ("#!" [^ '\n']* "\n")? -> ()) lexbuf;;
Unbound value __ulex_partition_0
#
- -------------------------------------snip  
snip-------------------------------------

I confess to being stumped. Any advice would be most welcome.

Best regards,
Paul Snively

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)

iEYEARECAAYFAkLIOMEACgkQO3fYpochAqLSsACgyRinCveNEtyHRQUyt/1Y//ao
q/gAn1tj7Zw0g1KyqBpeQMxd9LvscE13
=45hF
-----END PGP SIGNATURE-----


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] Using ulex
  2005-07-03 19:12 Using ulex Paul Snively
@ 2005-07-03 21:32 ` Alain Frisch
  2005-07-03 22:27   ` Paul Snively
  0 siblings, 1 reply; 3+ messages in thread
From: Alain Frisch @ 2005-07-03 21:32 UTC (permalink / raw)
  To: Paul Snively; +Cc: caml-list

Paul Snively wrote:
> I'm trying to use Alain Frisch's ulex to write a simple .ini file 
> lexer. I'm still pretty new to the module system, how libraries work, 
> and in particular how camlp4 and syntax extensions work. Here are the 
> things I've tried to just get ulex to tell me I'm not being foolish. 
> This is with O'Caml 3.08.3 and findlib 1.0.4 on Mac OS X 10.4.1:

Ulex is not designed to work in the toplevel. (Technical reason: it adds
 some declarations at the beginning of the compilation unit.)

-- Alain


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] Using ulex
  2005-07-03 21:32 ` [Caml-list] " Alain Frisch
@ 2005-07-03 22:27   ` Paul Snively
  0 siblings, 0 replies; 3+ messages in thread
From: Paul Snively @ 2005-07-03 22:27 UTC (permalink / raw)
  To: Alain Frisch; +Cc: caml-list

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Alain!

On Jul 3, 2005, at 2:32 PM, Alain Frisch wrote:

> Ulex is not designed to work in the toplevel. (Technical reason: it  
> adds
>  some declarations at the beginning of the compilation unit.)
>
Oh, that's a shame; I'm quite spoiled by the general ability to test  
things out interactively before committing them to a batch compile.  
Still, I did "make view_test" and "make run_test" in the distribution  
directory, and that clarifies what's going on quite nicely. Thanks  
for the prompt reply!

> -- Alain
>
> _______________________________________________
> 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

Best regards,
Paul Snively

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)

iEYEARECAAYFAkLIZmAACgkQO3fYpochAqLTqACgmkydEfXsF1cWNdJzIHwsZGjI
dBUAn3twjV2kImZ4CWPZ35N6fou5vbKm
=rIFq
-----END PGP SIGNATURE-----


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-07-03 22:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-03 19:12 Using ulex Paul Snively
2005-07-03 21:32 ` [Caml-list] " Alain Frisch
2005-07-03 22:27   ` Paul Snively

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).