1

I need to use parse an OCaml source file into a typed AST and I believe ppx_jane is the right package to do the work. After installing it using opam, I still don't know what functions are available.

This is a link to the ppx_jane package on opam. It tells no more than the basic info and dependencies.

Though I could search on Github to see how other programmers call functions provided by this package, I still cannot get an exhaustive list of all available functions.

Yixing Liu
  • 2,179
  • 1
  • 20
  • 36
  • Doesn't this page : https://github.com/janestreet/ppx_driver help you ? – Lhooq Mar 06 '17 at 13:37
  • 1
    Could you give more information about what you want to do exactly ? Because ppx_jane is not at all what you need to turn OCaml source files into an AST (typed or not). ppx_jane is just a bundle of all the syntax extensions used by janestreet. – Drup Mar 06 '17 at 13:44
  • I originally intended to use ppx_ast by jane street. However, there is a problem with its jbuild (I have submitted an issue). So I am looking for package that may contain a function that can convert a piece of OCaml code to a type AST. – Yixing Liu Mar 06 '17 at 14:22
  • What do you intend to do with this type AST? The answer to your question will depend on what is your actual goal. – Drup Mar 06 '17 at 17:58

1 Answers1

0

A bit late but for your original problem, (OCaml source file -> typed AST ) doesn't ocamlc -dtypedtree a.ml do the job?

About knowing the set of function provided by an OCaml module there are several options. Here's few of them:

  1. looking at the doc online
  2. in your favorite toplevel :

    #require "package_name";;
    #show Module_name;;
    
  3. ocamlc -i module.ml
ghilesZ
  • 1,502
  • 1
  • 18
  • 30