From: Paul Snively <psnively@mac.com>
To: caml-list@yquem.inria.fr
Subject: Using ulex
Date: Sun, 3 Jul 2005 12:12:57 -0700 [thread overview]
Message-ID: <73C4942E-2CD1-42AC-91D7-7D0939AA7FA6@mac.com> (raw)
-----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-----
next reply other threads:[~2005-07-03 19:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-03 19:12 Paul Snively [this message]
2005-07-03 21:32 ` [Caml-list] " Alain Frisch
2005-07-03 22:27 ` Paul Snively
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=73C4942E-2CD1-42AC-91D7-7D0939AA7FA6@mac.com \
--to=psnively@mac.com \
--cc=caml-list@yquem.inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).