Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005634OCamlOCaml generalpublic2012-06-05 10:052012-06-13 19:58
Reporterfrisch 
Assigned Tofrisch 
PrioritynormalSeverityfeatureReproducibilityhave not tried
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0005634: Proposal: parsetree rewriters
DescriptionI believe many Camlp4 syntax-extension could be implemented with a much more basic technology. I've described a proposal for extending the OCaml syntax with a fixed number of extension points (attributes and quotations) and letting the compilers pipe the parsed AST through one or several external rewriters:

   http://www.lexifi.com/blog/syntax-extensions-without-camlp4 [^]

Now that "compilerlibs" are officially installed, and as a first step towards this proposal, I'd like to propose for inclusion the tiny attached patch (also in the ast_rewriter branch of the SVN). It only extends the compilers with a new "-ppx" flag, similar to (and compatible with) the existing "-pp". Invoking the compiler with "-ppx cmd" pipes the parsed AST (interface/implementation) through the specified command (actually, it passes two filenames -- input and ouput -- as extra arguments to the command).

An example of how to write an AST rewriter is available in the SVN:

http://caml.inria.fr/cgi-bin/viewvc.cgi/ocaml/branches/ast_rewriter/experimental/frisch/ [^]

TagsNo tags attached.
Attached Filesdiff file icon patch_ast_rewriter.diff [^] (6,092 bytes) 2012-06-05 10:05 [Show Content]

- Relationships

-  Notes
(0007555)
frisch (developer)
2012-06-13 19:58

The branch has been merged to the trunk.

- Issue History
Date Modified Username Field Change
2012-06-05 10:05 frisch New Issue
2012-06-05 10:05 frisch File Added: patch_ast_rewriter.diff
2012-06-13 09:20 frisch Assigned To => frisch
2012-06-13 09:20 frisch Status new => assigned
2012-06-13 19:58 frisch Note Added: 0007555
2012-06-13 19:58 frisch Status assigned => resolved
2012-06-13 19:58 frisch Resolution open => fixed


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker